You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/ MercadoPago/ Client/ Payment/ PaymentClient is not deserializeing order or order_id from the Response.
If you print $payment->getResponse()->getContent()["order"]; you will get the order data, but if you print $payment->order or $payment->order_id you will get the error: Typed property MercadoPago\Resources\Payment::$order must not be accessed before initialization
That means that the deserializeFromJson is not initializing the order and order_id properties.
As a workaround I'm doing:
$orderData = $payment->getResponse()->getContent()["order"]; // to get the order detail and
$merchant_order = $merchant_order_client->get($orderData["id"]); // to get the merchant_order
Accesing the HTTP response is not ideal, that should be handled by the SDK.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
/ MercadoPago/ Client/ Payment/ PaymentClient is not deserializeing order or order_id from the Response.
If you print $payment->getResponse()->getContent()["order"]; you will get the order data, but if you print $payment->order or $payment->order_id you will get the error:
Typed property MercadoPago\Resources\Payment::$order must not be accessed before initialization
That means that the deserializeFromJson is not initializing the order and order_id properties.
As a workaround I'm doing:
$orderData = $payment->getResponse()->getContent()["order"]; // to get the order detail and
$merchant_order = $merchant_order_client->get($orderData["id"]); // to get the merchant_order
Accesing the HTTP response is not ideal, that should be handled by the SDK.
I'm currently using the version 3.0.8.
thank you!
Beta Was this translation helpful? Give feedback.
All reactions