#cableman127-coupons
1 messages · Page 1 of 1 (latest)
Uh, neither I think, instead of doing a checkout session, I want to be able to make a payment intent and apply coupons
the Session does not allow for multiple discount codes
I am trying to allow multiple vendor lineItems in a shopping cart for checkout
For instance, I have makeup from one brand, and gym clothes from another company in my cart, how would i apply discount codes when checking out
Thanks for clarifying! So unfortunately, the only way to use Coupons with one-time payments is with Checkout Sessions. If you want to apply discounts to Payment Intents, you would simply change the amount of the PaymentIntent to be something lower. You wouldn't be applying a coupon or anything
is there an easy way to calculate discounts?
/Check if a discouint works on an item
Its hard for me to use checkout sessions because it cannot use multiple discount coupons, it only support one
Let's back up for a quick second - the only way for Stripe's Coupon objects to work automatically with one-time payments is with Checkout Sessions.
As is, Payment Intents don't work with Coupons because Payment Intents don't actually have line items and are just dealing with an amount, not any Prices or Products. There's no way to check if a Coupon can be applied to a Payment Intent because there's no Prices to even check against. If you want to build a multi-coupon solution, you'll need for your Payment Intents to track which products they're tied to, you need to check whether a coupon can be applied to those products, and you need to calculate this discount yourself