Мне нужно проанализировать этот Json из платежной платформы MercadoPago, чтобы получить код ошибки и сообщение: в переменной, чтобы я мог сохранить его позже:
MercadoPago\Payment Object
(
[id:protected] =>
[acquirer:protected] =>
[acquirer_reconciliation:protected] =>
[reason:protected] =>
[payer:protected] => Array
(
[email] => yarcos@gmail.com
[id] => 26054368-ciiGvEqdSTDrKc
)
[collector:protected] =>
[collector_id:protected] =>
[amount_refunded:protected] =>
[_last:protected] =>
[error:protected] => MercadoPago\RecuperableError Object
(
[message] => payment_method_id attribute can't be null
[status] => 400
[error] => bad_request
[causes] => Array
(
[0] => MercadoPago\ErrorCause Object
(
[code] => 4035
[description] => payment_method_id attribute can't be null
)
)
)
[_pagination_params:protected] =>
[_empty:protected] =>
)
Мне нужны эти два поля:
[code] => 4035
[description] => payment_method_id attribute can't be null