#Luis Felipe

1 messages ยท Page 1 of 1 (latest)

keen hollyBOT
mental ridge
#

Can you share an example of where the address is inaccurate and taxes aren't applied?

jaunty brook
#

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

mental ridge
#

Can you share some object IDs? cus_xxx? in_xxx?

jaunty brook
#

An this is the information given in stripe dashboard for this customer

mental ridge
#

Screenshots aren't much help here I'm afraid. I need IDs of the objects you're referencing

jaunty brook
#

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

mental ridge
#

Ok, and where were taxes not collected? On what payment?

jaunty brook
#

when i create a checkout session, the taxes are not showed as it says "the taxes are determined by billing information"

mental ridge
#

Can you share that cs_xxx ID? Or the code you use to create that session?

jaunty brook
#

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

mental ridge
#

Thanks, let me check!

jaunty brook
#

Cool

mental ridge
jaunty brook
#

Your answer was really helpful! Hence, by adding shipping key in stripe.Customer.modify solved my problem!

#

Were can i rate you help? ๐Ÿ‘

mental ridge
#

A kind message here is more than enough ๐Ÿ’Œ