diff --git a/README.md b/README.md index dbded8d..801c94d 100644 --- a/README.md +++ b/README.md @@ -464,15 +464,24 @@ instance.Connect(); ## iOS IAP Validation -iOS receipt validation requires `transactionId` and `receipt` (`signature` will be set to `null`). For `receipt`, be sure to send the receipt `Payload`(the base64 encoded ASN.1 receipt) from Unity. +iOS receipt validation requires `transactionId` and `receipt`. For `receipt`, be sure to send the receipt `Payload` (the base64 encoded ASN.1 receipt) from Unity. -**IMPORTANT:** If you have subscription IAP, you will need to add your app's shared secret in the Tenjin dashboard. You can retrieve your iOS App-Specific Shared Secret from the iTunes Connect Console \> Select your app \> Features \> In-App Purchases \> App-Specific Shared Secret. +**IMPORTANT:** If you have subscription IAP, you will need to add your app's shared secret in the Tenjin dashboard. You can retrieve your iOS App-Specific Shared Secret from the App Store Connect \> Select your app \> General \> App Information \> App-Specific Shared Secret. ## Android IAP Validation -Android receipt validation requires `receipt` and `signature` are required (`transactionId` is set to `null`). +### Google Play App Store + +Google Play receipt validation requires `receipt` and `signature` parameters. + +**IMPORTANT:** You will need to add your app's public key in the Tenjin dashboard. You can retrieve your Base64-encoded RSA public key from the Google Play Developer Console \> Select your app \> Monetization setup. + +### Amazon AppStore + +Amazon AppStore receipt validation requires `receiptId` and `userId` parameters. + +**IMPORTANT:** You will need to add your Amazon app's Shared Key in the Tenjin dashboard. The shared secret can be found on the Shared Key in your developer account with the Amazon Appstore account -**IMPORTANT:** You will need to add your app's public key in the Tenjin dashboard. You can retrieve your Base64-encoded RSA public key from the Google Play Developer Console \> Select your app \> Monetization setup. Please note that for Android, we currently only support IAP transactions from Google Play. ### iOS and Android IAP Example: @@ -489,16 +498,27 @@ In the example below, we are using the widely used ; - var gpJson = (string)gpDetails["json"]; - var gpSig = (string)gpDetails["signature"]; + if (store.Equals("GooglePlay")) { + var googleDetails = Json.Deserialize(payload) as Dictionary; + var googleJson = (string)googleDetails["json"]; + var googleSig = (string)googleDetails["signature"]; + + CompletedAndroidPurchase(productId, currencyCode, 1, lPrice, googleJson, googleSig); + } + + if (store.Equals("AmazonApps")) { + var amazonDetails = Json.Deserialize(payload) as Dictionary; + var amazonReceiptId = (string)amazonDetails["receiptId"]; + var amazonUserId = (string)amazonDetails["userId"]; - CompletedAndroidPurchase(productId, currencyCode, 1, lPrice, gpJson, gpSig); + CompletedAmazonPurchase(productId, currencyCode, 1, lPrice, amazonReceiptId, amazonUserId); + } #elif UNITY_IOS @@ -512,14 +532,20 @@ In the example below, we are using the widely used