#uncle.t
1 messages · Page 1 of 1 (latest)
Here is the error from Xcode
failed(error: Error Domain=com.stripe.lib Code=51 "There was an unexpected error -- try again in a few seconds" UserInfo={com.stripe.lib:StripeErrorTypeKey=invalid_request_error, com.stripe.lib:hintKey=Invalid customer ephemeral key secret. You can find more information at https://stripe.com/docs/payments/accept-a-payment?platform=ios#add-server-endpoint, NSLocalizedDescription=There was an unexpected error -- try again in a few seconds, com.stripe.lib:StripeErrorCodeKey=, com.stripe.lib:ErrorMessageKey=Invalid API Key provided: ephkey_1*******************D7rd})
Hi there, can you share with me the PaymentIntent ID>?
we are using SetupIntent id
Then SetupIntent ID.
you meant the client secret? seti_1M920sJYxzz9q9i9ync0FFKn_secret_MsncYt9xyUbVuZJG52dbbUb0s2NpHgN
OK, let me take a look
The error says Invalid customer ephemeral key secret., did you create the ephemeral key for the same customer?
not the same customer between iOS and Android.
but we are getting this error in iOS from multiple customers
Can you also share with me the customer ID and the ephemeral key secret ?
OK, the last thing you should check is the publishable key
the publishable key is the test key
do you meant that the publishable key should be configured before this request?
we are getting some strange behaviour from time to time which sounds related to publishable key
sometime it is needed, and sometime assigning the publishable key creates error
Is yours a react native application?
nah
pure native
I can confirmed that publishable key is assigned to STPAPIClient
before creating the payment sheet
Ok. I believe I know the problem
You passed in a ephemeral key, not ephemeral key secret when initializing the PaymentSheet
The ephemeral key secret is something like ek_test_xxxx, not ephkey_XXX
right, I only see this when creating the customer for configuration
how should I pass just ephemeral key
How did you get this intent,ephemeralKey ?
Then you should return the ephemeral Key secret instead of ephemeral Key from your server
the key is passed as ephemeralKeySecret in Android as well, which is strange
val configuration = PaymentSheet.Configuration(
merchantDisplayName = "LE Merchant",
customer = PaymentSheet.CustomerConfiguration(intent.customerId, intent.ephemeralKey)
)
and looks like working fine for Android ?
I don't think so, both Android and iOS accept ephemeralKey secret.
hmmm
{"status":200,"message":"success","result":{"clientSecret":"seti_1M92dTJYxzz9q9i9FiDv2Agh_secret_MsoFRwNBI3FIuCv0zHlZIpbfxyYfvcw","ephemeralKey":"ephkey_1M92dUJYxzz9q9i9OpkZH8A5","customerID":"cus_MsoFR6feIihmp8"}}
this is the response we have received from server side
as you can see, the payment sheet can be displayed
and it can creates valid payment method
then can be used for payment
This is strange, the Andorid SDK should report raise an error like what iOS SDK does.
@cold vortex is our Android dev who was working on this