#harshit.tyagi

1 messages · Page 1 of 1 (latest)

heavy nebulaBOT
idle sinew
#

Hi there, yes you can apply a coupon to a checkout session

hallow ember
#

So, to implement this discount coupons have to be created beforehand on stripe, right? But my use case is - where application has a wallet where customers can have credits worth x dollar amount. Now, let's say customer has 2 items in cart worth 10 dollars, but he has 4 dollars of credits in application wallet so I want stripe to charge only 6 dollars from him.

idle sinew
hallow ember
#

but i'll have to create coupons for each different discount percentage, because customer can have any amount of credits in wallet .. so I'll have to calculate the discounted price at run time and then will have to create a coupon code accordingly before I send the request to create stripe checkout session? This doesn't seem to be a good approach to me. I'll end up with so many coupons codes on stripe if I use this approach.

idle sinew
hallow ember
#

can't I just specify the discount % or discounted subtotal when creating the checkout session?

idle sinew
#

No

hallow ember
#

hmm .. okay.
One more question:
I am also using stripe connect accounts for my partners, and when I create the checkout session I specify the connect account id and amount that I want to transfer to the connect account for that transaction. Now, when I'll be applying the discounts using coupon codes, I don't want the connect transfer amount affected by this.
For e.g. - Subtotal amount is $10, I apply a coupon code which gives 40% discount .. so the discounted price becomes $6 ... but for the connect transfer I still want to transfer the full amount $10. When I tried this, stripe returned an error saying that connect transfer amount can not be greater that subtotal amount. So, how should I implement this use case?

#

there?

#

@idle sinew pls respond

#

@rustic mantle

#

@compact cave

compact cave
#

Don't think that's possible. Transfer should be calculated based on the post-coupon price

hallow ember
#

Can you please confirm?

compact cave
#

What do you want to confirm?

#

I meant that's expected

hallow ember
#

okay