#joey-shen_code
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1369211371303993384
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- joey-shen_code, 20 hours ago, 12 messages
Hi! Looking into your query!
Can I check on my colleague's last question, are you following some documetation to use the validationState API?
Yes, I am.🙆♂️
I'm referring to this documentation:
https://stripe.dev/stripe-ios/stripepayments/documentation/stripepayments/stpcardvalidator/validationstate(fornumber:validatingcardbrand:)
Also, we've been able to use the validationState API without any issues in the past, and it works fine in the production version as well.
It's only when we tried testing with a UnionPay 19-digit card this time that we noticed the validation fails.
Hi @shell bolt I'm Jack and I'm also an engineer from Stripe.
As for the cause, based on my review of the source code so far, it looks like the UnionPay 19-digit card number isn’t matched in the STPBINRangeInitialRanges object.
But I'm not sure if I might have missed something,
so I wanted to check with you.
Thanks!
https://github.com/stripe/stripe-ios/blob/master/CHANGELOG.md#2362-2023-04-20 23.6.2 fixed union pay card validation issue. Are you using a Stripe iOS SDK version greater than 23.6.2?
I'm currently using version 23.21.1,
which is greater than 23.6.2.
https://github.com/stripe/stripe-ios/blob/cfbe22df229df9b1852051029ee2b95d0fe1dff2/Stripe/StripeiOSTests/STPCardValidatorTest.swift#L226 looking at this code, the card validator supports 19-digit union pay card
I just tested payment sheet with the 19-digit unionpay card number, and it's working fine.
Can you tell me why you want to call this function directly? The Stripe mobile SDK will perform card validation internally so you don't need to explicitly call this card validation function.
I need to validate the card number manually due to some UI presentation requirements,
which is why I’m calling STPCardValidator.validationState directly.
Are you collecting the card number in your own UI? or using the UI form provided by Stripe iOS SDK?
The card number input UI is custom-built in our app,
so we're not using the UI elements provided by the Stripe iOS SDK.
That’s why we’re calling STPCardValidator.validationState to validate the card.
🥺
Hi there, I am looking at the docs, to see if this method is still supported...
Basically, you're seeing that it doesn't support 19-digit cards?
It's not that 19-digit cards aren't supported —
the issue is with how the card number is being identified.
From what I saw in the source code,
STPBINRangeInitialRanges defines the 19-digit UnionPay card range as:
("621598", "621598", 19, .unionPay)
But the test card number provided in the Stripe documentation is:
6205500000000000004
Since 621598 and 620550 don’t match,
the system ends up treating it as a 16-digit UnionPay card instead.
Okay, got it.
I will turn this thread into a support case so we can report this to a responsible internal team, and follow-up with you on the progress:
Hello @shell bolt, we have sent you a direct message, please check it at https://discord.com/channels/@me/1369230790981976086
- 🔗The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.