This is a Algocash API
- API version: 1.0.0
PHP 5.5 and later
composer require algocashdev/algocash
Download the files and include autoload.php
:
require_once('/path/to/Algocash/vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$algo = Algocash::getInstance()
->setApiKey('merchant_key', 'merchant_secret')
->setAccessToken('api_access_token');
// ->enableProdMode(false); // default prod mode
$apiInstance = new DepositApi($algo);
$payer = new Payer("email", "phone");
$url = new Url("callback_url", "pending_url", "success_url", "error_url");
$body = new DepositRequest("invioceId", "amount", $payer, $url, "payment method");
try {
$result = $apiInstance->createDeposit($body);
print_r($result);
} catch (\Algocash\ApiException $e) {
echo 'Api Exception when calling DepositApi->createDeposit: ', json_encode($e->getError()), PHP_EOL;
} catch (\Exception $e) {
echo 'Exception when calling DepositApi->createDeposit: ', $e->getMessage(), PHP_EOL;
}
?>
<?php
$payload = @file_get_contents('php://input');
$sig_header = $_SERVER['Signature'];
try {
/**
* @var CallbackPayload body
*/
$body = \Algocash\Callback::constructCallback($payload, $sig_header, 'accessToken');
http_response_code(200);
} catch (\Algocash\SignatureVerificationException $e) {
http_response_code(401);
} catch (\Throwable $th) {
http_response_code(500);
}
?>
All URIs are relative to https://app.swaggerhub.com/apis-docs/gitdevstar/Algocash/1.0.0
Class | Method | HTTP request | Description |
---|---|---|---|
DepositApi | createDeposit | POST /payin | create a deposit |
PayoutApi | createPayout | POST /payout | create payout |