#angel785420
1 messages · Page 1 of 1 (latest)
Hello! What's up?
hey so here is my code. Im creating a product and passing the tax code etc for every inline item. new_product = stripe.Product.create(
name=product.name,
tax_code='txcd_40040013',
)
obj = {
'price_data': {
'currency': 'usd',
"tax_behavior": "exclusive",
'product_data': {
'name': product.name,
# 'name': product.name + '#' + f'{product.pk}' + ' seller:' + str(seller),
"tax_code": 'txcd_40040013',
},
# stripe only accepts cent amount integer
'unit_amount': str(int((decimal.Decimal(product.price) + decimal.Decimal(product.shipping))) * 100),
},
'quantity': cart_item.quantity,
}
items.append(obj)
here is my checkout session. session = stripe.checkout.Session.create(
success_url=settings.BASE_URL +
f'/cart/checkout/success/{order.pk}',
cancel_url=settings.BASE_URL +
f'/cart/cart_checkout/cancel/{order.pk}',
payment_method_types=['card'],
automatic_tax={
'enabled': True, },
mode='payment',
line_items=items,
metadata={
# 'seller_amounts': seller_amounts,
'seller_amounts': json.dumps(seller_amounts),
'description': f"order id: {order.order_id}",
}
)
im trying to follow this guide https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior. not sure why i keep getting $0 for my taxes at chekout