I have a Stripe_List
that is returned from a \Stripe_InvoiceItem::all()
request.
$invoice_items = \Stripe_InvoiceItem::all();
return $invoice_items;
This gives me the following:
Stripe_List JSON: {
"object": "list",
"has_more": false,
"url": "\/v1\/invoiceitems",
"data": [
{
"id": "ii_123456789abcdefg",
"object": "invoiceitem",
"date": 1424714643,
"amount": 0,
"livemode": false,
"proration": false,
"currency": "gbp",
"customer": "cus_xyz12345",
"description": "Invoice Item",
"metadata": [],
"invoice": "in_abcdefghijklmnop",
"subscription": null,
"quantity": null,
"plan": null
}
]
}
But, I'm unsure how to loop through the results.
return $invoice_items->data; // returns [{}]
return $invoice_items->data(); // Call to undefined method Stripe_List::data()
return $invoice_items->get('data'); // returns Call to undefined method Stripe_List::get()
return json_decode($invoice_items); // returns empty string
I think its just a major gap in my fundamental php knowledge, but after a lot of googling I'm struggling to find any answers.