#clyqe

1 messages · Page 1 of 1 (latest)

lunar ledgeBOT
hasty raft
#

Hi
How are you accepting payment from your customers ?

pearl river
#

checkout_session = stripe.checkout.Session.create(
payment_method_types=['card'],
line_items=[
{
'price_data': {
'currency': 'eur',
'product': stripe_product_id,
'unit_amount': prices[item.plan],
},
'quantity': 1,
},
],
mode='payment',

        success_url = f"/purchase-success?session_id={{CHECKOUT_SESSION_ID}}&token={token}",
        cancel_url='purchase-cancelled',
        metadata={
            'username': item.username,  
            'plan_id': item.plan,  
        },
    )
#

I use python for my backend and already configured my products in stripe itself but the automatic tax does not seem to take effect

#

everything works except for the automatic tax

hasty raft
#

Can you share a sample Checkout Session ?

pearl river
#

how can i do that?

hasty raft
#

You share a Checkout Session Id that didn't collected Tax

pearl river
#

a live id?

#

cs_live_xxx?

hasty raft
#

yes you can

#

Just the Id

pearl river
#

cs_live_a1v9P9GbyPS5voUCZNcqseyeGXEiypPfJ2hkuDWJKdCztksBA2sHK00CHD

#

from what I can see it says automatic tax enabled false, even though I already enabled it in my product

hasty raft
#

Yes Stripe tax is disbaled for this Checkout Session

pearl river
#

why?

#

do I have to modify my code?

hasty raft
pearl river
#

I did not have a tax registration set up but now I do

#

For any low-code products add the tax parameter: automatic_tax[enabled]=true. Checkout, Invoices, Subscriptions, Quotes, and Payment Links

#

should i add this piece to my code to finish it up?

#

it should work now?

hasty raft
pearl river
#

I added this to my checkout session code
automatic_tax={'enabled': True},

#

and i see VAT on my checkout session now so I assume when someone purchases it they will pay the tax now

hasty raft
#

Yes correctly

pearl river
#

alright that's it, thanks for the help, the second url you sent helped me figure out the problem