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

Remove PostalCodeElement

Open atty-stripe opened this issue 7 years ago • 10 comments

Summary

In the next major version, we should remove support for the PostalCodeElement as it is no longer the recommended way to collect postal code. Users are suggested to build their own postal code input.

atty-stripe avatar Feb 20 '19 22:02 atty-stripe

Is there a way I can hide by passing a prop to the element ?

isuruAb avatar Mar 12 '19 02:03 isuruAb

@isuruAb, why not just not render the Element? Can you share a bit more about what you're trying to do?

(If you're looking to hide the postal code field in the combined card Element, you can pass in hidePostalCode=true).

atty-stripe avatar Mar 12 '19 07:03 atty-stripe

@atty-stripe What is the correct way to determine if we need to collect post code information?

streamich avatar Mar 26 '19 13:03 streamich

@streamich right now we recommend always collecting it as it helps detect fraud better. That said, we see banks in the US, UK, and Canada frequently implementing postal code checks, so you should at least collect it when the card's billing address is in those countries.

atty-stripe avatar Mar 26 '19 18:03 atty-stripe

@atty-stripe sorry, to bother you again. The card Stripe element hides/shows the postal code input dynamically depending on the card number. What is that logic? Is it based on country?

streamich avatar Mar 27 '19 18:03 streamich

How to add postal code to tokenization process if this component is going to be removed?

I mean, there is no way to add extra data to stripe.createToken() without providing element as first argument

ghost avatar Apr 04 '19 16:04 ghost

@streamich the card Element uses the card number's BIN (first 6 digits) to predict which country it belongs to, but this is error-prone as documented in #20. We recommend specifically asking your users for the billing country, and using that to ask for the postal code.

@SergeyShablenko stripe.createToken accepts the postal code as address_zip. When using react-stripe-elements, the Element is automatically inferred for you, so you can just pass it in as stripe.createToken({ address_zip: '12345' }). See the reference for details: https://stripe.com/docs/stripe-js/reference#stripe-create-token.

atty-stripe avatar Apr 11 '19 20:04 atty-stripe

Resolved in https://github.com/stripe/react-stripe-elements/pull/346

dweedon-stripe avatar May 06 '19 17:05 dweedon-stripe

Has the PostalCodeElement been removed? If yes can you tell me in which version can I find one?

radha-bacancy avatar Aug 20 '20 21:08 radha-bacancy

Has the PostalCodeElement been removed? If yes can you tell me in which version can I find one?

I think -- in v2.0.3 https://unpkg.com/browse/[email protected]/src/index.js

isamrish avatar Dec 30 '20 11:12 isamrish