#Alex-LeanXcale
1 messages ยท Page 1 of 1 (latest)
And what error did you have?
No error, I just don't have the tax section in the response
Maybe the syntax of the expand parameter is not correct?
๐ taking over for my colleague. would you mind sharing the code your using?
Yeah, let me prepare a code snippet for you.
yes that would be great
Actually it's very simple
I don't know if this is enough for you ...
use Stripe\Customer;
$stripeUserInfo = Customer::retrieve($stripeUserID, ['expand' => ['tax']]);
$automatic_tax = $stripeUserInfo['tax']['automatic_tax'];
And if I try to print the value of automatic_tax I get the following
automatic_tax: [] []
Hope this is enough, I'm sorry but Im'm completelly new in Stripe and also in PHP ๐ณ
I appreciate so mucho your time and help
Thanks a lot!
ok so basically the retrieve function in PHP works a bit differently
you need to pass in the id and the expand like so
$stripeUserInfo = Customer::retrieve(['id'=> $stripeUserID, 'expand' => ['tax']]);
would you mind trying that out
let me know if you need any more help
Yeah! Now the tax section is correctly expanded
(
[automatic_tax] => supported
[ip_address] =>
[location] => Stripe\StripeObject Object
(
[country] => ES
[source] => billing_address
[state] =>
)
)
[tax_exempt] => none
[test_clock] =>
)
But how can I get the automatic_tax value?
I was trying like this:
$automatic_tax = $stripeUserInfo['tax']['automatic_tax'];
Ahhhh, forget about it!!!
My mistake
It's completelly OK
Many thanks for this!!!
Sure!, have a great day!