stripe / stripe-react-native

React Native library for Stripe.
https://stripe.dev/stripe-react-native
MIT License
1.27k stars 263 forks source link

CardForm (hide country/postal code + choose error label position) #1047

Open nicolasdevienne opened 2 years ago

nicolasdevienne commented 2 years ago

On the CardForm, I would like :

Is it possible to add these options ?

Simulator Screen Shot - iPhone 13 mini - 2022-07-18 at 12 21 10

charliecruzan-stripe commented 2 years ago

Unfortunately this isn't possible- I would recommend utilizing either the CardField component or PaymentSheet.

Providing the default country (which includes providing a country where the postal code isn't shown if that country doesn't have postal codes) will be added in https://github.com/stripe/stripe-react-native/pull/1044

that being said- the error message seems to be placed fairly far away from the component in your screenshot 🤔 what version are you using and what does your code look like? I can't repro that

nicolasdevienne commented 2 years ago

Hi @charliecruzan-stripe, I think it's due to the height of the CardForm (I use last version 0.15.0) :

          <CardForm
            cardStyle={{
              backgroundColor: COLORS.COLOR1,
              borderRadius: DIMENSIONS.SIZE010,
              cursorColor: COLORS.GRAY_DARK,
              placeholderColor: COLORS.GRAY_DARK,
              textErrorColor: COLORS.RED_DARK,
            }}
            style={{
              height: DEVICE_WIDTH,
              marginHorizontal: 20,
            }}
            onFormComplete={card => setCard(card.complete && card)}

But as you can see, on Android it's OK :

Screenshot_1658337751

nicolasdevienne commented 2 years ago

Hi @charliecruzan-stripe ! No PR for this ? :)

AristideVB commented 3 months ago

Any updates ? 🙏 would love to hide country field