stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

feat: add defaultValues to CardForm and CardField

Open charliecruzan-stripe opened this issue 2 years ago • 11 comments

Summary

  • Added defaultValues prop to CardField. You can now programmatically set the card number, CVC, expiry date, and postal code.
  • Expanded CardForm's defaultValues 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.

charliecruzan-stripe avatar Jul 15 '22 21:07 charliecruzan-stripe

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

jonasbark avatar Jul 20 '22 13:07 jonasbark

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

charliecruzan-stripe avatar Jul 20 '22 16:07 charliecruzan-stripe

Maybe can you just allow providing zip code and country (And hide them btw) ? In this way, it would be PCI compliant ?

CaM2091 avatar Oct 11 '22 12:10 CaM2091

@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

jvallar avatar Nov 30 '22 01:11 jvallar

@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 🙏

kasterlod avatar Jan 03 '23 12:01 kasterlod

when will this be merged?

joumanam avatar Jan 30 '23 14:01 joumanam

we're waiting on changes in stripe-ios before this can be merged

charliecruzan-stripe avatar Jan 30 '23 16:01 charliecruzan-stripe

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!

kasterlod avatar Jan 31 '23 13:01 kasterlod

Any updates? it's been more than a year waiting for this feature...

araujobarret avatar Aug 30 '23 08:08 araujobarret

It would be great to have possibility to inject scanned values into CardField / CardForm or have scanning integrated into these components

p-janik avatar Sep 22 '23 11:09 p-janik

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.

brainbicycle avatar Apr 23 '24 17:04 brainbicycle