#jjo_ib-tax

1 messages · Page 1 of 1 (latest)

quartz dew
#

Hello! Quick question - how are you integrating with Tax currently? Are you using Checkout? Invoices? Subscriptions?

mild crater
#

I'm using Checkout API (checkout->sessions->create($params) to generate a payment link) with $params['automatic_tax'] = ['enabled' => true];

#

The "mode" will be using both "payment" & "subscription", but we're only listening to the "charge.succeeded" webhook even for invoices

quartz dew
#

Gotcha - so the issue here is that the Charge object does have any concept of what line items/tax were added up to get the total amount charged for. To see the tax breakdown for one-time payments you need to be looking at the Checkout Session itself (see https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-total_details) or on the Invoices (https://stripe.com/docs/api/invoices/object#invoice_object-tax)

mild crater
#

Thanks. I see that the charge object has an invoice field (for recurring) so I can access the invoice object that way. However I can't seem to find an appropriate relational field on the charge object for the checkout session. How would I go about going from Charge -> Session ?

quartz dew
mild crater
#

Got ya, thanks.
Just to clarify, there is only ever one checkout session for a given payment intent, right? i.e. the only reason it returns an array is simply because that's the format for checkout->sessions->list(), not to imply that a single payment intent can have multiple sessions?

quartz dew
#

Correct - there should only be one Checkout Session for a Payment Intent