#joseant99.client-secret
1 messages · Page 1 of 1 (latest)
my problem is that I don't know what the clientSecret is
Are you working with Payment Intents?
yes
Great! So the client_secret is the parameter on the Payment Intent object that is used with Stripe.js to confirm the payment (and handle any required authentication)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
fetch("/create-payment-intent", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ items: [{ id: "xl-tshirt" }] }),
})
.then((res) => res.json())
.then((data) => setClientSecret(data.clientSecret));
}, []);
I use this, in items id I have to add the id of a product that says no?
@night terrace hello?
Sorry, had to step away
There's no items parameter when creating a Payment Intent
You instead need to pass amount and currency: https://stripe.com/docs/api/payment_intents/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
okey thanks