#Jasuno
1 messages · Page 1 of 1 (latest)
Hi, no it's not. API Keys, https://stripe.com/docs/keys are used to make calls on your account. The client_secret is only applicable to Payment Intents: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret.. Typically, you use to to confirm the Payment Intent etcs.
I need to set up fields so a user can add their payment method, i read the docs and it seems like i can only add it using the stripe JS package
Yes, that is correct. You'd use Stripe.js for this: https://stripe.com/docs/payments/elements
That being says to use the element i need a client secret, where can i get that, if i'm not processing a payment intent, but just adding a payment method
In this case you'd use the Setup Intent: https://stripe.com/docs/payments/save-and-reuse?platform=web#web-collect-payment-details. This allows you to collected payment details for future purchases.
You can retrieve the Clients secret from the SetupIntent, https://stripe.com/docs/api/setup_intents/object#setup_intent_object-client_secret with your Publishable API Key on your client side.
ok so loadStripe will have that key
I'm unsure what you mean here...
Sorry i'm yet to see where that client key comes from
wait does it come from stripe.setupIntents.create
?
When you create the SetupIntent at this step: https://stripe.com/docs/payments/save-and-reuse?platform=web#web-create-intent. Then you retrieve the client secret from an endpoint on your server, https://stripe.com/docs/api/setup_intents/object#setup_intent_object-client_secret using the browser’s fetch function on the client side.
Yeap!
Ok great, so it ok that the client has access to it through their network tab?