#key
1 messages · Page 1 of 1 (latest)
Hi there,
You can share both with client side, in order to confirm the payment Using Stripe Elements.
You can refer to this guide for further details
https://stripe.com/docs/payments/quickstart
Does it mean there is no difference? Why then client_secret exists?
The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.
The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.Refer to our docs to accept a payment and learn about how client_secret should be handled.
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret
PaymentIntent Id, can be shared publicly but the client_secret can be shared only with the customer who doing the purchase
are you saying PaymentIntent Id can't be shared with the customer doing the purchase? Why would I share it with some else though
Sorry but I didn't said that, I said PaymentIntent Id, can be shared publicly including the customer him self
So, basically there is no point of using client secret at all if I got PaymentIntent Id, since it can be always used instead?
No you need to use the client_secret in order to charge the customer :
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-collect-payment-details
const options = {
clientSecret: '{{PAYMENT_INTENT_CLIENT_SECRET}}',
// Fully customizable with appearance API.
appearance: {/*...*/},
};
// Set up Stripe.js and Elements to use in checkout form, passing the client secret obtained in step 3
const elements = stripe.elements(options);
// Create and mount the Payment Element
const paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');
The client secret is like a tightly scoped API key for just that payment intent @rich wolf -- it enabled payment to be completed from the client application
Hi there,
You can share both with client side, in order to confirm the payment Using Stripe Elements.
You can refer to this guide for further details
but I though I could use payment_intent id as well to confirm payment, no?
From the server side, yes, not from the client side
the server side makes this request with your secret key though, which is why you can do that
your client application does not have the secret key, so it needs the client secret
ah, got it, thank you!
NP!