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

Add option to disable country and postal code inputs in CardForm component #577

Open
kevinhuang78 opened this issue Sep 9, 2021 · 8 comments · May be fixed by #1044
Open

Add option to disable country and postal code inputs in CardForm component #577

kevinhuang78 opened this issue Sep 9, 2021 · 8 comments · May be fixed by #1044
Labels
blocked Don't start work on this until label is removed CardForm enhancement New feature or request

Comments

@kevinhuang78
Copy link

Context

I've updated @stripe/stripe-react-native package to v.0.2.0 in order to use CardForm component so that I can use a multi-line form instead of having it on one line.

Issue

I can't remove postal code input and country input.

image

I can see on the source code here that unlike CardField component, I cannot put postalCodeEnabled to false. Plus I can't see where to remove country field.
I saw that on line 79, you're doing ...props but even though I'm putting postalCodeEnabled to false it's not working

Code I'm using

const StripeCardForm = ({ onFormComplete }) => (
  <CardForm
    postalCodeEnabled={false}
    onFormComplete={onFormComplete}
  />
);

Solution I'd liked

Have the possibility to remove postal code input and country input.


Thanks a lot for taking your time answering my issue

@kevinhuang78 kevinhuang78 changed the title [CardForm] Remove postal code and country inputs [CardForm on v.0.2.0] Remove postal code and country inputs Sep 9, 2021
@arekkubaczkowski
Copy link
Collaborator

@kevinhuang78 unfortunately CardForm doesn't support disabling particular fields atm, I will keep this issue open in order to track progress regarding this

@arekkubaczkowski arekkubaczkowski added the enhancement New feature or request label Sep 9, 2021
@YoQuieroDistraerlo
Copy link

At this point in the payment flow, we already asked the customer for their billing address, so asking again for country and zip code is redundant and make us look unprofessional and/or less competent.
For that reason only, this issue should be labeled as a bug.

If fields cannot be disabled at least we should be able to pre fill them. Can we do that? I didn't find any way to do it.

Thank you!

@AlexSirenko
Copy link

AlexSirenko commented Oct 26, 2021

@arekkubaczkowski zip code on android have only United States and United Kingdom. Other countries - the form hides the zip code field. On the other hand, IOS has postal code for many of countries. I assume you have used postal code then how do you handle it?

@alexandrebouttier
Copy link

@kevinhuang78
little question that has nothing to do, how did you manage to put the label of the postal code in French?

@charliecruzan-stripe charliecruzan-stripe added the blocked Don't start work on this until label is removed label Mar 4, 2022
@charliecruzan-stripe charliecruzan-stripe changed the title [CardForm on v.0.2.0] Remove postal code and country inputs Add option to disable country and postal code inputs in CardForm component Mar 16, 2022
@charliecruzan-stripe charliecruzan-stripe linked a pull request Jul 18, 2022 that will close this issue
4 tasks
@Jamal-ReachFirst
Copy link

Context

I've updated @stripe/stripe-react-native package to v.0.2.0 in order to use CardForm component so that I can use a multi-line form instead of having it on one line.

Issue

I can't remove postal code input and country input.

image

I can see on the source code here that unlike CardField component, I cannot put postalCodeEnabled to false. Plus I can't see where to remove country field. I saw that on line 79, you're doing ...props but even though I'm putting postalCodeEnabled to false it's not working

Code I'm using

const StripeCardForm = ({ onFormComplete }) => (
  <CardForm
    postalCodeEnabled={false}
    onFormComplete={onFormComplete}
  />
);

Solution I'd liked

Have the possibility to remove postal code input and country input.

Thanks a lot for taking your time answering my issue

+1

@LaGregance
Copy link

Hi, same for me, I don't need to ask user for country and zip, any solution ?
Another solution is to use CardField but as far I know we cannot use it with multiline (one line for card number, and next line for Code & expiration)

@dgreasi
Copy link

dgreasi commented Aug 6, 2024

Hi, same for me, I don't need to ask user for country and zip, any solution ? Another solution is to use CardField but as far I know we cannot use it with multiline (one line for card number, and next line for Code & expiration)

Same here

@Jamal-ReachFirst
Copy link

It will resolve this issue as well.

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 CardForm enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants