Skip to content

Commit

Permalink
PaymentContext left in bad state after cancel (#1284)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
davidme-stripe authored Aug 8, 2019
1 parent 59cb57c commit 2ad08fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Stripe/STPPaymentOptionsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ - (void)internalViewControllerDidCancel {
[self.delegate paymentOptionsViewControllerDidCancel:self];
}

- (void)handleCancelTapped:(__unused id)sender {
[self.delegate paymentOptionsViewControllerDidCancel:self];
}

- (void)addCardViewControllerDidCancel:(__unused STPAddCardViewController *)addCardViewController {
// Add card is only our direct delegate if there are no other payment methods possible
// and we skipped directly to this screen. In this case, a cancel from it is the same as a cancel to us.
Expand Down

0 comments on commit 2ad08fe

Please sign in to comment.