#kpop-tax
1 messages ยท Page 1 of 1 (latest)
the checkout session has an object with this info:
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 1000
},
but as far as I can tell, this information is not passed onto the payment intent or charge
Yeah I think it may just be reflected in the Checkout Session and not the Payment Intent for now ๐ฆ
yikes
this is a fairly urgent problem for our platform
(and probably many other connect platforms)
Can you speak a bit more on what the problem is?
We run a populate affiliate platform for Stripe customers (getrewardful.com). Stripe merchants can set up referral programs and (for example) pay affiliates a 30% commission for each sale they generate
So if Alice refers Bob, and Bob makes a $100 payment, Alice will earn $30
but it's critical that we calculate commissions on the amount before tax
If Bob pays $110 ($100 item + $10 tax) Alice should still only earn $30.
That's fair - but you should be able to pull the tax that's tied to the Payment Intent by retrieving the Checkout Session, right?
in theory, but how do you find the checkout session related to a payment intent?
I can't see any attributes on the PaymentIntent that point back to the originating Checkout Session
You can retrieve the Checkout Sessions associated with a Payment Intent: https://stripe.com/docs/api/checkout/sessions/list#list_checkout_sessions-payment_intent
but i need to go the other way, i already have the payment intent
Yes, you would use pass in the Payment Intent ID and you'd get back the associated Checkout Session
ahh gotcha
it would make far more sense to include this total_details on the payment intent object directly
That's fair, and I'll make sure to flag that as feedback ๐
Thanks. Is there a way to escalate this or something? It's massively disruptive for us to rewrite our flow to now be fetching checkout sessions just to get tax amounts
Hello! I'm taking over for @mortal plank. Payment Intents are designed to handle payment for a specific amount. They are not designed to include details about that payment, like line item level details, taxes, etc. We have higher-level objects that include details, like Checkout Sessions and Invoices (both of which generate Payment Intents to collect the total due).
That's why Stripe Tax isn't supported on Payment Intents directly, only on Checkout, Invoices, etc.
Thanks for the added context. If that's the case, then arguably the checkout session object should be an expandable property on payment intents, or at least payment intents should have a reference pointing to their originating checkout session (similar to charges/invoices)
Anyway, thanks for the help pointing me in the right direction and for the explanation. Looks like I have some work on my end now ๐
Can you tell me more about your integration? Why are you starting from a Payment Intent? Are you listening for a payment_intent.* event?
We actually listen to charge.succeeded (legacy reasons) and then expand the associated invoice, if there is one. There hasn't really been a reason for us to use the Payment Intent events thus far.
(The reason we listen to charge.succeeded is that we only care once a payment is captured).
You may want to investigate checkout.session.completed as another event you might want to listen for in this scenario.