tipsi / tipsi-stripe

React Native Stripe binding for iOS/Android platforms
MIT License
1.14k stars 526 forks source link

Some Test Stripe cards are not working on Android with version ^8.0.0-beta.11 #701

Closed sureshgurunath12 closed 3 years ago

sureshgurunath12 commented 3 years ago

We are using the stripe integration on our project, below is the version we are using.

"tipsi-stripe": "^8.0.0-beta.11",

We use for the card input on the form. "https://tipsi.github.io/tipsi-stripe/docs/paymentcardtextfield.html"

When using the PaymentCardTextField we are facing an issue that out of test cards provided from below link. 2223003122003222 and 6200000000000005 cards are not acceptable in android. It throws the validation error. It works fine on iOS. https://stripe.com/docs/testing

Can anyone help in some insights why only these 2 test cards are not working on Android.

imcyee commented 3 years ago

This is because tipsi stripe is using 'com.stripe:stripe-android:10.4.6' in android build.gradle. And the issue was fixed with stripe-android 14.5.0. https://github.com/stripe/stripe-android/issues/2465

imcyee commented 3 years ago

I guess you are using the paymentRequestWithCardForm, tipsi depends on creditCardEntry that has outdated regex.

You can replace that library by folking tipsi-stripe, then replace: CreditCardEntry with my fork, In your tipsi-stripe/android/build.gradle:

dependencies {
 ....
// remove  implementation 'com.github.tipsi:CreditCardEntry:1.5.1'
 implementation 'com.github.imcyee:CreditCardEntry:1.5.2'
}

All 2 series master card should work. But i didnt add unionpay regex (62xx card)

imcyee commented 3 years ago

Or you can use my fork. (Try to fork it, because it is an experimental branch of my experimental branch, and I am planning to make some changes to it and all added code is untested, use it with your own risk)

https://github.com/imcyee/tipsi-stripe/tree/experimental

Changelog:

Note:

imcyee commented 3 years ago

Also found this library that solve this validation issue with latest Stripe SDK: https://github.com/Agaweb/react-native-stripe