#vickygiyst

1 messages · Page 1 of 1 (latest)

unborn valeBOT
astral cradle
zenith timber
#

but that will not help me

astral cradle
zenith timber
#

could you please explain this in little bit more details

#

*indetails

astral cradle
#

You want to create a Checkout session with a discount right ?

zenith timber
#

yes, basically i want to give user an option where they can enter coupon code

astral cradle
#

Ah sorry, I though you want to prefill a coupon on their behalf

zenith timber
#

no

astral cradle
zenith timber
#

yes, that i have done. but i want to give an input box to the user on checkout page

astral cradle
#

Could you please share a Checkout Session Id and a screenshot of what you want to acheive ?

astral cradle
#

You didn't specify the allow_promotion_codes

#

when created the Checkout Session

#

You need to update your Checkout Session request according to this:

const session = await stripe.checkout.sessions.create({
line_items: [
{
price_data: {
unit_amount: 2000,
product_data: {
name: 'T-shirt',
},
currency: 'usd',
},
quantity: 1,
},
],
mode: 'payment',
allow_promotion_codes: true,
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel',
});

zenith timber
#

thanks

#

its done

#

👍