This is a APG (Ayria Payment Gateway) API SDK.
PHP 7.2 and later.
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/ayriaofficial/apg-sdk-php.git"
}
],
"require": {
"ayriaofficial/apg-sdk-php": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
<?php
require_once('/path/to/com.ayriaplatform.apg/vendor/autoload.php');
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APG-API-KEY
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('APG-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('APG-API-KEY', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\PaymentApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$apg_wallet_id = 'apg_wallet_id_example'; // string
$reference_code = 'reference_code_example'; // string | ReferenceCode of payment to return
try {
$result = $apiInstance->getPaymentByReferenceCode($apg_wallet_id, $reference_code);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PaymentApi->getPaymentByReferenceCode: ', $e->getMessage(), PHP_EOL;
}
All URIs are relative to https://api.ayriaclub.ir/apg/v1
Class | Method | HTTP request | Description |
---|---|---|---|
PaymentApi | getPaymentByReferenceCode | GET /get/{referenceCode} | Find payment with referenceCode |
PaymentApi | getPayments | GET /list | List of payments between given dates |
PaymentApi | paymentCancel | POST /cancel | Cancel a payment |
PaymentApi | paymentCreate | POST /create | Add a new payment |
PaymentApi | verifyPaymentByReferenceCode | POST /verify/{referenceCode} | Verify payment with referenceCode |
- Type: API key
- API key parameter name: APG-API-KEY
- Location: HTTP header
To run the tests, use:
composer install
vendor/bin/phpunit
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
1.2.1
- Package version:
1.2.1
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen