#bhanu365
1 messages · Page 1 of 1 (latest)
or when I apply a coupon of 50% or other types of percentage (leave that 100%) so I just want to render an payment element
Do you mean that you want to setup the payment method regardless the discount percentage?
This is my flow
Currently, what I am doing, there are 2 subscriptions of 6 months and 12 months. When I click on the button a popup appears. On the backend side, I am creating a subscription with the payment behavior "default_incomplete". But in this case, the coupon of 100%, and the duration is "Once" are not working because the coupon (once) will work only on first invoice. So I don't know what can I do now.
Can you share the subscription ID (sub_xxx) that you created?
sub_1M5NtbFmM52WOkSorL5Ez6ib
Where do you apply coupon? I can only see that the subscription is created with 6-month plan without coupon: https://dashboard.stripe.com/test/logs/req_F14FUnYCoA6Aaf
The first time the subscription will create with the "default_incomplete" payment behavior after that I am storing that subscription ID temp. and when a customer applies the coupon then I am updating the coupon on that subscription by the ID that i was storing temp.
But then what I see that coupon are applying on their next invoice
When you created a subscription, the underlying invoice is already finalized. Once the invoice is finalized, you can't modify it.
With your coupon added after the invoice is finalised, the discount will be applied to the next cycle
yes exactly So what can I do now? what's your recommendation?
What you can do is:
- Let customer choose the plan and enter the coupon
- Create subscription with coupon if there's any and expand
[pending_setup_intent, latest_invoice.payment_intent] - Collect payment method
- In step 3, if the invoice is zero, you can use client secret in
pending_setup_intentto collect payment using Payment Element - In step 3, if the invoice is non-zero, you can use client secret in
latest_invoice.payment_intentto collect using Payment Element
Ok thanks let me try it
Sounds good 👍
I followed the above steps and when I applied the coupon of 100% the invoice has been paid without collecting the payment using the payment element or without any confirmation on our side. We need to show a button for confirmation (the confirmation will be the last step). like if customers applied a coupon and then they change their mind and close the popup of the subscription, they don't want to proceed further, what will be in this case?
- Then why do we use the payment element if the invoice has already been paid?
- We need a confirmation button then the invoice will be paid.
sub_1M5OkPFmM52WOkSoKp2JaAgc
why do we use the payment element if the invoice has already been paid?
You can collect the payment method if the invoice is already paid with zero. In the next billing cycle, it'll be charged to the saved payment method without asking customer for the payment method again
We need a confirmation button then the invoice will be paid.
If you wish to display confirmation button with 100% coupon applied, then it can be done at your own end before creating a subscription, not after creating a subscription. Stripe always creates subscription automatically if the first invoice is zero.
ok got it
Can I collect the payment method before creating the subscription?
Yes, it is possible. You use the SetupIntent to create a payment method, then set in default_payment_method in the subscription creation: https://stripe.com/docs/payments/save-and-reuse
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!