#hexiaolong
1 messages · Page 1 of 1 (latest)
If you're using Payment Intents directly, you can't apply Coupons/Promotion Codes
I currently use this approach (https://stripe.com/docs/stripe-js/react#elements-provider), the incoming clientSecret, cannot use coupons?
Are you using Subscriptions, or one-time payments with a Payment Intent? The React/Elements part is irrelevant
1.Why is this not supported?2.How do I use coupons or special discounts
It's just not something we've built unfortunately. You can use coupons for one-time payments with Checkout
It could go either way
Otherwise you'll need to manually handle the discount calculations yourself
Subscriptions can have Coupons applied, just not a Payment Intent directly: https://stripe.com/docs/billing/subscriptions/coupons
Does this only allow to jump to stripe's payment page and not React/Elements?
Yes, it's a hosted payment page
It's the same way, right?
What do you mean?
one-time payments with Checkout and Subscriptions is the same way?
The same way in what regard?
const session = await stripe.checkout.sessions.create({
line_items: [
{
// Provide the exact Price ID (for example, pr_1234) of the product you want to sell
price: '{{PRICE_ID}}',
quantity: 1,
},
],
mode: 'payment',
success_url: ${YOUR_DOMAIN}?success=true,
cancel_url: ${YOUR_DOMAIN}?canceled=true,
}); in this demo,i can just change mode to specify whether it's a one-time or a subscription, right?
Correct yes
If we process the discount ourselves, can we not check the usage details of the coupon in the stripe management background? Because the price is processed by us and cannot be associated with payment
You can check the redemption status on a Coupon sure: https://stripe.com/docs/api/coupons/object#coupon_object-times_redeemed
But Checkout handles that for you if you were to use that
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I can manually create create a coupon in management background, but if I don't use stripe.checkout.sessions.create, instead of their coupons and commodity prices, to calculate the real pay, so I can see in management background information such as the use of coupons? I think no, because no information about the coupon was sent to stripe at the time of payment, so it cannot be associated with Stripe. Is my understanding correct?
Yes, you can't manually increment the 'redemption' count of a Coupon