Users charged even though we get an error back

Hi,


Our app users are complaining they are being charged, even though we're getting back SKErrorPaymentCancelled reponse, so we assume the transaction failed and not giving them premium features.


Any reason why would that happen ? calling later restoreCompletedTransactions will almost always fix it.

Replies

You asked....

"How are we supposed to handle the following:

- display a proper error message if there was an actual error

- not display an error message if the transaction fails and is then followed by a "StatePurchased" notification"


Here is a direct answer to that question:


Either:

1) use a "performSelector:withObject:afterDelay:2.0F" to display the error message and cancel that with a "cancelPreviousPerformRequestsWithTarget:" if you get another transaction


Or:

display the error message with a global scope to retain the UIAlertController reference so that you can dismiss the UIAlertController if another transaction comes in.

Thanks for the details, Rich! So if I understand correctly, we should remove any error display for the purchases, and we should act on users telling us "I tap on 'Buy in-app purchase' but nothing is happening!".


I think that ideally either:

- We should have a way to distinguish real errors from "cancellations" or "redirect outside of the app"

- StoreKit should take care of displaying all error messages (such as "Unable to connect to App Store").


What do you think?

> So if I understand correctly, we should remove any error display for the purchases,


IMHO - You should display the error to the user to guide their next action. Only if the error code is SKErrorPaymentCancelled is the user aware of the reason why the purchase was cancelled. The issue of the 'bug' in StoreKit where they send a failed transaction followed immediately by the purchase is easily handled as described in the February 27th post.


> we should act on users telling us "I tap on 'Buy in-app purchase' but nothing is happening!".


This should not happen.