#nhuzaifa_70357

1 messages · Page 1 of 1 (latest)

near yokeBOT
iron crown
#

Hello 👋
Have you tried passing one-time and recurring price both when creating the checkout session?

undone yoke
#

Not really didn't find anything related to that in the documentation.

This is my current code which only has a subscription.

const createCheckout = async (priceId, quantity, order) => {
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
line_items: [
{
price: priceId,
quantity: quantity,
},
],
mode: 'subscription',
customer: order.customerId,
client_reference_id: order.id,
metadata: {
userId: order.userId,
},
success_url: ${HOSTNAME}/onboarding/checkout,
cancel_url: ${HOSTNAME}/onboarding/pricing,
})
return session
}

iron crown
#

Try passing in a one-time price in the line-items too

undone yoke
#

great

#

Thank you