/home/kueuepay/www/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml/Style/Fill.php
<?php

namespace PhpOffice\PhpSpreadsheet\Reader\Xml\Style;

use PhpOffice\PhpSpreadsheet\Style\Fill as FillStyles;
use SimpleXMLElement;

class Fill extends StyleBase
{
    /**
     * @var array
     */
    public const FILL_MAPPINGS = [
        'fillType' => [
            'solid' => FillStyles::FILL_SOLID,
            'gray75' => FillStyles::FILL_PATTERN_DARKGRAY,
            'gray50' => FillStyles::FILL_PATTERN_MEDIUMGRAY,
            'gray25' => FillStyles::FILL_PATTERN_LIGHTGRAY,
            'gray125' => FillStyles::FILL_PATTERN_GRAY125,
            'gray0625' => FillStyles::FILL_PATTERN_GRAY0625,
            'horzstripe' => FillStyles::FILL_PATTERN_DARKHORIZONTAL, // horizontal stripe
            'vertstripe' => FillStyles::FILL_PATTERN_DARKVERTICAL, // vertical stripe
            'reversediagstripe' => FillStyles::FILL_PATTERN_DARKUP, // reverse diagonal stripe
            'diagstripe' => FillStyles::FILL_PATTERN_DARKDOWN, // diagonal stripe
            'diagcross' => FillStyles::FILL_PATTERN_DARKGRID, // diagoanl crosshatch
            'thickdiagcross' => FillStyles::FILL_PATTERN_DARKTRELLIS, // thick diagonal crosshatch
            'thinhorzstripe' => FillStyles::FILL_PATTERN_LIGHTHORIZONTAL,
            'thinvertstripe' => FillStyles::FILL_PATTERN_LIGHTVERTICAL,
            'thinreversediagstripe' => FillStyles::FILL_PATTERN_LIGHTUP,
            'thindiagstripe' => FillStyles::FILL_PATTERN_LIGHTDOWN,
            'thinhorzcross' => FillStyles::FILL_PATTERN_LIGHTGRID, // thin horizontal crosshatch
            'thindiagcross' => FillStyles::FILL_PATTERN_LIGHTTRELLIS, // thin diagonal crosshatch
        ],
    ];

    public function parseStyle(SimpleXMLElement $styleAttributes): array
    {
        $style = [];

        foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValuex) {
            $styleAttributeValue = (string) $styleAttributeValuex;
            switch ($styleAttributeKey) {
                case 'Color':
                    $style['fill']['endColor']['rgb'] = substr($styleAttributeValue, 1);
                    $style['fill']['startColor']['rgb'] = substr($styleAttributeValue, 1);

                    break;
                case 'PatternColor':
                    $style['fill']['startColor']['rgb'] = substr($styleAttributeValue, 1);

                    break;
                case 'Pattern':
                    $lcStyleAttributeValue = strtolower((string) $styleAttributeValue);
                    $style['fill']['fillType']
                        = self::FILL_MAPPINGS['fillType'][$lcStyleAttributeValue] ?? FillStyles::FILL_NONE;

                    break;
            }
        }

        return $style;
    }
}
Initiate Payment

Initiate Payment

Initiates a new payment transaction.

Endpoint: POST 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"
}