Storekit flow when missing payment info

My app is using In app purchase and not behaving properly when user's Apple account is missing Payment Information.


So it's going to Payment info page to let user add credit card information, but after adding credit card, it does not come back to app. Is it a correct behaviour? As I know storekit sends Successful result state, but if it doesn't return to my app, how do I handle the state?


- And is there any way I can test this payment update(add credit card) process in sandbox?


- In this case, app receives SKPaymentTransactionStateFailed at first because of missing credit card info, should I finish transaction on this fail state?

Replies

You wrote something inconsistent:


>t doesn't return to my app.....app receives SKPaymentTransactionStateFailed at first because of missing credit card info

I believe that if the user's credit card info is out of date or missing then StoreKit asks the user to update the info and then asks the user to confirm the purchase. If the user confirms the purchase then StoreKit sends two transactions, a failed transaction and a purchase transaction. (If the user does not confirm the purchase then only a failed transaction is sent.) You must finish the failed transaction and then receive the purchased transaction. You must leave the observer operating after getting the first failed transaction. Therefore, if you wish to shut down your IAP class after a failed transaction you should wait about a second to give the system a chance to send that second transaction.

i also get the same problem. After user added the credit card, it does not come back to app so i can not handle the status of transaction

I also get the same problem. User click "Continue" on "Payment Information Required" pop up. User will be navigate to device's "Setting" app to add credit card. After user added credit card, the that transaction will be charge and success pop up showed but updatedTransactions:(NSArray<SKPaymentTransaction *> *)transactions not called.

Please confirm that your code can correctly receive a failed transaction without shutting down the transactionObserver as described above.

This is my use case (credit card not add yet):
1. Touch buy button -> 2. Payment Information Required Pop up showed -> 3. Touch Continue -> 4. Navigate to device's Setting App -> 5. Input credit card -> 6. Confirm purchase popup showed on Setting App -> 7. Touch Confirm -> 8. Purchase Success Popup showed on Setting App.

Notes:

From step 5 -> step 8, everything take place on device's Setting App. My app could not receive any data from transactionObserver.😕

Nothing takes place in the Settings App. If you are making an IAP then your app has a framework called "StoreKit" and that framework is responding to calls from Apple's servers and displaying alerts in your app.


Check that your app has executed an "addTransactionObserver". Check that you have an updatedTransaction method. Check that when your updatedTransaction method gets called with a 'failed' transaction you do not deallocate that updatedTransaction method nor execute a removeTransactionObserver.

https://drive.google.com/file/d/15vbmTuMb6YoxDZmE46Zmppo-Lx8Y9J-9/view?usp=sharing
This's my screenshort. I make sure the addTransactionObserver in didFinishLaunchingWithOptions and the failed transaction also be remove. I see that Storekit responsed a fail transaction in Step 2 (Payment Information Required Pop up showed) and then touch Confirm in Step 6 (Confirm purchase popup showed on Setting App) then my updatedTransactions function not called.


- func updatedTransactions :

case SKPaymentTransactionStateFailed:{

///My logic code

....

[[SKPaymentQueue defaultQueue] finishTransaction:transaction];

}