algocashdev/algocash
最新稳定版本:v1.1.0
Composer 安装命令:
composer require algocashdev/algocash
包简介
关键字:
README 文档
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
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DepositApi | createDeposit | POST /payin | create a deposit |
| PayoutApi | createPayout | POST /payout | create payout |
Documentation For Models
- Address
- Bank
- CallbackPayload
- DepositRequest
- DepositResponse
- Error
- Payer
- PayoutRequest
- PayoutResponse
- Url
Author
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2023-07-17