Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PaymentContext left in bad state after cancel #1284

Merged
merged 1 commit into from
Aug 8, 2019
Merged

Conversation

davidme-stripe
Copy link
Contributor

@davidme-stripe davidme-stripe commented Aug 7, 2019

Summary

PaymentOptionsViewController doesn't send a cancellation message if it's in the middle of loading, which can get STPPaymentContext into a bad state. We'll fix this by overriding handleCancelTapped as we do in other controllers.

Motivation

Once broken, STPPaymentContext will refuse to pushPaymentOptionsViewController or pushShippingViewController. You can repro this in the Standard Integration example app by tapping "Pay from", "Cancel", then tapping "Pay from" again: It won't push any view controllers for the lifetime of the STPPaymentContext.

Testing

I repro'd and tapped the cells, it worked before and after load.

PaymentOptionsViewController generally sends a cancellation message when it cancels, which allows STPPaymentContext to clean up its state. But this message is sent by the internal view controller, which isn't set up until after loading has completed. Cancelling a PaymentsOptionsViewController during load will pop the view controller without informing STPPaymentContext.

In this broken state, STPPaymentContext will refuse to pushPaymentOptionsViewController or pushShippingViewController. You can repro this in the Standard Integration example app by tapping "Pay From", "Cancel", then tapping "Pay from" again.
@davidme-stripe davidme-stripe merged commit 2ad08fe into master Aug 8, 2019
@davidme-stripe davidme-stripe deleted the davidme/pmctx branch August 13, 2019 23:28
yuki-stripe pushed a commit that referenced this pull request Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants