#neel.shah-coupons
1 messages ยท Page 1 of 1 (latest)
Thanks @lean juniper.
No. Currently we are using Charge API
oh sorry I missed that
may I ask why are you still using the Charges API. It's being deprecated and we really advise you to migrate to PaymentIntents API
It's legacy system so will consider this in our roadmap.
That's not the reason you're here so I will recenter the discussion on the main topic which is coupons but I just wanted to put it out there
you can't really use coupons directly with Stripe Products like Charges or Payment Intents
you could always create Promotion codes https://stripe.com/docs/api/promotion_codes/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and use an input in your form
and use that to retrieve the Promotion code https://stripe.com/docs/api/promotion_codes/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and get the percent_off or amount_off and use that to calculate the new amount of your charge
Okay, that menas we need to write custom validation logic to validate coupon code..
Is it possbile to do via https://stripe.com/docs/payments/checkout?
custom validation logic to validate coupon code..
not really
if you use the retrieve promotion code API I sent earlier you either get a promocode or not
and you'll be able to apply it
Okay. I will check it out.
you could create a promotion code tied to a customer https://stripe.com/docs/api/promotion_codes/create#create_promotion_code-customer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can't we use https://stripe.com/docs/payments/checkout to collect one-time payment and use promo code?