I have been having an issue trying to get the value of one field from a Paypal response array. I have been working on it for hours and can not figure it out.
I want the value of $related_resources->sale->id, however I tried
$resource_id = $related_resources->sale->id;
AND
foreach ($related_resources as $related_resource) {
$resource_id = $related_resource->sale-id;
}
and neither have worked. Hopefully someone will be able to help me out and save me from this headache.
"related_resources": [ { "sale": { "id": "000000000000", "state":
"completed", "amount": { "total": "0.01", "currency": "USD", "details": {
"subtotal": "0.01" } }, "payment_mode": "INSTANT_TRANSFER",
"protection_eligibility": "ELIGIBLE", "protection_eligibility_type":
"ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
"transaction_fee": { "value": "0.01", "currency": "USD" }, "receipt_id":
"00000000000", "parent_payment": "PAY-000000000000000", "create_time":
"2017-04-28T14:59:05Z", "update_time": "2017-04-28T14:59:05Z"...