Activate Product via In-App Purchase based on Real-time developer notifications

29 Views Asked by At

We develop a mobile application that has a backend server and use in-app product purchase.

I researched the options to grant the user product usage via in-app purchase as backend developer.

It seems the most common solution is

  1. Mobile app interacts with payment gateway of platform(Google/Apple) to purchase in-app product
  2. If purchase is ok,then mobile app sends the receipt of purchase to backend.
  3. Backend validates the receipt against Google/Apple developer api
  4. If the receipt is ok (Valid), backend activate the product in its database.
  5. User start to use in-app product since the purchase finished and backend activated the product in its database.

My Question :

Can we activate the product without interacting with mobile application as service to service via RealTime Notification of Google or Apple ?

Can we trust this flow that I explained the steps of it in the below?

We will have a push endpoint configured on Google/Apple

Steps will be like the below

  1. Google/Apple will send the productId and purchase token to backend endpoint(push endpoint)
  2. We will validate purchase token and productId against Google/Apple developer api
  3. If it is valid,we will activate the product in our backend database.Then backend will return 200(OK) to Google/Apple as acknowledgement so they will remove the info from their topic.
  4. User start to use in-app product since the purchase already finished and backend activated the product in its database in its push endpoint.
0

There are 0 best solutions below