Test inapp purchase with expired card in sandbox

I'm trying to investigate an inapp purchase issue which has recently started occurring within one of my apps which is affecting around 2% of users.

It seems that a payment cancelled state is being immediately followed by a payment successful state.

This means the customer is being charged for the inapp purchase but the non-consumable IAP is not returned in the list of owned IAPs returned by the StoreKit framework.


I'm trying to recreate this scenario and I thought I could do so my registering a test card in the sandbox environment with an expiry date in the past. However the list of test cards for use with Apple Pay does not include an expired card and attempting to change the expiry date of one of those listed cards results in an "Invalid card" response when trying to add it.


Has anyone any ideas how to test this scenario?

Replies

This happens when the user is required to update their credit crad expiration date infomration. updatedTransactions is called twice, once with a failed state and then immediately after with a purchased state (assuming the user updates their credit card information and completes the purchase).


I don't know how to 'test' it; but your code should always be prepared to receive a valid call to updatedTtransactions within a few seconds of getting a failed transaction.