Situation - User completes payments for subscription, the app sends purchase token to the backend with the user id. At the same time, we have also configured webhook, which also send same purchase token to map user id to same purchase token and we will get future webhook events for that user and purchase token.
Consider we have set up staging endpoint URL for the current topic name in play console.
This is fine: When staging user completes payment, the app sends data to a staging server and real-time dev. The notification also comes on the staging server.
This is problem - But After LIVE (App published) when staging user completes payment, the app sends data to staging server BUT real-time dev. The notification goes to production server because after LIVE we have changed to production endpoint URL for the current topic name in play console.
Possible solution -
- We can always create dummy user in production to test payments so that all data comes to the production server.
- We can create one API which sits on the production server and distinguishes SKU id for stagging and production whenever real-time dev. comes. If SKU id is from production then continue otherwise hits staging server API to dump that data in stating.
Help - I need your help in knowing the best solution for this.