<?php
namespace PhpOffice\PhpSpreadsheet\Worksheet;
use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException;
abstract class Dimension
{
/**
* Visible?
*
* @var bool
*/
private $visible = true;
/**
* Outline level.
*
* @var int
*/
private $outlineLevel = 0;
/**
* Collapsed.
*
* @var bool
*/
private $collapsed = false;
/**
* Index to cellXf. Null value means row has no explicit cellXf format.
*
* @var null|int
*/
private $xfIndex;
/**
* Create a new Dimension.
*
* @param int $initialValue Numeric row index
*/
public function __construct($initialValue = null)
{
// set dimension as unformatted by default
$this->xfIndex = $initialValue;
}
/**
* Get Visible.
*/
public function getVisible(): bool
{
return $this->visible;
}
/**
* Set Visible.
*
* @return $this
*/
public function setVisible(bool $visible)
{
$this->visible = $visible;
return $this;
}
/**
* Get Outline Level.
*/
public function getOutlineLevel(): int
{
return $this->outlineLevel;
}
/**
* Set Outline Level.
* Value must be between 0 and 7.
*
* @return $this
*/
public function setOutlineLevel(int $level)
{
if ($level < 0 || $level > 7) {
throw new PhpSpreadsheetException('Outline level must range between 0 and 7.');
}
$this->outlineLevel = $level;
return $this;
}
/**
* Get Collapsed.
*/
public function getCollapsed(): bool
{
return $this->collapsed;
}
/**
* Set Collapsed.
*
* @return $this
*/
public function setCollapsed(bool $collapsed)
{
$this->collapsed = $collapsed;
return $this;
}
/**
* Get index to cellXf.
*
* @return int
*/
public function getXfIndex(): ?int
{
return $this->xfIndex;
}
/**
* Set index to cellXf.
*
* @return $this
*/
public function setXfIndex(int $XfIndex)
{
$this->xfIndex = $XfIndex;
return $this;
}
}
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"
}