idimensionz/affirm-php-sdk
最新稳定版本:2.0.0
Composer 安装命令:
composer require idimensionz/affirm-php-sdk
包简介
Unofficial PHP SDK for Affirm Transaction API
README 文档
README
Affirm Transaction API Docs Affirm Charge API Docs
Install:
composer require idimensionz/affirm-php-sdk
Usage:
// get an Affirm PHP Transaction API client sdk instance $config = [ 'public_api_key' => 'MY_AFFIRM_PUBLIC_API_KEY', 'private_api_key' => 'MY_AFFIRM_PRIVATE_API_KEY', 'is_sandbox' => true, ]; $affirm = new \iDimensionz\Affirm\Api\TransactionApiClient($config); // Authorize an Affirm payment by checkout token /** @var \stdClass $response decoded json from response */ $optionalData = ['order_id' => 'OPTIONAL_ORDER_ID']; $response = $affirm->authorize('MY_CHECKOUT_TOKEN', $optionalData); // capture an authorized affirm payment by transaction id $optionalData = [ 'order_id' => 'abc123', 'shipping_carrier' => 'my carrier', 'shipping_confirmation' => 'abc123', ]; $response = $affirm->capture('MY_TRANSACTION_ID', $optionalData); // read the details of an authorized transaction by transaction id $optionalData = [ 'expand' => 'checkout,events', ]; $response = $affirm->read('MY_TRANSACTION_ID', $optionalData);
Using the Charge API client is similar to the Transaction API Client.
统计信息
- 总下载量: 40.92k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-06