#velix - php expansion

1 messages ยท Page 1 of 1 (latest)

candid marsh
#

Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐Ÿ™‚

#

Hey there, what is missing in your result/response?

#

Can you share the request ID?

native scroll
#

Lots of stuff, when I use $stripe = new \Stripe\StripeClient(....); $session = $stripe->checkout->sessions->retrieve(..), I'm getting the full details.

#

For example: cs_test_b1hAfS3GCqqgxuhm5B8VcfFHS6U6mOeasU9qd8kYeQtlVNpxZSkdsBYsUd

#

Maybe it's implemented for StripeClient only?

candid marsh
#

oh i see, its specific to the old vs new style for the pHP client?

#

I think the syntax is just a bit different, its definitely supported

#

hang on

native scroll
#

But \Stripe\Check out\Session::retrieve allows an array as second parameter.

candid marsh
#

I think that you need to make the first param the array with id => cs_123

#

and expand in there, not the second param

#

ah yes, like this:

$checkoutSession = \Stripe\Checkout\Session::retrieve([
  'id' => 'cs_test_123',
  'expand' => ['line_items'],
]);
#

give that a shot

native scroll
#
     * Retrieves a Session object.
     *
     * @param string $id
     * @param null|array $params
     * @param null|array|\Stripe\Util\RequestOptions $opts
     *
     * @throws \Stripe\Exception\ApiErrorException if the request fails
     *
     * @return \Stripe\Checkout\Session
     */
#

The first parameter needs to be string

candid marsh
#

what version of the client are you using?

native scroll
#

Updated about 3 weeks ago

candid marsh
#

if you have the other pattern it must be above 7.33

native scroll
#

1 sec please

candid marsh
#

what i shared should work, what is the snippet you're using now?

native scroll
#

damnit it's 7.1 ...

#

let me just upgrade it

candid marsh
#

i think it should be ok as is, hold on

#

can you share the new snippet?

native scroll
#

gimme some seconds please

#

Thanks, it works now.

#

Your code worked.

candid marsh
#

Excellent ๐Ÿ™‚

#

NP!