question

fdurand avatar image
fdurand asked

Unity IOS & Android confirm purchase error : Failed by payment provider

Hello PlayFab,

I make in app purchase with Prime31 and Playfab with an Unity app in few steps :

- I buy this item in sandbox on android or ios

- In the sucess call back, i launch playfab StartPurchase with the item id

- In the sucess callback of StartPurchase i get the order id

- I call confirmPurchase with the order id.

The system was working fine, but now i have a error on the confirm purchase callback :

Failed by payment provider

I have debug :

the provider name is "Test", probably because its a test purchase (with app published in beta on the android console, there is no problem with the android billing him self, he triggered the PurchaseSucceededEvent.)

Thanks for help !

debugplayfab.png (8.6 KiB)
10 |1200

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

brendan avatar image
brendan answered

For iOS and Android, you'll be using receipt validation. The StartGame flow, by contrast, is for purchases from payment providers like Xsolla, Steam, and PayPal - ones where they provide methods to query for purchase status, rather than just a receipt. For receipt validation, please have a look at this post: https://playfab.com/show-me-money-receipt-validation-ios-and-android/.

10 |1200

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

fdurand avatar image
fdurand answered

Hello Brendan,

Thanks for your answer, i have implement the validation after the billing callback sucess and the server successfully validate my receipt.



But im not sure to understand the payment flow (I use Unity on Android and IOS).

I did all those step :

https://playfab.com/show-me-money-receipt-validation-ios-and-android/.



After the validation i was thinking to use the PlayFabClientApi feature : StartPurchase and ConfirmPurchase but i still get the error :

Failed by payment provider


I notice that after the server get the Validation of the receipt, he add the item to the user inventory.


Maybe the correct way is to make the billing purchase, validate the receipt with playfab and in the sucess callback, get inventory to add the purchased item ?

Thanks for you 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.

brendan avatar image
brendan answered

Correct, the StartPurchase, PayForPurchase, and ConfirmPurchase API calls are not part of the receipt validation flow. The only calls you need to make for receipt validation are the ones in the tutorial you referenced - specifically, the Android and iOS receipt validation API calls.

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.