#Gesundheit-Subscription
1 messages · Page 1 of 1 (latest)
Hi!
so, the scenario is:
- the prices of our products are before-taxes
- a new customer, with no payment method attached, decides to buy a subscription of that product
- then, they will see on the side of their screen the "invoice" they will be paying; on the other side, we prompt them to enter their billing information (guaranteed to be card)
what we want after this is that the user sees their invoice being updated with taxes based on their entered billing address
on the backend, when they initially press on checkout, we generate an invoice through the API endpoint subscriptionService.CreateAsync (using Stripe.NET)
then we return the client_secret to the frontend and let stripe elements take care of rendering the invoice.
hello?
Sorry I have been stretched. Will get back as soon as I can!
Hmm
So you created an Invoice already, passing the Payment Intent client secret back to client and have it rendered, but after they enter the billing information, you want to somehow modify the Invoice content?
yep
I'm open to all kinds of answers -- i somehow feel like i should separate collecting payment methods and creating subscription into two different calls
I think there is a few ways can be considered
- Keep doing what you are doing, but after customer enter their billing information, you call Update Invoice API to reflect the change back in your Invoice object.
- Delay the logic to create Subscription/Invoice until after you received your customer's billing information
On 1. it's a bit more complicated. Depends on what collection_method when Subscription is created:
send_invoiceyou will have 1 hour before the Invoice is finalized. During that period you can call Update Invoice API as mentioned abovecharge_automaticallyunfortunately the Invoice will be immediately finalized and charged, so we need workarounds (continuing)
I feel like 1 is harder. Since I'm using stripe tax, I will be setting Subscription.AutomaticTax.Enabled = true when creating a subscription. This will cause Stripe to throw an exception for users who don't have a credit card on file, since Stripe won't be able to determine a tax region.
therefore, i wouldn't even be able to create an invoice, let alone updating it.