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

SDK crashes after 3DS verification (synchronous payment flow) #1725

Closed
meismyles opened this issue Nov 30, 2020 · 3 comments
Closed

SDK crashes after 3DS verification (synchronous payment flow) #1725

meismyles opened this issue Nov 30, 2020 · 3 comments
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@meismyles
Copy link

Summary

Using synchronous payment flow, when completing a purchase that requires 3DS, after entering 3DS verification code (correctly) and pressing submit the SDK crashes saying: "Calling completion with invalid state".

A smaller separate issue is that it also appears that due to the assertion statement within the failure code block, the app can never fail gracefully (for example, showing an error) and instead will just crash.

Code to reproduce

Try making a purchase using a 3DS test card and calling handleNextAction, performing 3DS verification and then the app should crash.

After discussing in Stripe IRC channel it appears this may be an SDK bug. The payment intent status is requiresConfirmation which we believe is correct, however, the SDK doesn't seem to allow requiresConfirmation as a success status, see:

if error == nil && successIntentState {

In an older version of the SDK (when still in Obj-C) you can see requiresConfirmation was allowed as a success state, see:

if (error == nil && paymentIntent != nil && (paymentIntent.status == STPPaymentIntentStatusSucceeded || paymentIntent.status == STPPaymentIntentStatusRequiresCapture || paymentIntent.status == STPPaymentIntentStatusRequiresConfirmation)) {

It also seems like the assertion statement within the else block should be removed so that the SDK can complete with a failed state gracefully rather than the app crash:

assert(false, "Calling completion with invalid state")

iOS version

iOS 14.X

Installation method

Cocoapods

SDK version

21.0.1

Other information

Spoke to @karllekko about this on IRC and we both came to the conclusion that this looks like an SDK issue on there. Hopefully they can flag this internally. Thanks!

@davidme-stripe davidme-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Nov 30, 2020
@davidme-stripe
Copy link
Contributor

Thanks for the detailed report, I'll look into this today.

@meismyles
Copy link
Author

Hey, any update on this??

@davidme-stripe
Copy link
Contributor

Sorry for the delay! This is fixed in version 21.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

No branches or pull requests

2 participants