altapay / api-php
AltaPay:支付更简单
3.4.2
2024-08-08 06:15 UTC
Requires
- php: ^5.6 || ^7.0 || ^8.0
- ext-date: *
- ext-filter: *
- ext-mbstring: *
- ext-pcre: *
- ext-reflection: *
- ext-simplexml: *
- ext-spl: *
- guzzlehttp/guzzle: ^6.0 || ^7.0
- symfony/event-dispatcher: ^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0
- symfony/options-resolver: ^2.6 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- fzaninotto/faker: ^1.6
- phpstan/phpstan: ^1.8
- phpstan/phpstan-phpunit: *
- phpstan/phpstan-strict-rules: *
- phpunit/phpunit: ^7.0 || ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-09-18 08:11:15 UTC
README
通过API访问AltaPay支付网关
安装
composer require altapay/api-php
使用
执行捕获
操作时,可以使用以下内容
$auth = new \Altapay\Authentication('username', 'password' , 'myshop.gateway.com'); $api = new \Altapay\Api\Payments\CaptureReservation($auth); $api->setTransactionId('transaction id'); // Or you can use a transaction object you got from a previous API call // $api->setTransaction($transactionObject); try { $response = $api->call(); // If everything went perfect, you will get a \Altapay\Api\Document\Capture in the response } catch (\Altapay\Api\Exceptions\ClientException $e) { // If anything went wrong, you will get a exception where you can see the raw request and the raw response }
要求
AltaPay API PHP要求PHP 5.6.0或更高版本,并安装以下扩展
- date
- filter
- mbstring
- pcre
- Reflection
- SimpleXML
- spl
变更日志
查看变更日志以获取所有发布说明。
许可
在MIT许可下分发。更多信息请参阅LICENSE。
文档
更多信息请参阅文档。