I am trying to access the amount property in the below json file.
{
"id": "evt_1EQZxID5bcg",
"data": {
"object": {
"id": "cs_0G452PD7eY8ddrtuyo0KZ5sSRk",
"display_items": [
{
"amount": 300,
"currency": "gbp",
"custom": {
"name": "Purchase"
},
"type": "custom"
}
],
"livemode": false,
"payment_method_types": [
"card"
],
"subscription": null,
"success_url": ""
}
},
"livemode": false,
"request": {
"idempotency_key": null
},
"type": "checkout.session.completed"
}
I have tried using this code to access the peroperty
$object->data->object->display_items->amount
However, this returns no data.
I am thinking this has to do with the square brackets, but when I try access that alone I get an array.