#juraj-subscription-expansion

1 messages · Page 1 of 1 (latest)

feral stoneBOT
sullen bone
#

juraj-subscription-expansion

#

@grizzled oasis which language are you using? The $ tells me PHP but the way you use Subscription::retrieve() could be ruby.

grizzled oasis
#

its php

sullen bone
#

Okay so the way you're using stripe-php has been deprecated for a few years

#

Also: you can expand both you don't need that ternary operator, we'll just expand the relevant one (and ignore the other one) so you can do this: $subscription = Subscription::retrieve([ 'id' => $sub->getSubscriptionId(), 'expand' => ['pending_setup_intent', 'latest_invoice.payment_intent'], ]); which is a bit easier to read

grizzled oasis
#

second 🙂

#

thanks a lot its working

sullen bone
#

yay!

#

you should move to the newer way, it's way cleaner