I'm implementing in app purchase functionality on a Flutter application with NodeJs backend server. I'm facing difficulties on validating the receipt. The purchase from Flutter app is successful on sandbox environment and I'm getting the receipt url returned. Sharing the local and server receipt responses as attachments. (They seems same though).
Please list the steps you took to reproduce the issue:
- Implemented and tested in app purchase on Flutter application.
- Got the receipt response making an in app purchase.
- Sent the receipt to backend for validation.
- Try to Validate receipt data on backend. Sending the request body as follows
{ receipt-data: "receipt" password: "13e55418e6114ed6b22453b6fc314be6" exclude-old-transactions: true }
- Getting response
{"error":{},"status":21002,"message":"The data in the receipt-data property was malformed."}
when the data is sent base64 encoded and as string
- Getting response
{"error":{},"status":498,"message":"Invalid Purchase Token"}
when data is sent base64 encoded.
What did you expect to happen?
I expected to get the receipt validated and receipt details
What actually happened?
- Received response
{"error":{},"status":21002,"message":"The data in the receipt-data property was malformed."}
when the data is sent base64 encoded and as string
- Received response
{"error":{},"status":498,"message":"Invalid Purchase Token"}
when data is sent base64 encoded.
- The app Name. - Clarity Forex
- The app's Apple ID. - com.clarityforex.app
- The list of In-App purchases affected. - Auto -renewable subscription, clarity_4999_1m