algocashdev / algocash
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
README
This is a Algocash API
- API version: 1.0.0
Requirements
PHP 5.5 and later
Installation & Usage
Composer
composer require algocashdev/algocash
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/Algocash/vendor/autoload.php');
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
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; } ?>
Callback Payload
<?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); } ?>
Documentation for API Endpoints
All URIs are relative to https://app.swaggerhub.com/apis-docs/gitdevstar/Algocash/1.0.0
Documentation For Models
- Address
- Bank
- CallbackPayload
- DepositRequest
- DepositResponse
- Error
- Payer
- PayoutRequest
- PayoutResponse
- Url