-
Notifications
You must be signed in to change notification settings - Fork 260
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
feat: add Klarna to confirmPayment
payment methods
#821
Conversation
requesting reviews from android/ios run cc @csabol-stripe @skyler-stripe whenever you get a chance to take a peak 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'm not good at react but the logic for the requirements makes sense.
@@ -344,6 +359,8 @@ extension PaymentMethodError: LocalizedError { | |||
return NSLocalizedString("You must provide CVC number", comment: "Create payment error") | |||
case .weChatPayPaymentMissingParams: | |||
return NSLocalizedString("You must provide appId", comment: "Create payment error") | |||
case .klarnaPaymentMissingParams: | |||
return NSLocalizedString("Klarna requires that you provide the following billing details: email, country", comment: "Create payment error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we're just copying the pattern here, but this raises some qs for me:
- Why are these localized strings
- Why hardcode the client to throw these errors instead of letting the backend serve the error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
country: 'US', | ||
}, | ||
}, | ||
// Edit the following to support different payment methods in your PaymentSheet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, looks like this is user-facing. I wonder why we aren't using the example server(s) the iOS and Android platforms use (you can see them here: https://glitch.com/@stripe-mobile-payments)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question! I'm honestly not sure why this approach was opted for instead...on CI, we rely on our glitch server rather than the local one here. May have just been added before glitch was considered and is still around. Suppose we could probably get rid of this server altogether from the repo
Created tickets for both of those points, merging this now though |
Summary
Add the bindings for users to pay with Klarna programmatically
Motivation
Klarna was supported on paymentsheet, but there were no bindings so folks couldn't use it programatically
Testing
Documentation
Looks like there used to be a Klarna docs page, but it was removed? I'm not sure why. Typescript will auto-doc that
confirmPayment
now accepts Klarna