stripe-react-native
stripe-react-native copied to clipboard
`customerEphemeralKeySecret` format does not match expected client secret formatting.
Describe the bug
The error "customerEphemeralKeySecret
format does not match expected client secret formatting." is thrown when trying to do initPaymentSheet(). This only happens on iOS, the same code works perfectly on Android. I'm only working with CC, no ApplePay or GooglePay.
Expected behavior Initialize the payment sheet and proceed to the next step where the payment sheet is displayed through presetPaymentSheet();
Screenshots
This is the error thrown by initPaymentSheet()
Implementation
You can be sure I'm properly getting and sending customerId, customerEphemeralKeySecret and setupIntentClientSecret. I wan to highlight the fact this same code is working on Android, it only fails on iOS.
I'm using the version 0.19.0 of this plugin. This is the version I need for iOS 12.4 which is the target the project has setup on xCode, so I cannot update the version of this library.
Do you guys know why this happens only on iOS? I can't find anything on the internet. I'm lost.
I'll appreciate your help.
@GustavoLucero , have you found a solution? I'm also encountering the same issue on iOS. Initially, it was functioning correctly, but now I'm suddenly receiving this error. It's working fine on Android.
Are you sure, you are not passing the ephemeralKeyId rather than the ephemeralKey itself? I encountered an issue for that.
If you hit this error, it's almost certainly due to the fact that you are passing the wrong value as your EphemeralKey secret. Many developers mistakenly pass the EphemeralKey id which looks like ephkey_123456
instead of passing the EphemeralKey secret that looks like ek_test_abc123
instead.
On Android, we incorrectly don't validate the value the same way which makes it look like it works.