#Meldin

1 messages · Page 1 of 1 (latest)

proper rapidsBOT
proud crescent
#

How are you implementing this?

#

PaymentIntents, for example don't take coupons. Are you using your own logic to manage discounts?

gleaming kestrel
#

Yes I do

#

Actualy, I made a coupon on Stripe dashbord and then I grab the coupon id and paste it in sanity as a product field

#

then on the backend I check if the coupon is valid and if it is then I push that coupon in discounts array

proud crescent
#

what discounts array

#

Are you using Checkout Sessions?

#

How are you accepting payments?

gleaming kestrel
#

Here: const params = {
submit_type: "pay",
mode: "payment",
discounts: discounts,
payment_method_types: [
"card",
"klarna",
"afterpay_clearpay",

#

Yes then I pass this params object to the checkout session

#

On stripe docs they said that there is only one coupon supported by session

proud crescent
#

Ah yes

#

That's correct. Only 1 coupon can be used in a checkout session currently

#

To make sure it applies to all items in the checkout session and not just 1 of them you need to make sure the coupon can apply to all items

gleaming kestrel
#

So you think I can solve my issue by creating the coupon like on docs but not using Dashbord

proud crescent
#

You should be able to do it via the dashboard too

#

Just don't restrict which products it applies to to only one of the products

#

With Checkout, you can only add 1 coupon

#

So your model of having a coupon for each product won't work if your customer needs to add multiple of these products and hence multiple of these coupons

#

The only way to handle this in Stripe Checkout if you need them to be able to add multiple products is to have 1 coupon that applies to all the products

gleaming kestrel
#

Eather that or I have to handle all discounts and modify the prices of the producst before checkout

#

Anyway Thank u so much