#jjo_ib-tax
1 messages · Page 1 of 1 (latest)
Hello! Quick question - how are you integrating with Tax currently? Are you using Checkout? Invoices? Subscriptions?
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
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)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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 ?
To go from the Charge -> Session you'd have to grab the associate Payment Intent and use that ID to list the sessions (https://stripe.com/docs/api/checkout/sessions/list#list_checkout_sessions-payment_intent)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
Correct - there should only be one Checkout Session for a Payment Intent