#issambd-tax
1 messages ยท Page 1 of 1 (latest)
hmm
PaymentElement
with payment intent for direct purchase and setup intent for trial
can you share the request ID for the failing request?
Before there was any request I create the subscription in the backend to obtain a client secret
lemme check if I get an ID
req_gtYBvFFZBqcEVz
This is my integration logic : create subscription > share client secret > collect tax id > collect payment methode including address
ack, looking
๐ I'm also hopping in to help! Give me a minute to catch up!
Okay thank you
So from my understanding of Stripe Tax + Subscriptions, you need your Customer to have a valid address before the Subscription is created since that will immediately create an finalize an Invoice (and we need the tax information before finalization).
The invoice is finalized even without an address when the taxation is not set to automatic
The customer gets assigned an address only after the paymentIntent is confirmed
Yes, because when tax is not set to automatic we don't need to do any tax calculation. When automatic tax is enabled we need all the information up front to be able to calculate the tax before finalization
then what logic do you recommend? at what step shoud the automatic taxation enabled
before the PaymentIntent is confirmed an address is not available, and after the confirmation the invoice is already finalized
You have two options:
-
Change your flow to collect address information prior to collecting payment information so that you can create the Customer with an address.
-
Create a Setup Intent and use that to collect the payment information (including address) and add it to the customer as the default at
invoice_settings[default_payment_method]. That way when you create the Subscription we can pull the address off the customer's default payment method
I am gonna go with the first option, so assigning the address to the customer object instead of passing it as billing data, is that what you recommend?
Yeah, that's the option I would go with
alright, Im gonna start working on it. I appreciate the tip.
I have a quick question tho
go ahead!
when creating the subscription I am passing the ProrationBehavior, I tried "always_invoicing" and " "create_prorations", the goal is to make stripe generate a new invoice when the quantity of a price is updated, unfortunately it does not work
here is an example req_xOzQWs1kIoxP5F
You have to pass in proration_behavior for the request you want it to apply to - so if you want the proration behavior to apply to that update rquest you need to also pass it in with the update request
aha
im trying it now
Request POST body
{
"price": "price_1Joo4PLzSPzAEiPDkiQUdYpj",
"proration_behavior": "create_prorations",
"quantity": "34"
}
You'll want always_invoice if you want an invoice to be generated immediately
That worked, thank you Karbi
๐
have a good one