Solved

Pending payment - Handle slow test card (Google Play)

  • 29 March 2023
  • 4 replies
  • 565 views

Badge +3

Hi everyone!

I am working on a game in Unity and have noticed that when i use the Test Card: “Slow test card, approves after a few minutes”, that i get an error: “PAYMENT_PENDING_ERROR”. This can be because of parental controls etc, but not in this case! When getting this error i have no way of giving the users their IAP product that they just purchased (when the payment goes through eventually). I have been looking at different options, but there is no perfect answer. How are you personally handling this?

 

Related post about the same thing from 2020: https://github.com/RevenueCat/purchases-flutter/issues/60

Another post: 

 

I actually though about implementing something in the like of saving the “customerInfo.NonSubscriptionTransactions” on the local device, when a purchase is succesful and then on startup comparing the local and the list recieved from CustomerInfoRecieved, but this is not bullet proof and might cause a user who has purchased something to get the same reward multiple times. Is there any official way to handle this? I can’t find anything in the docs and have been searching online for multiple days.

icon

Best answer by sharif 1 April 2023, 00:44

View original

4 replies

Userlevel 5
Badge +9

Hello! RevenueCat actually works quite similarly to how Google says you should handle pending purchases: https://developer.android.com/google/play/billing/integrate#pending the key here I think is to just assume pending purchases haven’t gone through until you get some confirmation that you did. In RevenueCat that can mean either getting an update to your listener or by calling getCustomerInfo periodically. The recommendation is the same - check the PurchaseState of the purchase when using either case if it’s still pending: https://sdk.revenuecat.com/android/5.6.6/public/com.revenuecat.purchases.models/-store-transaction/purchase-state.html?query=val%20purchaseState:%20PurchaseState. Could you possibly save the transaction ID of the purchase so that you can check if it moved from pending to purchased later on?

Badge +3

Hi Sharif. I have done just that. Of course it isn’t a perfect solution, but it works alright for now

Badge

Hi Sharif. I have done just that. Of course it isn’t a perfect solution, but it works alright for now

Hi MadSPS, I am also trying to do the same but I have no idea how. Should I use the listener or get getCustomerInfo perodically? If you share your solution that would be very helpful. Thank you.

Badge +1

Hi Sharif. I have done just that. Of course it isn’t a perfect solution, but it works alright for now

Hi MadSPS, I am also trying to do the same but I have no idea how. Should I use the listener or get getCustomerInfo perodically? If you share your solution that would be very helpful. Thank you.

Me too, If MadSPS shares his solution that would be very helpful. Thank you.

Reply