-
Notifications
You must be signed in to change notification settings - Fork 263
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
Parse 'customerSheetClientSecret' for Android and iOS #1744
base: master
Are you sure you want to change the base?
Conversation
5f2131a
to
361df5b
Compare
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.
looking good, one nit about error handling and also could you add the type declaration for the new field to https://github.com/stripe/stripe-react-native/blob/master/src/types/PaymentSheet.ts#L13-L70 ?
if (customerId.isNotEmpty() && customerSessionClientSecret.isNotEmpty()) PaymentSheet.CustomerConfiguration.createWithCustomerSession( | ||
id = customerId, | ||
clientSecret = customerSessionClientSecret | ||
) | ||
else if (customerId.isNotEmpty() && customerEphemeralKeySecret.isNotEmpty()) PaymentSheet.CustomerConfiguration( |
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.
do we want to add error handling if they provide both customerSessionClientSecret
and customerEphemeralKeySecret
?
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.
Updated 👍
…lientSecret are not set
Added the types to PaymentSheet.ts, but it doesn't seem to actually throw an error if both values are set. It's throwing an exception if both are set so it's fine, but is there a way for typescript to actually throw an error? |
No TS won't throw an error (depending on your typescript config, compilation may fail) it'll just complain in the IDE, but that's good enough since we're also throwing an error in the native layer anyways |
Summary
Add logic to parse
customerSessionClientSecret
Motivation
Support Customer Session for React Native
MOBILESDK-2432
MOBILESDK-2431
Testing
Documentation
Select one: