#mesudev_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1233415587603025950
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
That ephemeral key should be optional
It's only used to retrieve customer data
What confuses me is that your docs say: "If you never save cards to a Customer and don’t allow returning Customers to reuse saved cards, you can omit the Customer and Customer Ephemeral Key objects from your integration." ?
But when I want to save cards, is a setup intent client secret of a setup intent created with a passed customer ID then enough to save + properly attach the payment method to that customer ?
is a setup intent client secret of a setup intent created with a passed customer ID then enough to save + properly attach the payment method to that customer ?
yes, it is. ephemeral key is only needed if you're retrieving customer from the app
great. so actually I can use the exact same flow for the payment sheet in mobile apps as with web; the exclusive need of the setup intent client secret then, of the setup intent created with the concerned customer ID? No need of customer ID nor customer ephemeral key on the client-side to save a card to a customer? Then I just don't understand the mentioned statement ? ("If you never save cards to a Customer and don’t allow returning Customers to reuse saved cards, you can omit the Customer and Customer Ephemeral Key objects from your integration.") ?
That statement is if it's a 1-time customer
ie you don't need to save any details about them
could you elaborate? As my scenario is about a payment method to be re-used for multiple payments in the future (not in the form of subscriptions, but in the form of services, like Uber, etc.
In your scenario, you need to include customer id
ephemeral key AND customer ID, right ?
so the payment method is attached to the customer and set up for future use
no
you only need that if retrieving customer data from the app, as i said before
okay so to sum it up, to save a payment method for future use in web contexts, the flow is: create customer on BE, create setup intent with obtained customer ID, forward client secret of that setup intent to client-side, there call Stripe.confirmSetup with payment data + setup intent's client secret.
to save a payment method for future use in mobile app contexts using the payment sheet, the flow is: create customer on BE, create setup intent with obtained customer ID, forward BOTH the customer ID and the setup intent's client secret to the client-side, there initiate the payment sheet with these TWO.
Correct ?
Hi 👋 jumping in as my teammate needs to step away soon. Yeah, that sounds right.
and just in case I ever need the customer ephemeral key (which is not the case in my scenario, II undertsood that), how can I generate that customer ephemeral key ?
That's shown in Step 2 of the guide that my teammate shared. The code snippet there shows how to create an ephemeral key for each of our libraries.
https://docs.stripe.com/payments/save-and-reuse?platform=react-native&mobile-ui=payment-element#add-server-endpoint
You'll pass the Customer ID as a parameter to the function that you call.