Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

How to fetch ZIP / Postal Code from PaymentCardTextField? #761

Closed
plowman opened this issue Apr 29, 2021 · 3 comments
Closed

How to fetch ZIP / Postal Code from PaymentCardTextField? #761

plowman opened this issue Apr 29, 2021 · 3 comments

Comments

@plowman
Copy link

plowman commented Apr 29, 2021

The problem

PaymentCardTextField prompts the user to enter a zip / postal code, which is great. However, the onChange() callback doesn't seem to surface this field. (Or I'm looking in the wrong place).

Environment

  • tipsi-stripe version: 9.0.0
  • iOS or Android: iOS
  • OS version: 11.0+
  • React-Native version: 0.63.3

Code To Reproduce Issue (Good To Have)

class AddCardFormContainer extends Component {
  handleOnChange = (event) => {
    console.info("Looking at event: ", event);
  };

  render() {
    return (
      <PaymentCardTextField
        onChange={this.handleOnChange}
      />
    );
  }
}

Screen Shot 2021-04-29 at 3 49 12 PM

Once all the fields are entered, even the zip code, this outputs something like:

Looking at event: {"params": {"cvc": "999", "expMonth": 11, "expYear": 39, "number": "4242424242424242"}, "target": 2193, "valid": true}

Is there a way to get this postalCode out of AddCardFormContainer? Thanks in advance.

@kierangillen
Copy link

Earlier version of PaymentCardTextField didn't require the zipCode, I'd suggest rolling back. This issue is referenced here: #641 and it was labeled with Won't fix.

Personally, I would love a prop on the component to hide/disable the zipCode field as the UI fitting all these fields into the horizontal input is getting cumbersome and crowded. With the zipCode field hidden at first, it's often completely overlooked and the user is left confused.

@juanolmedogl
Copy link

Same issue here and I agree with you @kierangillen.

It would be great if we could remove the ZIP code field with a prop.
The UX is not good if we don't need that value.

@fbartho
Copy link
Collaborator

fbartho commented Jun 20, 2023

Closing this ticket, so that new users don't think this project is still active.

Stripe does not want you using this, and you will find pain if you do; Please migrate to the official @stripe/stripe-react-native package, for your user's safety, and your developer's sanity!

See more:

@fbartho fbartho closed this as completed Jun 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants