#uncle.t

1 messages · Page 1 of 1 (latest)

digital joltBOT
dusky brook
#

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})

Securely accept payments online.

sand bloom
#

Hi there, can you share with me the PaymentIntent ID>?

dusky brook
#

we are using SetupIntent id

sand bloom
#

Then SetupIntent ID.

dusky brook
#

you meant the client secret? seti_1M920sJYxzz9q9i9ync0FFKn_secret_MsncYt9xyUbVuZJG52dbbUb0s2NpHgN

sand bloom
#

OK, let me take a look

#

The error says Invalid customer ephemeral key secret., did you create the ephemeral key for the same customer?

dusky brook
#

not the same customer between iOS and Android.

#

but we are getting this error in iOS from multiple customers

sand bloom
#

Can you also share with me the customer ID and the ephemeral key secret ?

dusky brook
#

cus_JHn13IlLP6Rb3x

#

ephkey_1M920sJYxzz9q9i9X5Ggk7Io

sand bloom
#

OK, the last thing you should check is the publishable key

dusky brook
#

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

sand bloom
#

Is yours a react native application?

dusky brook
#

nah

#

pure native

#

I can confirmed that publishable key is assigned to STPAPIClient

#

before creating the payment sheet

sand bloom
#

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

dusky brook
#

right, I only see this when creating the customer for configuration

#

how should I pass just ephemeral key

sand bloom
#

How did you get this intent,ephemeralKey ?

dusky brook
#

from server side

#

which is shared between iOS and Android

sand bloom
#

Then you should return the ephemeral Key secret instead of ephemeral Key from your server

dusky brook
#

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 ?

sand bloom
#

I don't think so, both Android and iOS accept ephemeralKey secret.

dusky brook
#

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

sand bloom
#

This is strange, the Andorid SDK should report raise an error like what iOS SDK does.

dusky brook
#

@cold vortex is our Android dev who was working on this

sand bloom
#

Anyway, I'd suggest you to follow this integration guide and get your server returns ephemeralKey secret instead.

dusky brook
#

will test it out

#

thanks