stripe / stripe-react-native

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

Payment Sheet input validation incorrectly marks account numbers as invalid #1770

Open timleyden opened 1 day ago

timleyden commented 1 day ago

Describe the bug After moving from elements hosted on a web page to the react native sdk with payment sheet we got several reports that stripe was not allowing users to enter bank account numbers. After investigation we found that several banks in Australia have 6 digit account numbers. When a customer enters this valid number they cannot proceed and receive a validation error stating the number in incomplete

To Reproduce Steps to reproduce the behavior:

  1. Go to payment sheet with payment method type becs enabled
  2. Click on 'AU BECS Direct Debit'
  3. Scroll down to 'Account Number' and enter only 6 digits
  4. See error

Expected behavior except 6 digit account numbers alternatively automatically padding with 0s but this may lead to confusion

Screenshots image

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

seanzhang-stripe commented 17 hours ago

Hi @timleyden Thanks for flagging this problem.

The account number validation logic is from the underlying Stripe Android SDK. I've already informed the Stripe mobile SDK team about this problem. Once this problem is fixed in the new Android and iOS SDK, you can just remove yarn.lock file and run yarn install again to download the latest mobile SDK.