Question

Understanding PAYMENT_PENDING_ERROR

  • 19 October 2022
  • 2 replies
  • 598 views

Badge +3
  • New Member
  • 0 replies

I recently received several iOS errors with error code 20 (PAYMENT_PENDING_ERROR). 

I read the documentation here, but am still unsure what’s causing this error and how to resolve it. The users don’t have parental controls on their devices.

The RevenueCat docs mention “a user might choose to purchase your in-app product at a physical store using cash” - is this an option the user would have turned on somewhere in their device settings?

Or is there a different reason this error could be occurring?

 

 


2 replies

Userlevel 4
Badge +6

Hey Sia! 

 

This response is generated from us receiving this response from Apple or Google, so this error is really on how the purchase is being perceived by the App store! RevenueCat is simply passing the error from the store to you.


With that being said, This means that the purchase is in limbo and isn’t actually cancelled. You could think of this more as its “half-way there”. On the devices, there should be a reason for why the purchase is pending from the App Store and once that reason is fixed, the purchase should go through!

Badge +3

@Michael Fogel Can you share sample code for how to handle slow android test payments. From what I gather, Purchases returns the pending payment error and then sometime later the payment is successful (but there is no hook in Purchases that informs the app code this happened).

Purchases automatically consumes the purchase some time later.

If I show an error, they may try again: charging the account twice (pissed off customer).

If I show success, the payment might not actually ever be successful (revenue loss).

If I run restore (or fetch purchases), I think the user sees a weird reload, but even if it doesn’t, I just have to guess that the last purchase was the delay purchase they just made and not them intentionally buying a second time?

I guess one idea is I get their purchases. Then I trigger the purchase flow. If the transaction is pending, I loop until the purchases changes with the expected item in it?

All of this seems really janky. Any advice or code?

Reply