#Clawfoot

1 messages · Page 1 of 1 (latest)

nova spearBOT
strange moat
#

And when I print_r() the entire resulting $customers object, there is no 'subscriptions

#

' field

runic cipher
strange moat
#

I'm looking at this website

#

and in the 'More attributes' section

#

there is 'subscriptions'

#

saying that it is an expandable field

#

if it's not there, my followup question is, how can I get a list of subscription IDs from a single customer ID?

#

so, with your subscriptions API, I could basically fetch all subscriptions, loop over them, and stop on the one with the matching customer ID?

runic cipher
#

can you share the customer Id ?

strange moat
#

cus_N5TqsHRJLP4NDF

#

it's in my Stripe TEST mode

runic cipher
#

OK I see that the customer has this active subscription sub_1MLIshFtGvcbRuR6zTeKLTKo

#

Can you share the requestId of the API call you are doing please ?

strange moat
#

I'm not sure how to get the requestID, can you give some more info on that please?

#

I can give code of what I'm doing, or the output $customer object

#

or the input secret client Stripe key?

strange moat
#

req_CCevROuSGXjF9u

runic cipher
#

Thanks for sharing it looks like you are passing no query for this request, there isn't an expand param

strange moat
#

probably the same thing, but I just ran it again

#

req_pDdLZzXrTW5ExT

#

and my code still looks like

#

$customer = \Stripe\Customer::retrieve(
$i_stripeCustomerID,
['expand' => ['subscriptions']]
);

runic cipher
#

ok let me do a quick test ...

strange moat
#

thanks

runic cipher
#

I just did a test using this code and it works:

$stripe = new \Stripe\StripeClient(
    'sk_test_....'
);
    $output = $stripe->customers->retrieve(
        'cus_N5TqsHRJLP4NDF',
        ['expand' => ['subscriptions']]
    );

#

use your test secret key and try it

strange moat
#

alright, I'll check it

#

req_7yrMn78uSgR9wd

#

that absolutely does work, so what's the difference? why doesn't the original syntax in PHP work?

#

should I switch? and not use

#

\Stripe\Stripe::setApiKey($stripeApiKeySecret);

#

or

#

$customer = \Stripe\Customer::retrieve(...)

strange moat
#

ok I'll work with that, thanks so much for your help here

runic cipher
#

Np!