Getting latest customer data from Stripe checkout in PHP:
$customers = \Stripe\Customer::all(array("limit" => 1, "created" => array("gte" => strtotime("-5 hour"))));
foreach ($customers->data as $customer)
{
$email = $customer->email;
$address = $customer->shipping;
etc. etc.
$email is fine but echo of $address gives:
Stripe\StripeObject JSON: { "address": { "city": "Earwig Land", "country": "GB", "line1": "Dump, Some Road", "line2": "Nasty Village", "postal_code": "DD207DX", "state": "" }, "name": "Frankenstein", "phone": null };
Not sure how I extract value of, say, postal code from that as rather confused about using JSON objects. Any ideas? Ta.
PS Edited out me own address and name obviously!
$customers = \Stripe\Customer::all(array("limit" => 1, "created" => array("gte" => strtotime("-5 hour"))));
foreach ($customers->data as $customer)
{
$email = $customer->email;
$address = $customer->shipping;
etc. etc.
$email is fine but echo of $address gives:
Stripe\StripeObject JSON: { "address": { "city": "Earwig Land", "country": "GB", "line1": "Dump, Some Road", "line2": "Nasty Village", "postal_code": "DD207DX", "state": "" }, "name": "Frankenstein", "phone": null };
Not sure how I extract value of, say, postal code from that as rather confused about using JSON objects. Any ideas? Ta.
PS Edited out me own address and name obviously!
Comment