<div class="exception-summary <?= !$exceptionMessage ? 'exception-without-message' : ''; ?>">
<div class="exception-metadata">
<div class="container">
<h2 class="exception-hierarchy">
<?php foreach (array_reverse($exception->getAllPrevious(), true) as $index => $previousException) { ?>
<a href="#trace-box-<?= $index + 2; ?>"><?= $this->abbrClass($previousException->getClass()); ?></a>
<span class="icon"><?= $this->include('assets/images/chevron-right.svg'); ?></span>
<?php } ?>
<a href="#trace-box-1"><?= $this->abbrClass($exception->getClass()); ?></a>
</h2>
<h2 class="exception-http">
HTTP <?= $statusCode; ?> <small><?= $statusText; ?></small>
</h2>
</div>
</div>
<div class="exception-message-wrapper">
<div class="container">
<h1 class="break-long-words exception-message<?= mb_strlen($exceptionMessage) > 180 ? ' long' : ''; ?>"><?= $this->formatFileFromText(nl2br($exceptionMessage)); ?></h1>
<div class="exception-illustration hidden-xs-down">
<?= $this->include('assets/images/symfony-ghost.svg.php'); ?>
</div>
</div>
</div>
</div>
<div class="container">
<div class="sf-tabs">
<div class="tab">
<?php
$exceptionAsArray = $exception->toArray();
$exceptionWithUserCode = [];
$exceptionAsArrayCount = count($exceptionAsArray);
$last = $exceptionAsArrayCount - 1;
foreach ($exceptionAsArray as $i => $e) {
foreach ($e['trace'] as $trace) {
if ($trace['file'] && false === mb_strpos($trace['file'], '/vendor/') && false === mb_strpos($trace['file'], '/var/cache/') && $i < $last) {
$exceptionWithUserCode[] = $i;
}
}
}
?>
<h3 class="tab-title">
<?php if ($exceptionAsArrayCount > 1) { ?>
Exceptions <span class="badge"><?= $exceptionAsArrayCount; ?></span>
<?php } else { ?>
Exception
<?php } ?>
</h3>
<div class="tab-content">
<?php
foreach ($exceptionAsArray as $i => $e) {
echo $this->include('views/traces.html.php', [
'exception' => $e,
'index' => $i + 1,
'expand' => in_array($i, $exceptionWithUserCode, true) || ([] === $exceptionWithUserCode && 0 === $i),
]);
}
?>
</div>
</div>
<?php if ($logger) { ?>
<div class="tab <?= !$logger->getLogs() ? 'disabled' : ''; ?>">
<h3 class="tab-title">
Logs
<?php if ($logger->countErrors()) { ?><span class="badge status-error"><?= $logger->countErrors(); ?></span><?php } ?>
</h3>
<div class="tab-content">
<?php if ($logger->getLogs()) { ?>
<?= $this->include('views/logs.html.php', ['logs' => $logger->getLogs()]); ?>
<?php } else { ?>
<div class="empty">
<p>No log messages</p>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
<div class="tab">
<h3 class="tab-title">
<?php if ($exceptionAsArrayCount > 1) { ?>
Stack Traces <span class="badge"><?= $exceptionAsArrayCount; ?></span>
<?php } else { ?>
Stack Trace
<?php } ?>
</h3>
<div class="tab-content">
<?php
foreach ($exceptionAsArray as $i => $e) {
echo $this->include('views/traces_text.html.php', [
'exception' => $e,
'index' => $i + 1,
'numExceptions' => $exceptionAsArrayCount,
]);
}
?>
</div>
</div>
<?php if ($currentContent) { ?>
<div class="tab">
<h3 class="tab-title">Output content</h3>
<div class="tab-content">
<?= $currentContent; ?>
</div>
</div>
<?php } ?>
</div>
</div>
Initiates a new payment transaction.
create-order
| Parameter | Type | Details |
|---|---|---|
| amount | decimal | Your Amount , Must be rounded at 2 precision. |
| currency | string | Currency Code, Must be in Upper Case (Alpha-3 code) |
| success_url | string | Enter your return or success URL |
| cancel_url | string (optional) | Enter your cancel or failed URL |
Request Example (guzzle)
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', $base_url.'create-order', [
'headers' => [
'Authorization' => 'Bearer '. $authorizationToken,
'accept' => 'application/json',
'content-type' => 'application/json',
],
'form_params' => [
'amount' => '$amount',
'currency' => 'currency',
'success_url' => 'success_url',
'cancel_url' => 'cancel_url',
],
]);
echo $response->getBody();
**Response: SUCCESS (200 OK)**
{
"message": {
"success": [
"Order created successfully."
]
},
"data": {
"redirect_url":"https://example.com/login/OISADFDFSDFSF",
"order_details":{
"amount" : "10",
"fixed_charge" : 2,
"percent_charge" : 1,
"total_charge" : 3,
"total_payable" : 13,
"currency" : "USD",
"expiry_time": "2024-04-25T06:48:35.984285Z",
"success_url": "http://127.0.0.1/nfcpay/user/transaction/success",
"cancel_url": "http://127.0.0.1/nfcpay/user/transaction/cancel"
}
},
"type": "success"
}
**Response: ERROR (400 FAILED)**
{
"message": {
"error": [
"Invalid token."
]
},
"data": null,
"type": "error"
}