Reputation: 255
With mode as 'payment' , I can pass client reference id in stripe implementation. This is the code i have used
I have passed client reference id with mode as 'payment' and it worked in my angular project, but when i changed mode to 'subscription' the client reference id is not passing.
Upvotes: 1
Views: 721
Reputation: 623
I replicated the setup on my end and passed the clientReferenceId
(see code below). I am seeing the clientReferenceId
property on the checkout.session.completed
event. Note, the prop is only available on the Checkout Session object, so you will not see it on the PaymentIntent or any other objects.
On another note, client-only checkout is deprecated, I recommend following the Checkout Session integration guide instead.
await stripe.redirectToCheckout({
mode: 'subscription',
lineItems: [
{
price: SUBSCRIPTION_PRICE,
quantity: 1,
},
],
successUrl: `${baseUrl}/redirect`,
cancelUrl: `${baseUrl}/`,
clientReferenceId: 'testid',
})
Upvotes: 5