Xcom
PHP Manual

Xcom::getLastResponse

(PECL xcommerce >= 1.0.0)

Xcom::getLastResponseGet the last response body

Description

public string Xcom::getLastResponse ( void )

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.)

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Returns a string containing the last response.

Exemples

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();

?>


Xcom
PHP Manual