#ZakMcKraken
1 messages ยท Page 1 of 1 (latest)
what I'm trying to get is "tax": { "automatic_tax": "unrecognized_location", "ip_address": "172.29.0.1", "location": null },
which I get when I expand customers->create with "tax"
Hello ๐
Can you share the snippets of code that creates and retrieves the customer?
however for retrieve it doesn't seem to work
hi ๐
the code is a little bit complex so I'm not sure that would be helpful
do you know if I should be able to get https://stripe.com/docs/api/customers/object#customer_object-tax in a retrieve call?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
my getCustomer function is fairly straightforward though
{
$this->setApiKey();
$opts = ['stripe_account' => $this->network->stripe_user_id];
if ($this->network->calculate_taxes) {
$opts['expand'][] = 'tax';
}
return Customer::retrieve($stripe_cust_id, $opts);
}```
okay I do see the tax information when expanding in my tests.
Are you sure your expand parameter is being passed correctly?
I'm not sure since the backend doesn't show much details for successful GET requests
If I dump $opts I see what (I think) is expected
"stripe_account" => "acct_XXX"
"expand" => array:1 [
0 => "tax"
]
]```
but the customer object returned doesn't have the "tax" property
hmm I'm not super familiar with how diff PHP syntaxes work
example in our docs have
'ch_3K7iYRLAZYXcVxtG0y8UPBUv',
['expand' => ['customer', 'invoice.subscription']]
);```
and this if you have connected accounts at play
```$ch = $stripe->charges->retrieve(
'ch_3K7iYRLAZYXcVxtG0y8UPBUv',
[],
['stripe_account' => 'acct_1K7iPtLAZYXcVxtG']
);
oh looks like there is a third parameter for that in that case
let me try
that's odd though because the stripe-php code doesn't show a third param
ok this is unexpected
'id' => $stripe_cust_id,
];
if ($this->network->calculate_taxes) {
$params['expand'][] = 'tax';
}
return Customer::retrieve($params, ['stripe_account' => 'acct_XXX']);```
but this works
Ah nice, glad that worked!
I wonder if our stripe-php is out of date or if it's the doc
but thanks for the rubber ducking ๐
No worries. The latest version as of an hour ago is v10.3.0 just in case ๐
https://github.com/stripe/stripe-php/releases