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

STPPaymentIntentLastPaymentError & STPSetupIntentLastSetupError #1291

Merged
merged 6 commits into from
Aug 20, 2019

Conversation

yuki-stripe
Copy link
Collaborator

@yuki-stripe yuki-stripe commented Aug 9, 2019

Summary

Adds last_payment_error and last_setup_error API bindings.

  • Adds STPPaymentHandlerPaymentErrorCode. After the authentication flow, if the Intent is in the .requiresPaymentMethod state, we check last_*_error to decide whether to report an .paymentError or .authenticationError. Previously, we assumed it's an authentication error.

Motivation

https://jira.corp.stripe.com/browse/MOBILE3DS2-457
#1295
Fix assuming post-authentication flow errors means an authentication error. e.g. it could be that the card has insufficient funds.

Testing

  • 4000000000003063 (PaymentIntent), 4000002760003184 (SetupIntent) - Fail 3DS, see authentication failed message.
  • 4000008260003178 (PaymentIntent) - Succeed 3DS, then get an error saying "Insufficient funds".
  • Not sure how to test a post-authentication SetupIntent card type error, I don't think they trigger unless a charge is made.

Stripe/Payments/STPPaymentHandler.m Outdated Show resolved Hide resolved
Stripe/Payments/STPPaymentHandler.m Outdated Show resolved Hide resolved
Stripe.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
@yuki-stripe yuki-stripe merged commit fd828b6 into master Aug 20, 2019
@yuki-stripe yuki-stripe deleted the yuki-last-intent-error branch August 20, 2019 17:38
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.

3 participants