#issaias

1 messages ยท Page 1 of 1 (latest)

slender atlasBOT
potent jetty
#

๐Ÿ‘‹ happy to help

#

when you say an existing subscription do you mean an ongoing one?

#

would you mind elaborating a bit?

sturdy garden
#

In my signup flow I have the user select a plan which creates a subscription on my backend. This passes the payment intent details to the frontend so they can fill out their payments details/account info. I want to apply a discount code on the account info/payment details step. If I apply a discount code it still uses the old price though.

potent jetty
sturdy garden
#

req_hiDgmKPECDlqbU

#

Then I confirm the payment intent in this request req_XlGLZxO3hb2Y68 but the amount is still 250 when it should have 10% off.

true wren
#

Hi there ๐Ÿ‘‹ apologies for the delay, I'm working on pulling those requests up and taking a closer look at them.

#

What I'm seeing is requests were made to:

  1. Create a Subscription
  2. Update the newly created Subscription by adding a Coupon to it
  3. The Payment Intent from the first Invoice's Subscription is then confirmed

With that order, it is expected for the Payment Intent to not contain the discount from the Coupon. When you create a Subscription, it immediately generates and finalizes its first Invoice, and since that Invoice is finalized before the Coupon is applied to the Subscription it does not incorporate the discount provided by that Coupon.

#

Since the first Invoice gets immediately finalized you won't be able to update or edit it, and you would need to provide the Coupon during the Subscription's creation request for its discount to be reflected in the first payment.