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

feat: add defaultValues to CardForm and CardField #1044

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

charliecruzan-stripe
Copy link
Collaborator

@charliecruzan-stripe charliecruzan-stripe commented Jul 15, 2022

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 #916
closes #637 (same request here)
closes #577 (can provide default values to address this issue)

Testing

  • I tested this manually
  • I added automated tests

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

@jonasbark
Copy link
Collaborator

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

@charliecruzan-stripe
Copy link
Collaborator Author

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 charliecruzan-stripe force-pushed the charliecruzan-add-default-values-components branch from 56ca983 to cbb0e36 Compare August 16, 2022 18:54
@CaM2091
Copy link

CaM2091 commented Oct 11, 2022

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

@jvallar
Copy link

jvallar commented Nov 30, 2022

@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

@kasterlod
Copy link

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

@joumanam
Copy link

when will this be merged?

@charliecruzan-stripe
Copy link
Collaborator Author

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

@charliecruzan-stripe charliecruzan-stripe added the blocked Don't start work on this until label is removed label Jan 30, 2023
@kasterlod
Copy link

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!

@araujobarret
Copy link

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

@p-janik
Copy link

p-janik commented Sep 22, 2023

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

@brainbicycle
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Don't start work on this until label is removed
Projects
None yet
9 participants