Fix examples
This commit is contained in:
parent
a1aa7da86d
commit
5b1e5651e7
24
README.md
24
README.md
@ -42,6 +42,12 @@ if ($response->isSuccessful()) {
|
|||||||
// or
|
// or
|
||||||
// $order = $response->getOrder();
|
// $order = $response->getOrder();
|
||||||
// $order['totalSumm'];
|
// $order['totalSumm'];
|
||||||
|
} else {
|
||||||
|
echo sprintf(
|
||||||
|
"Error of the order receipt: [Code %s] %s",
|
||||||
|
$response->getStatusCode(),
|
||||||
|
$response->getErrorMsg()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -69,9 +75,19 @@ try {
|
|||||||
echo "CRM connection error: " . $e->getMessage();
|
echo "CRM connection error: " . $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($response->isSuccessful() && 201 === $response->getStatusCode()) {
|
if ($response->isSuccessful()) {
|
||||||
echo 'Order created successfully! Order ID in CRM - ' . $response->id;
|
if (201 === $response->getStatusCode()) {
|
||||||
// or $response['id'];
|
echo 'Order created successfully! Order ID in CRM = ' . $response->id;
|
||||||
// or $response->getId();
|
// or $response['id'];
|
||||||
|
// or $response->getId();
|
||||||
|
} else {
|
||||||
|
echo 'Order updated successfully!';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo sprintf(
|
||||||
|
"Error of the order creating: [Code %s] %s",
|
||||||
|
$response->getStatusCode(),
|
||||||
|
$response->getErrorMsg()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
```
|
```
|
Loading…
Reference in New Issue
Block a user