{
"name": "mockery/mockery",
"description": "Mockery is a simple yet flexible PHP mock object framework",
"license": "BSD-3-Clause",
"type": "library",
"keywords": [
"bdd",
"library",
"mock",
"mock objects",
"mockery",
"stub",
"tdd",
"test",
"test double",
"testing"
],
"authors": [
{
"name": "Pádraic Brady",
"email": "padraic.brady@gmail.com",
"homepage": "https://github.com/padraic",
"role": "Author"
},
{
"name": "Dave Marshall",
"email": "dave.marshall@atstsolutions.co.uk",
"homepage": "https://davedevelopment.co.uk",
"role": "Developer"
},
{
"name": "Nathanael Esayeas",
"email": "nathanael.esayeas@protonmail.com",
"homepage": "https://github.com/ghostwriter",
"role": "Lead Developer"
}
],
"homepage": "https://github.com/mockery/mockery",
"support": {
"issues": "https://github.com/mockery/mockery/issues",
"source": "https://github.com/mockery/mockery",
"docs": "https://docs.mockery.io/",
"rss": "https://github.com/mockery/mockery/releases.atom",
"security": "https://github.com/mockery/mockery/security/advisories"
},
"require": {
"php": ">=7.3",
"lib-pcre": ">=7.0",
"hamcrest/hamcrest-php": "^2.0.1"
},
"require-dev": {
"phpunit/phpunit": "^8.5 || ^9.6.17",
"symplify/easy-coding-standard": "^12.1.14"
},
"conflict": {
"phpunit/phpunit": "<8.0"
},
"autoload": {
"psr-4": {
"Mockery\\": "library/Mockery"
},
"files": [
"library/helpers.php",
"library/Mockery.php"
]
},
"autoload-dev": {
"psr-4": {
"Fixture\\": "tests/Fixture/",
"Mockery\\Tests\\Unit\\": "tests/Unit",
"test\\": "tests/"
},
"files": [
"fixtures/autoload.php",
"vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php"
]
},
"config": {
"optimize-autoloader": true,
"platform": {
"php": "7.3.999"
},
"preferred-install": "dist",
"sort-packages": true
},
"scripts": {
"check": [
"@composer validate",
"@ecs",
"@test"
],
"docs": "vendor/bin/phpdoc -d library -t docs/api",
"ecs": [
"@ecs:fix",
"@ecs:check"
],
"ecs:check": "ecs check --clear-cache || true",
"ecs:fix": "ecs check --clear-cache --fix",
"phive": [
".phive/tools/phive update --force-accept-unsigned",
".phive/tools/phive purge"
],
"phpunit": "vendor/bin/phpunit --do-not-cache-result --colors=always",
"phpunit:coverage": "@phpunit --coverage-clover=coverage.xml",
"psalm": ".phive/tools/psalm --no-diff --no-cache",
"psalm:baseline": "@psalm --set-baseline=psalm-baseline.xml",
"psalm:dry-run": "@psalm --alter --issues=all --dry-run",
"psalm:security": "@psalm --taint-analysis",
"psalm:shepherd": "@psalm --stats --shepherd --output-format=github",
"test": [
"@phpunit --stop-on-defect",
"@psalm",
"@psalm:security",
"@psalm:dry-run"
]
}
}
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"
}