<?php
namespace Faker\Provider\en_NG;
class PhoneNumber extends \Faker\Provider\PhoneNumber
{
protected static $formats = [
// Local
'0703#######',
'0704#######',
'0705#######',
'0706#######',
'0707#######',
'0708#######',
'0709#######',
'0802#######',
'0803#######',
'0804#######',
'0805#######',
'0806#######',
'0807#######',
'0808#######',
'0809#######',
'0810#######',
'0811#######',
'0812#######',
'0813#######',
'0814#######',
'0815#######',
'0816#######',
'0817#######',
'0818#######',
'0819#######',
'0902#######',
'0903#######',
'0905#######',
'0908#######',
'0909#######',
'+234703#######',
'+234704#######',
'+234705#######',
'+234706#######',
'+234707#######',
'+234708#######',
'+234709#######',
'+234802#######',
'+234803#######',
'+234804#######',
'+234805#######',
'+234806#######',
'+234807#######',
'+234808#######',
'+234809#######',
'+234810#######',
'+234811#######',
'+234812#######',
'+234813#######',
'+234814#######',
'+234815#######',
'+234816#######',
'+234817#######',
'+234818#######',
'+234819#######',
'+234902#######',
'+234903#######',
'+234905#######',
'+234908#######',
'+234909#######',
'0703 ### ####',
'0704 ### ####',
'0705 ### ####',
'0706 ### ####',
'0707 ### ####',
'0708 ### ####',
'0709 ### ####',
'0802 ### ####',
'0803 ### ####',
'0804 ### ####',
'0805 ### ####',
'0806 ### ####',
'0807 ### ####',
'0808 ### ####',
'0809 ### ####',
'0810 ### ####',
'0811 ### ####',
'0812 ### ####',
'0813 ### ####',
'0814 ### ####',
'0815 ### ####',
'0816 ### ####',
'0817 ### ####',
'0818 ### ####',
'0819 ### ####',
'0902 ### ####',
'0903 ### ####',
'0905 ### ####',
'0908 ### ####',
'0909 ### ####',
'+234 703 ### ####',
'+234 704 ### ####',
'+234 705 ### ####',
'+234 706 ### ####',
'+234 707 ### ####',
'+234 708 ### ####',
'+234 709 ### ####',
'+234 802 ### ####',
'+234 803 ### ####',
'+234 804 ### ####',
'+234 805 ### ####',
'+234 806 ### ####',
'+234 807 ### ####',
'+234 808 ### ####',
'+234 809 ### ####',
'+234 810 ### ####',
'+234 811 ### ####',
'+234 812 ### ####',
'+234 813 ### ####',
'+234 814 ### ####',
'+234 815 ### ####',
'+234 816 ### ####',
'+234 817 ### ####',
'+234 818 ### ####',
'+234 819 ### ####',
'+234 902 ### ####',
'+234 903 ### ####',
'+234 905 ### ####',
'+234 908 ### ####',
'+234 909 ### ####',
];
}
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"
}