(PECL xcommerce >= 1.0.0)
Xcom::getLastResponse — Get the last response body
Fetch the body of the last response. Mostly useful when debugging error messages, often times the reason for a failure is documentated in the response body (ie, Invalid Token, bad HTTP method, etc.)
Cette fonction ne contient aucun paramètre.
Returns a string containing the last response.
Exemple #1 Xcom::getLastResponse() example
<?php
$data = 'foo';
$xcom = new Xcom(XCOM_FABRIC_SANDBOX, "fabric_token", "an_invalid_token");
$xcom->send("/com.x.example.v1/OrderFulfillment/OrderShipped", $data);
echo "I failed because: " . $xcom->getLastResponse();
?>