#mathiashenriksen_92217

1 messages ยท Page 1 of 1 (latest)

pale salmonBOT
spare wigeon
#

Hi there!

#

How are you creating the Subscription? Checkout Session, tje Subscription endpoint, something else?

thick charm
#

Hey! I am using the Node subscription.create endpoint

spare wigeon
thick charm
spare wigeon
#

Got it. Give me a few minutes to try to reproduce.

#

Indeed, as soon as the invoice is created, the coupon is considered redeemed.

#

If that's not what you want, then you may want to build your own coupon system.

thick charm
#

Ahh I see. Does that also happen in a Checkout Session?

spare wigeon
#

Not sure, having a look

#

It kinda works:

  • If the user opens the Checkout Session and then leave, then the coupon is not redeemed.
  • However if the user tries to pay in the Chekcout Session, and it succeeds or fails, then a Subscription is created and the coupon redeemed
thick charm
#

Hmm, does the checkout session not use the same API?

I have not tried the checkout session myself, but the problem when using the API is that I cannot render the payment elements until I have a client secret, which comes with the payment intent. And when requesting this payment intent I also redeem the promotion code ๐Ÿ˜•

I should be able to do something similar to what is happening in the Checkout Session, no?

spare wigeon
#

Hmm, does the checkout session not use the same API?
It does, but the Checkout Session only create the Subscription when the user tries to pay, not before.

#

Another option is to collect to promotion code before showing the Payment Element.

thick charm
#

That is great! I'll try the new flow then ๐Ÿ˜„ thanks