#power-subscription-coupon
1 messages · Page 1 of 1 (latest)
Unfortunately one-off payments don't support coupons like that. For an Elements page you will need your own coupon/discount logic
ok thanks. do you mean on my backend?
Can you point me in the right direction in your docs for this?
i already have a subscription setup in my stripe account
so i can't just pass a coupond value somehow that I can retrieve from stripe?
Whoops my brain forgot that you could be using subscriptions with this for a moment. You can apply this to the subscription on your backend, one moment finding the doc
ok thanks!
You can make an update call on your backend and pass the coupon ID in to the coupon parameter when making that call https://stripe.com/docs/api/subscriptions/update#update_subscription-coupon
ok great thanks alot!
so on the front end, where would i pass the coupon value itself?
const response = await stripe.confirmCardPayment(clientSecret, {
payment_method: {
card: cardElement as StripeCardNumberElement,
billing_details: {
name: name,
email: email,
coupon: 'ksjdfkjsdf'
},
},
});
can i just add a value to the payload?
This would be a separate custom rest call to your server that sends the code to your backend.
ok thanks
one last question sorry, where can i view all the available fields to pass for the billing_details: object?
im thinking maybe i can pass the coupon value into some available field for the billing_details object and then grab it on my backend?
Our js reference seems to indicate that it would be the billing details that are on a payment method object
https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-data-payment_method
We lay out those fields here https://stripe.com/docs/api/payment_methods#payment_method_object-billing_details
Unfortunately you can't pass the coupon as part of this stripe call. It will have to be a separate call to your server which then makes the call, and once that is successful the client side confirm call can be made.