#angel785420

1 messages · Page 1 of 1 (latest)

civic smeltBOT
raven berry
#

Hello! What's up?

verbal grail
#

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}",
}
)

raven berry
#

It's likely because the tax you're trying to collect doesn't apply to the transaction for some reason.

#

Is your account configured/registered to collect tax in the proper locations? Are the items you're trying to sell exempt from tax?

verbal grail
#

let me double check

#

You are correct sir.