stripe-react-native
stripe-react-native copied to clipboard
feat: add defaultValues to CardForm and CardField
Summary
- Added
defaultValues
prop toCardField
. You can now programmatically set the card number, CVC, expiry date, and postal code. - Expanded
CardForm
'sdefaultValues
prop. You can now programmatically set the card number, CVC, expiry date, and postal code.
Motivation
closes https://github.com/stripe/stripe-react-native/issues/916 closes https://github.com/stripe/stripe-react-native/issues/637 (same request here) closes https://github.com/stripe/stripe-react-native/issues/577 (can provide default values to address this issue)
Testing
- [x] I tested this manually
- [ ] I added automated tests
Documentation
Select one:
- [x] I have added relevant documentation for my changes.
- [ ] This PR does not result in any developer-facing changes.
Couldn't this cause PCI compliance issues, as sensitive data is sent through the React Native wrapper?
With Flutter we developed a similar functionality, but we hid it behind a dangerouslyUpdateFullCardDetails
flag:
https://github.com/flutter-stripe/flutter_stripe/blob/main/packages/stripe/lib/src/widgets/card_field.dart#L90
The main drivers behind this ask are for devs to provide default test values (i.e. 4242424242424242) or to provide billing data like zip code. I will need to double check what those use cases mean for things like SAQ A eligibility
Maybe can you just allow providing zip code and country (And hide them btw) ? In this way, it would be PCI compliant ?
@charliecruzan-stripe I am using a credit card scanner and want to set the values of CardField. Is it still PCI Compliant? Scan Card is only on Payment Sheet and is not visible on CardField. So I am using a different scanner but I don't have a way to add the scanned values to CardField or CardForm
@charliecruzan-stripe would be really awesome to have these changes, if you need any help to proceed please share what can be done to speed it up 🙏
when will this be merged?
we're waiting on changes in stripe-ios
before this can be merged
hello @charliecruzan-stripe , thanks for the response. Do you have any ETA when it could be done? is it already in progress or it's possible to contribute to speed it up? greetings and thank you for your support!
Any updates? it's been more than a year waiting for this feature...
It would be great to have possibility to inject scanned values into CardField / CardForm or have scanning integrated into these components
we're waiting on changes in
stripe-ios
before this can be merged
👋 hello again, any specific changes to the iOS sdk that need to be made? would love to track how this is going.