question

Rodrigo Cesar Miyabara avatar image
Rodrigo Cesar Miyabara asked

Invalid Receipt Response to Validate Google Play Purchase with Unreal Blueprints

On Unreal Engine 4, when making an IAP on Android with the Make an In-App Purchase v2 node, the receipt response consists only of Item Name, Item Id and Validation Info, where the validation info is returned as a string as follows:

  • { "receiptData": "xxxxxxx", "signature": "xxxxxxxx" }

The PlayFab node Validate Google Play Purchase requires the Receipt Json and Signature. I've been getting the error InvalidReceipt (code 1021) no matter how I pass the Validation Info to the Receipt Json node.

I've tried passing it directly (with the signature), passing only the contents of "receiptData" and passing "receiptData" as a Json.

apisunrealandroid
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sarah Zhang avatar image Sarah Zhang commented ·

Did you pass ReceiptJson in this format?

{\"orderId\":\"xxxx\",\"packageName\":\"xxxxxx\",\"productId\":\"xxxxxx\",\"purchaseTime\":xxxxxx,\"purchaseState\":0,\"purchaseToken\":\"xxxxxxxx\"}"
1 Like 1 ·
Rodrigo Cesar Miyabara avatar image Rodrigo Cesar Miyabara Sarah Zhang commented ·

Unfortunately, the only think I get from this UE4 node is:

  • { "receiptData": "xxxxxxx", "signature": "xxxxxxxx" }
0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Rodrigo Cesar Miyabara commented ·

Is the content of receiptData like this?

{\"orderId\":\"xxxx\",\"packageName\":\"xxxxxx\",\"productId\":\"xxxxxx\",\"purchaseTime\":xxxxxx,\"purchaseState\":0,\"purchaseToken\":\"xxxxxxxx\"}"
1 Like 1 ·

1 Answer

·
Rodrigo Cesar Miyabara avatar image
Rodrigo Cesar Miyabara answered

As it turns out, it does, but encoded in base64. That was the entire problem, as PlayFab expects it decoded. Decoding the receiptData allows me to properly validate the IAP.

Thanks for the help!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.