#steel971 - Checkout PHP
1 messages · Page 1 of 1 (latest)
Hello! Yeah, there are details about what was purchased in the Checkout Session: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
Thank you so much for your quick answer
i tried to expand the fields as it's say on the doc
$session = \Stripe\Checkout\Session::retrieve($session_id, ['expand' => ['customer', 'line_items']]);
but i cannot make it work
it's seem to ignore my expand fileds
Can you give me the request ID where you tried to do this? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
hum kind of weird
i doesn't see the request
but you can see the session object here
but nothing in the logs
Make sure you're not filtering out GET requests.
GET requests are filtered out by default I believe.
Looking...
Looks like your code didn't actually send in any expansion information. Is the code above the exact code you used?
Try this instead:
$session = \Stripe\Checkout\Session::retrieve([
'id' => $session_id,
'expand' => ['customer', 'line_items'],
]);
this is working
the syntax is different between
and what I use
is there any documentation for the composer
version ?
Yep, there are details here: https://github.com/stripe/stripe-php/wiki/Migration-to-StripeClient-and-services-in-7.33.0
oh
i use the legacy approach
i'll change my code in order to do the newest version
Yep, the legacy approach is fine, but the API reference uses the new version.
thank you
maybe this page need an update on the PHP version
in order to be on the newest version
Thank you so much for your help !
Best regards,
Yep, all the docs still use the legacy PHP approach.