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

fix: incorrect payment sheet shown #814

Merged

Conversation

lbinscheck
Copy link
Contributor

Summary

On iOS, the "custom-flow"-PaymentSheet is presented also for "non-custom-flow"-PaymentSheets after it has been opened once during the session. In order to fix this bug, I added self.paymentSheetFlowController = nil in initPaymentSheet when customFlow == false in order to open the correct PaymentSheet in presentPaymentSheet later on.

Motivation

Fixes #608

Testing

  • I tested this manually
  • I added automated tests

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

@@ -156,6 +156,7 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
}
} else {
self.paymentSheet = PaymentSheet(paymentIntentClientSecret: paymentIntentClientSecret, configuration: configuration)
self.paymentSheetFlowController = nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this PR!

I'm thinking it might be cleaner to call self.paymentSheetFlowController = nil just once at the top of the initPaymentSheet function, what do you think?

Copy link
Contributor Author

@lbinscheck lbinscheck Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's much better. Thanks!

@charliecruzan-stripe charliecruzan-stripe merged commit 1f3cc1b into stripe:master Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect payment sheet shown
2 participants