#issambd-tax

1 messages ยท Page 1 of 1 (latest)

crimson harbor
#

what Element are you using to collect a PaymentMethod

bronze badge
#

hmm

#

PaymentElement

#

with payment intent for direct purchase and setup intent for trial

crimson harbor
#

can you share the request ID for the failing request?

bronze badge
#

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

crimson harbor
#

ack, looking

unreal shadow
#

๐Ÿ‘‹ I'm also hopping in to help! Give me a minute to catch up!

bronze badge
#

Okay thank you

unreal shadow
#

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).

bronze badge
#

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

unreal shadow
#

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

bronze badge
#

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

unreal shadow
#

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

bronze badge
#

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?

unreal shadow
#

Yeah, that's the option I would go with

bronze badge
#

alright, Im gonna start working on it. I appreciate the tip.

#

I have a quick question tho

unreal shadow
#

go ahead!

bronze badge
#

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

unreal shadow
#

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

bronze badge
#

aha

#

im trying it now

#

Request POST body
{
"price": "price_1Joo4PLzSPzAEiPDkiQUdYpj",
"proration_behavior": "create_prorations",
"quantity": "34"
}

unreal shadow
#

You'll want always_invoice if you want an invoice to be generated immediately

bronze badge
#

That worked, thank you Karbi

unreal shadow
#

๐Ÿ‘

bronze badge
#

have a good one