Does a Pending Purchase ever expire?

Hello,

I’m currently attempting to find some documentation in regards to what happens with a Pending purchase that is never completed.

Do Pending Purchases expire?

If a Pending Purchase does expire:
How long after the initial purchase will Pending Purchase remain in the system?
How is the behaviour different if the purchase is Consumable/Non-Consumable/Subscription?

If a Pending Purchase does not expire:
How would I handle a Purchase that is no longer redeemable?
Is there away to mark a Pending Purchase as unredeemable?

Effectively, I am attempting to make sure the Player is refunded if they are unable to redeem their purchase.

There does not seem to be a way to trigger this behaviour.
I am hoping for clarification in regards to what happens in the above cases.

Thanks for taking to the time to address my post.

@ReeceHowe What do you mean by “redeem their purchase”. Do you mean ask for a refund? As far as I know, pending purchases don’t expire. Why is the pending purchase never completed in your scenario, and why do you have pending purchases in the first place, if I may ask? Are you returning Pending from ProcessPurchase?

Here is the scenario
A limited time event offered a purchasable item with an expiry (or another condition where the purchase was only available in some circumstances)

  1. The user proceeds to purchase the item and completed a successful transaction.
  2. When the user is returned to the application, the process purchase method receives the successful transaction marks the purchase as pending.
  3. Before mark the purchase as complete we do two things:
    3 a) check to make sure the item is still available
    3 b) validate the receipt
  4. if the purchased item is no longer available (3a) and we can not honour the transaction
    4 a) therefore we can not send the complete call for the purchase

So the game is in a state where the user has completed a transaction but the app is no longer able to reward the player with the purchased item.

If we never send the purchase complete call what happens to the pending purchase ?

Will the purchase expire over time ?

If a purchase is made from outside of the app the game will be open and the purchase will be in the pending list. A crash when returning from the native purchase UI can also cause the purchase to be left in pending. I’ve seen low spec android devices close the game in the background while processing a purchase too. In these cases the user might not return to the app for a period of time. Will that purchase expire?

1 Like

At least on Google Play, pending purchases are refunded and expired after 3 days. The product type does not matter.

Not sure about how the Apple App Store handles this though, you might want to test with a sandbox transaction.

P.S. this is the behavior people reported here when handling the pending state incorrectly.

3 Likes

I’m hoping to get an official response from Unity.

Are you able to advise/confirm what will happen on Android and iOS if I were to leave a purchase in pending (uncompleted)?
Would the transaction be refunded?
If the pending transaction is refunded, due to the pending transaction never being completed, what is the expected time frame for refunds on those platforms?

Replication Steps:

  1. Purchase an Item
  2. App sets transaction to pending
  3. Never send a complete call to Unity IAP
  4. Should I expect the transaction to expire here ?
  5. a) If so after how long ?
  6. b) It seems possible it would be 3 days on Android. Can you confirm?
  7. c) Are you aware how long it might be on iOS?

Hello @JeffDUnity3D ,

I’m curious if there is an update in regard to this thread?
Do you need more information from myself?

Is there is any more information I can provide?
Please reach out if there is so I can give more details.

Thanks again

Hi @ReeceHowe ,

Sorry for the slow response. I’ve been looking into it, and yes, Google will refund the user in 3 days. We haven’t found any info about how Apple handles this, but we will try to find out for you.

We don’t have an API for these refunds, unfortunately. Once the time expires, the receipts will stop showing up when purchases are fetched on initialize, restore purchases, etc.

Unfortunately, since Unity can’t see any of this payment processing there’s no way for us to know when the refund happens. This means that we don’t have an easy way to communicate the refund to the player in app.

Hi @ReeceHowe ,

We’re not sure this will be enough info to fix your problem, but here is a similar thread on the Apple Forums to your situation: Is the time-limited non-consumable… | Apple Developer Forums

How are you turning off the item’s availability? Via the your App’s dashboard on Apple, or via some CDN server of your own?

Hello @John_Corbett ,

We have a number of Purchasable Offers which are content specific.

If the content expires before the user has redeemed their purchase (within our application),
we never mark the purchase as complete.

Our assumptions are:

  1. If a pending purchase is never complete, the native purchase attempt will expire ( in the case of google the purchase is refunded)
  2. if a pending purchase expires ( never confirmed complete ), then Unity IAP will no longer report the purchase as pending.

Essentially, we are assuming this functionality can be used to ensure the user is not charged when they have not obtained their purchasable content in the game.
i.e. if the user never gets the purchasable content, we rely on the native stores to refund the users.

We are hoping this alleviates any need for users to contact customer support, and stops them from being charged for items they do not receive. 8451281--1121153--purchase flow arrow.png

Hello @John_Corbett ,

We have no need to inform the user of their refund in the application as we are relying on the native purchasing systems to handle the payments on our behalf.

We are just trying to improve the user experience in cases where a purchased item may no longer be available.

Thanks again for all your help.

This forum post seems to be specific to a completed non-consumable purchase.

We are investigating expiry on pending purchase that is never confirmed complete ( for all of the following: Consumable, Non-Consumable, subscription)

What are you seeing in your testing on iOS? Personally I would not know how long-term pending transaction behave, sorry. It may be hard to test, I suspect TestFlight and and live/production would behave differently.

So you are purposely allowing the user to purchase an item, but not award it to them if it’s not available? And just let Google issue a refund after 3 days? I might be concerned on the user experience. If I purchased an item, I would expect to receive it. Sorry, I may be missing something.

This is designed a failsafe in case the game in not in a state where it is able to provide the user with the requested item.

It allows us to only confirm the purchase if the purchasable item is available.
If the purchasable item is not available to be redeemed (after the native purchase is complete), the purchase request is cached until the game enters a state where the purchasable item can be redeemed.

Some examples of when this could happen include (always after native purchase complete but before purchasable item is redeemed):

  • a crash during the purchase process
  • a purchasable item becomes unavailable during the purchase process
  • an external purchase is made in the store (iOS appstore, or GooglePlay store) while the application is not open

Overall we are attempting to improve the user experience so they are not being charged for an item the have not (or possibly will not ever) receive.

This would mean the user will have their purchase refunded should that purchase no longer be available. It would remove the need for them to actively pursue a refund.

Hey @ReeceHowe
Did you find any solution to this?