#sqarf
1 messages · Page 1 of 1 (latest)
what part of it doesn't work specifically, do you get some error message?
Yes
Automatic tax calculation in Checkout requires a valid address on the Customer. Add a valid address to the Customer or set either customer_update[address] to 'auto' or customer_update[shipping] to 'auto' to save the address entered in Checkout to the Customer. {"exception":"[object] (Stripe\Exception\InvalidRequestException(code: 0): Automatic tax calculation in Checkout requires a valid address on the Customer. Add a valid address to the Customer or set either customer_update[address] to 'auto' or customer_update[shipping] to 'auto' to save the address entered in Checkout to the Customer.
But for US we shouldn't apply any taxes
The object (in php) I try to create, looks like this:
return $this->stripe->customers->update(
$user ? $user->stripe_id : $request->user()->stripe_id,
[
'address' => [
'country' => $request->country,
'city' => $request->city,
'line1' => $request->line1,
'line2' => $request->line2,
'postal_code' => $request->postal_code,
'state' => $request->state,
],
'tax_exempt' => $taxExempt,
]
);
$taxExempt variable contains a string 'none'
I guess the question is what should I pass to tax_exempt, so stripe knows that we shouldn't apply any tax
so to rephrase, the customer is updated just fine, but your belief is that because the customer is marked tax exempt you want Checkout to not ask for an address?
It can ask address on stripe checkout, but it doesn't create Stripe Checkout object
also what is the request ID req_xxx associated with the exception you posted so I can look ?
as the error message mentions, the customer's address is incomplete as you only passed the country(so the other variables in your $request were empty) https://dashboard.stripe.com/logs/req_cCslTfvdryXtPS
Is it mandatory to have full address?
so as the error message implies, you either need to make sure the customer has an address set before calling that API, or use the parameters it mentions so that Checkout will collect+use an address
the error message says directly that it's needed
there's also some docs on this here : https://stripe.com/docs/payments/checkout/taxes?tax-calculation=stripe-tax#existing-customers