Mobile In-App Purchase Validation on AWS
Publication date: January 1, 2021 (Diagram history)
This architecture provides a serverless solution for validating in-app purchases from the Google Play Store and Apple App Store, and for managing refunds. The architecture uses Amazon API Gateway, AWS Lambda, and Amazon DynamoDB to process transactions securely at scale.
Mobile In-App Purchase Validation on AWS diagram
The following steps describe the purchase validation flow:
-
The mobile game client makes a purchase by using the OS-specific SDK and stores the receipt locally.
-
The game client makes an API request to API Gateway to validate the receipt and receive purchased items.
-
The Lambda function checks the Transactions table in DynamoDB to validate that the receipt has not been used previously.
-
The Lambda function validates the receipt through the Google Play Store or Apple App Store API.
-
After validation, the Lambda function adds items to the PlayerData table in DynamoDB and adds the receipt to the Transactions table with any additional metadata.
-
The client receives a success message, locally synchronizes the purchased items data, and deletes the local receipt copy.
The following steps describe the refund flow:
-
API Gateway receives notifications on refunded transactions on iOS. A scheduled Lambda function queries refunded transactions on Android.
-
Refunded transactions are pushed to an Amazon Simple Queue Service queue by the Lambda functions.
-
A Lambda function handles the refund, including any additional actions like closing the player account.
-
A Lambda function updates the DynamoDB tables to remove items and mark the transaction as refunded.
Further reading
For additional information, see the following resources:
Diagram history
To be notified about updates to this reference architecture diagram, subscribe to the RSS feed.
| Change | Description | Date |
|---|---|---|
Initial publication | Reference architecture diagram first published. | January 1, 2021 |
Note
To subscribe to RSS updates, you must have an RSS plugin enabled for the browser you are using.