#benkass
1 messages · Page 1 of 1 (latest)
This guide shows how to create those https://stripe.com/docs/js/payment_request/update#payment_request_update-options-total
You will be creating a PaymentIntent with one API call and an Ephemeral Key with another API call
No. I'm creating a setup intent. Not payment intent. I plan to use it to generate a payment method and clone it on a connected account where I will use the PM clone to generate a payment intent
(see my previous threads with @gloomy pawn )
So far, I was able to create a setup intent. But to show the react native payment sheet, I need to provide those and I don't have themn
Similar concept, you will create the SetupIntent, use its client secret, and also create an ephemeral key https://stripe.com/docs/payments/save-and-reuse?platform=react-native&ui=payment-sheet#add-server-endpoint
So the setup intent secret will go in to the setupIntentClientSecret param rather than the paymentIntentClientSecret
interesting 🙂
I have:
const setupIntent = await stripe.setupIntents.create({ customer, description })
const ephemeralKey = await stripe.ephemeralKeys.create(
{customer},
{apiVersion}
);
It returns:
{
id: 'seti_1Nst3UCg0bBEGiBddaYzSDH2',
object: 'setup_intent',
...
client_secret: 'seti_1Nst3UCg0bBEGiBddaYzSDH2_secret_OgFYm30LHqkJM8gEnDOfQmuKaq8Yoal',
...
} {
id: 'ephkey_1Nst3UCg0bBEGiBdE0uLS3ky',
object: 'ephemeral_key',
associated_objects: [ { id: 'cus_Ofti1Ac6MSleVP', type: 'customer' } ],
...,
secret: 'ek_test_YWNjdF8xSFZOblJDZzBiQkVHaUJkLHphUmd3ZWhSQWhGRzVJMEFzSXRZaG5FWTZ6S0IyME4_00LzHFxyKn'
}
I then do
initPaymentSheet({
customerId,
customerEphemeralKeySecret,
setupIntentClientSecret,
customFlow: false,
merchantDisplayName: 'Me',
});
It returns an error "customerEphemeralKeySecret format does not match expected client secret formatting."
Oh one second
Maybe I pass the wrong secret
Hey there, are you just passing in the secret string from the ephemeral key?
one moment pls
(not the setup intent cient_secret)
ok got it. thnx