#Zesh - expansion
1 messages ยท Page 1 of 1 (latest)
Hello
Looking now
Gotcha. Can you send me the request ID for where you're seeing this?
req_dHIGEqichYnS9u
It shows you aren't expanding anything for that request ID. Can you add some print statements to verify the piece of code that's retrieving the invoice is the one above?
Also what version of the php library are you using?
This is the output of my tinker session, and the stripe-php version is 7.112.0
Let me know when you've seen/have the text file so I can remove
None of that is sensitive data so you should be good
I'm not familiar with Tinker
What is that
Got it
Hm ok. Can you try upgrading to the 7.116.0 version of the library and try?
Also what version of PHP are you using?
PHP version is 7.4.x
As for the stripe-php version, that may be possible
We have other packages that depend on the version we're using, but may still be in range
I see
Let me know if it works
If not, I will escalate this/ask around internally as this doesn't look normal
That Tinker session was one you just now tried, correct?
Uh, about 25 minutes ago yes.
Can you also try from a simple script like is done in this video: https://youtu.be/xmfgetuwf-0?t=314
And just echo the object
Same result after updating the stripe-php version for request req_1paVjdqH3S4Jn7
๐ I can help
you're using the legacy PHP way
// Note the first parameter is now an array with id as a key to pass the resource id which was hard to figure out
$checkoutSession = \Stripe\Checkout\Session::retrieve([
'id' => 'cs_test_123',
'expand' => ['line_items'],
]);```
see how you pass the id as a parameter inside the first array, that's how it used to work
So you want $invoice = Invoice::retrieve([ 'id' => 'in_1KXAcgBWZi55jr0HBDS8wdHm', 'expand' => ['charge', 'customer'], ]);
So, Invoice@retrieve signature has changed to Invoice::retrieve(array $opts)?
I'm using Invoice::retrieve($id, $opts)
no it hasn't
opts is separate from parameters
it's where you pass an API key or idempotency key
Ah...
it's confusing
that's why when we built the new way with client/service we clearly made it $stripe->invoices->retrieve($id, $params, $opts);
yay!
and sorry it's so confusing, it's an obscure edge-case, it's rare to expand on retrieve but over time we added more "includable" things and if you use the old way it's a bit hard to discover
try moving to the client/service infra, it's way easier/cleaner ๐
I'm trying to avoid doubling the number of API calls I wanted to make, so was important to me that this worked
Ya, we're stuck in the way we use it at the moment because of deps/reasons, it's our goal to move to latest libraries, just not quite there yet. Thanks so much! Hope ya'll have a great weekend ๐