#benkass

1 messages · Page 1 of 1 (latest)

dire dewBOT
mental quest
#

You will be creating a PaymentIntent with one API call and an Ephemeral Key with another API call

drifting spoke
#

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

mental quest
#

So the setup intent secret will go in to the setupIntentClientSecret param rather than the paymentIntentClientSecret

drifting spoke
#

interesting 🙂

dire dewBOT
drifting spoke
#

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

sterile quarry
#

Hey there, are you just passing in the secret string from the ephemeral key?

drifting spoke
#

one moment pls

sterile quarry
#

(not the setup intent cient_secret)

drifting spoke
#

ok got it. thnx