shawnley / altapay-php-api

Altapay PHP API

v1.5.4 2017-08-01 10:48 UTC

This package is not auto-updated.

Last update: 2024-09-20 20:11:03 UTC


README

通过API访问Altapay支付网关

安装

composer require lsv/altapay-php-api

或者在您的 composer.json 文件中添加它

"require": {
    "lsv/altapay-php-api": "^1.0"
}

用法

进行捕获操作时,可以使用以下内容

$auth = new \Altapay\Authentication('username', 'password' , 'myshop.gateway.com');
$api = new \Altapay\Api\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
}

更多详细信息请参阅文档

许可协议

MIT 许可协议 (MIT)

版权所有 © 2016 Martin Aarhof martin.aarhof@gmail.com

在此特此免费许可,任何人可以免费获得此软件及其相关文档副本(“软件”),不受任何限制地处理该软件,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或销售软件副本,并允许向软件提供的人这样做,前提是遵守以下条件

上述版权声明和本许可声明应包含在软件的所有副本或主要部分中。

软件按“原样”提供,不提供任何形式的保证,无论是明示的、暗示的,还是基于商业用途、特定目的或非侵权性的保证。在任何情况下,作者或版权所有者均不对任何索赔、损害或其他责任承担责任,无论这些责任是基于合同、侵权或其他原因,以及与软件或其使用或其他方式有关。