#Luis Felipe
1 messages ยท Page 1 of 1 (latest)
Can you share an example of where the address is inaccurate and taxes aren't applied?
Of course. First of all this is the address data that will be used to save: address_to_save = {
"city": data["city"],
"country": billing.country.prefix,
"postal_code": data["postcode"],
"line1": data["address"],
} this following line is the data of the dict: {'city': 'Madrid', 'country': 'ES', 'postal_code': '2222', 'line1': 'Calle de broma'}.
This is the screeshot of the data in the client portal, which is well updated
Can you share some object IDs? cus_xxx? in_xxx?
An this is the information given in stripe dashboard for this customer
Screenshots aren't much help here I'm afraid. I need IDs of the objects you're referencing
The customer id is cus_NUmQpOW0Bntm7e
This is the modify method call: stripe.Customer.modify(
stripe_user_id,
name=name,
address=data,
tax_exempt="none"
) Is there something wrong?
The thing is that when the billing data is modified within the customer portal with stripe, it works but it doesnt when it is modified by calling stripe endpoint
Ok, and where were taxes not collected? On what payment?
when i create a checkout session, the taxes are not showed as it says "the taxes are determined by billing information"
Can you share that cs_xxx ID? Or the code you use to create that session?
of course, here is the code implementation
checkout_session = stripe.checkout.Session.create(
payment_method_types=["card"],
mode="subscription",
line_items=[{"price": request.data["price_id"], "quantity": 1}],
customer=customer_id,
tax_id_collection={"enabled": True},
customer_update={"name": "auto"},
success_url=domain_url,
cancel_url=domain_url + "plans",
allow_promotion_codes=True,
automatic_tax= {"enabled":True}
)
Thanks, let me check!
Cool
The reason is because we default to using the Customer shipping address for tax calculation: https://stripe.com/docs/tax/customer-locations#address-hierarchy
https://dashboard.stripe.com/test/customers/cus_NUmQpOW0Bntm7e has an AL shipping address
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Stripe Tax doesn't support Albania: https://stripe.com/docs/tax/registering#list-of-state-and-country-registration-sites
Your answer was really helpful! Hence, by adding shipping key in stripe.Customer.modify solved my problem!
Were can i rate you help? ๐
A kind message here is more than enough ๐