#mathan

1 messages · Page 1 of 1 (latest)

modern garnetBOT
static wedge
keen mango
#

i need to check unpaid or pending invoice!

#

only

static wedge
#

You can refer to just the latest invoice of the subscription. Because otherwise the Subscription will expire if its invoice remains unpaid for 23 hours

keen mango
#

how can I query the latest invoice using php query any example?

static wedge
keen mango
#

how to get latest invoice using this query

#

i need to add something?

#

$stripe->subscriptions->retrieve(
'sub_1MWEUT2eZvKYlo2CRdShBOrG',
[]
);

static wedge
keen mango
#

$stripe = new \Stripe\StripeClient("sk_test_your_key");
$stripe->charges->retrieve(
'ch_3MWJ912eZvKYlo2C0lfK51Nb',
['expand' => ['customer', 'invoice.subscription']]
);

#

this is ok for lates invoice or all invoice

#

i need latest onlye

static wedge
#

The example is for charges API. You need to adapt it to the Subscription API:

$stripe->subscriptions->retrieve(
  'sub_1MWEUT2eZvKYlo2CRdShBOrG',
   ['expand' => ['latest_invoice']]
);
keen mango
#

greate let me check

#

when i changes to other plan, invoice is in draft so how can check this not paid

serene rampart
#

Not sure what you mean?