Re-purchasing autorenewing subscription

A week ago I have been testing following scenario:

1. Create user on my app

2. Purchase auto-renewable subcription

3. Immediately after that try purchasing the same product again

4. Popup saying that "You are currently subscribed to this" is showing with buttons "Manage" and "OK".


What was happening is that after last part when pressing "OK" the payment queue was returning a new receipt (with state SKPaymentTransactionStatePurchased and new expiration date in receipt). Since we noticed some users tried to fraud us with this behavior on Production purchases we were glad to be able to reproduce this on Sandbox.

However since last monday this is not happening anymore on Sandbox and new receipt does not arrive when re-purchasing (transaction comes from the queue with state SKPaymentTransactionStateFailed as cancelled).


Unfortunately Production purchases are still affected by this issue.


I am wondering what is the expected behavior as I haven't managed to find any info about this in documentation.

What should happen when user tries to re-purchase subscription he already paid for? Should the app receive a refreshed receipt or nothing should happen?

Anybody faced similar issue?


Regards,

Replies

I am also experiencing the same thing. After seeing the You are currently subscribed to this" UIAlertController, the transaction is now marked as failed with

SKErrorCode.PaymentCancelled


Restoring purchases works as expected but I have no way of directing the user to hit Restore if the transaction state is failed with a cancelled payment.


Anybody else out there with this issue?

Tell the user to tap 'restore' if they already have purchased the item using a different device. Do this either before they are given the option to make the original purchase or when they get the error above. For example, if they get a 'caneclled payment' error then display an alert "You did not complete the purchase of a subscription. If you have already purchased a subscription using a different device tap 'restore' below. Otherwise, we hope you will consider purchasing a subscription later."

@PBK, the error above `PaymentCancelled` also happens if a user taps Cancel when asked if they want to purchase to begin with, so there is no way to react to this failure state tell the user to Restore.


Also, I do not think changing my UI to ask users to Restore before making their first purchase is how we would like to design the purchase experience.

Similarly to @filipUT, this behavior is new—after initiating a purchase for an already purchased subscription StoreKit used to return a transaction that had state Purchased and was therfore successful, not a Failed transaction with the SKErrorCode.PaymentCancelled

Either StoreKit should return SKTransactionState.Failed with a new SKErrorCode (see doc) maybe something like SKErrorCode.AlreadyPurchased, so that I can react appropriately. Because you'll notice `PaymentCancelled` says "Indicates that the user cancelled a payment request."


I do not think PaymentCancelled is a correct reflection of the state of this purchse. To reproduce this "bug" or issue, you do not need to cancel a purchase.

The real question is: is this now expected behavior? If so, I will adjust my code/app accordingly as PBK has suggested.

In response to your statements above:


1) this is a "payment cancelled" from the perspective of the app store because the user made a purchase request and then - after a set of circumstances - failed to execute the purchase. Of course the "set of circumstances" differs from the user tapping "cancel purchase" but from the perspective of the 'flow' within the app store it isthe same thing.


2) the uialert statement above works whether the user actually canceled a payment or already purchased the subscription and now needs to restore


3) You wrote "I do not think changing my UI to ask users to Restore before making their first purchase is how we would like to design the purchase experience." Your app, running on a new device, has no way of knowing whether the user made a 'first purchase' on a different device. When asking the user if they wish to make a purchase you must offer the option "But if you already purchased this subscription on a different device tap 'Restore' to copy the subscription to this device."


4) You wrote "StoreKit used to return a transaction that had state Purchased" - that will work and might be a preferred response, but it sounds like it is no longer the flow. Repurchase-for-free is a bit of an issue that dates back to the early days of non-consumables - there were reasons favoring it and reasons against it. In fact it is not a 'purchase'. It is a restore.

Thanks PBK. I think I have enough info to move forward now, and I like your suggestion about presenting a suggestion to restore. I misunderstood that suggestion the first time I read your reply.

i am also experiencing the same thing, the different thing is i can recieve SKPaymentTransactionStatePurchased status everyday after recieving SKErrorPaymentCancelled status,are you the same? if no may i something wrong? thanks.

If the user has already purchased an autorenewable subscription then purchasing it a second time should result in a failed transaction. Read my post above.

I'm experiencing the same thing as filipUTin his first post but on Sandbox.


1. Purchase auto-renewable subcription

2. Immediately after that try purchasing the same product again

3. Popup saying that "You are currently subscribed to this" is showing with buttons "Manage" and "OK"


An then receive in the payment queue a SKPaymentTransaction state Purchased instead of Failed


Anybody else out there with this issue?