#blackgriffen237-ephemeral-key-for-SI

1 messages · Page 1 of 1 (latest)

raw crescent
#

or you have to use the customer id

#

Hello 👋
Could you provide me more information on the use-case here?

marsh temple
#

on the backend i have ephemeral key for ios

#

i was wondering if i could use that for web as well setting up a setup intent

#

and if not and there is no customer id for the setup intent is there some other mapping i can use so when the response comes asynchronously i can do the mapping on the backend

#

sorry not used to discord not sure if i’m doing this right

raw crescent
#

Let me look into it.
Just juggling between a few threads at the moment

marsh temple
#

ok thanks is this the right place to ask ? and this private thread to discuss?

raw crescent
#

Yup this is the right place

#

Thank you for your patience.
We don't recommend that you use Ephemeral keys for web as they're designed to work with mobile SDKs.

#

AFAIK In order to create an Ephemeral key, you'd need a customer right?

marsh temple
#

yes the backend has the customer

raw crescent
#

f not and there is no customer id for the setup intent is there some other mapping i can use so when the response comes asynchronously i can do the mapping on the backend
I'm not sure what you mean by this. Can you give me an example?

marsh temple
#

well on the web site the user will add a payment with setup intent right ?

#

but according to the video associated with that you can skip the customer id

#

and attach the customer to the payment instrument later

#

so without giving the web app the customer id

#

how can i map the asynchronous response back to the customer

#

the webhook for the asynchronous response is on the back end, not the web app

#

i just want to mimic the mobile device flow, the mobile device never sees the customer id

#

i want to maintain the customer id on the back end without sharing it with the web app

#

does that suffice as an example?

raw crescent
#

I don't know if stripe.js supports ephemeral keys though

marsh temple
#

well im not asking for ephemeral key specifically, is there ANY way to map the payment intent to customerid on the back end?

raw crescent
#

Okay wait
Let's take a step back here as your original ask mentioned ephemeral keys.

If I understand it correctly, (feel free to correct me at any point)

  • You want to create a SetupIntent (server-side)
  • Confirm it (client-side)
  • Associate it with a customer (server-side)
marsh temple
#

change the first step to client-side without a customer id and you have it

raw crescent
#

Ah okay. Thanks for clarifying.
What are you planning on using on the client-side? Stripe checkout, Stripe.js ?

marsh temple
#

stripe checkout

raw crescent
#

Pre-built checkout page correct?

marsh temple
#

to capture the user's payment details

raw crescent
#

gotcha. let me quickly check something.

marsh temple
#

thank you

loud raptor
#

catching up here one sec @marsh temple

#

mind summing up your question in one line, if possible?

marsh temple
#

sorry?

#

using stripe checkout on the client side, is there anything i can use instead of the customer id to map the payment intent on the back end to the customer id when the asynchronous webhook is called

loud raptor
#

nope, you just use the Customer ID of the Customer that completed the CheckoutSession

marsh temple
#

would metadata work?

loud raptor
#

that can work too