#robertpartfy

1 messages ยท Page 1 of 1 (latest)

fossil pollenBOT
remote carbon
#

Hi ๐Ÿ‘‹ you can apply the Coupon to the Subscription, but if the Invoice is finalized then it will not inherit the change.

waxen flower
#

i'll explain a little further so you can get more context ๐Ÿ™‚

#

let's suppose the user is redirected to the payment form in order to activate their subscription. the subscription gets created when the user accesses this form, and therefore it's already created (just after the subscription was created, an unpaid but finalised invoice was created). the user leaves the form, but the subscription is not deleted. the user come backs to the form and wants to apply a coupon. how can i do that?

remote carbon
#

Sounds like you'd create a new Subscription for that.

waxen flower
#

i see, so i would need to cancel the older subscription and create a new one, wouldn't i?

#

and apply the coupon when creating the new one, of course

remote carbon
# waxen flower i see, so i would need to cancel the older subscription and create a new one, wo...

That depends on how you're creating the Subscription. If you're setting payment_behavior to default_incomplete, then Subscriptions in an incomplete state will automatically be canceled after 23 hours without successful payment.
https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_behavior

waxen flower
#

ok, i'm already setting payment_behavior to default_incomplete. that would mean i don't need to manually cancel the subscription, right?

remote carbon
#

Correct, they'll automatically clean up after about a day of not being paid for.

waxen flower
#

right, i see.

#

would you recommend creating the subscription as soon as the user clicks the payment form's button rather than creating the subscription when the user accesses the payment form?

#

so the dashboard doesn't get cluttered with canceled subscriptions

remote carbon
#

That's largely up to you and how your flow is currently built. If you're using our Payment Element, then you'll need a client secret in order to load the Payment Element, so you'll need to create the Subscription ahead of time.

waxen flower
#

aha, i see!

#

thanks for your help @remote carbon , i don't have any more questions ๐Ÿ™‚ have a nice day

remote carbon
#

Awesome, glad I could help! Hope you have a great day!