lucas-simas / php-sdk-v3
Unlimit API v3 的 PHP SDK
dev-master
2023-09-25 18:57 UTC
Requires
- php: >=5.6
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2024-09-10 15:27:17 UTC
README
Unlimit API 使用 HTTP 动词和 RESTful 端点结构。请求和响应负载以 JSON 格式进行格式化。
- API 版本:3.0
- PHP SDK 版本:3.56.0
更多信息,请访问 https://integration.cardpay.com
需求
- PHP 5.6 或更高版本
- curl、json、openssl 扩展
安装和用法
Composer
要通过 Composer 安装绑定,请将以下内容添加到 composer.json
{
"repositories": [
{
"type": "git",
"url": "https://github.com/cardpay/php-sdk-v3.git"
}
],
"require": {
"cardpay/php-sdk-v3": "*@dev"
}
}
然后运行 composer install
手动安装
下载文件,运行 composer install
并包含 autoload.php
require_once('./vendor/autoload.php');
代理使用
如果设置了 HTTPS_PROXY
或 HTTP_PROXY
环境变量,SDK 将自动使用代理。
入门指南
重要:请注意,当前实现使用临时文件存储(请参阅 FileTokensStorageApi),以保存、读取和删除(如果需要)API令牌。您可以通过实现 TokensStorageApi 接口来实现其他令牌存储(会话、数据库、Memcached、Redis 等)。
要获取API令牌,请使用 AuthApiClient。它需要API终端代码和密码,由Unlimit提供。
请按照 安装过程 进行操作,然后运行以下命令
<?php use Cardpay\api\AuthApiClient; use Cardpay\api\FileTokensStorageApi; $fileTokensStorageApi = new FileTokensStorageApi($host, $terminalCode); $authApiClient = new AuthApiClient($host, $terminalCode, $password, $fileTokensStorageApi); /** @var ApiTokens $apiTokens */ $apiTokens = $authApiClient->obtainApiTokens(); $accessToken = $apiTokens->getAccessToken(); $refreshToken = $apiTokens->getRefreshToken(); $tokenType = $apiTokens->getTokenType();
测试
打开 ./test/Config.php 并设置终端代码、密码和终端货币。
运行单元测试
composer install
./vendor/bin/phpunit --configuration ./phpunit.xml
模型文档
- ApiError
- ApiTokens
- AuthenticationCustomer
- AuthenticationData
- AuthenticationDataResponse
- AuthenticationError
- BadRequestError
- BankCardPayoutData
- BillingAddress
- CardInfoRequest
- CardInfoResponse
- ChangeSubscriptionStatusClaimResponse
- ChangedPlanData
- ClaimResponseSubscriptionData
- Confirm3dsRequest
- Device
- DisputeList
- DisputeResponse
- DisputeResponseCard
- DisputeResponseCardAccount
- DisputeResponseCustomer
- DisputeResponseDisputeData
- DisputeResponseMerchantOrder
- DisputeResponsePaymentData
- EwalletAccount
- FilingRecurringData
- FilingRequest
- FilingRequestMerchantOrder
- FilingRequestSubscriptionData
- FilterParameters
- Flight
- Flights
- InstallmentData
- InvoiceCreationDataResponse
- InvoiceCreationResponse
- InvoiceCustomer
- InvoiceData
- InvoiceGetDataResponse
- InvoiceGetResponse
- InvoiceItem
- InvoiceMerchantOrder
- InvoiceRequest
- Item
- LimitInfoResponse
- MobileTokenRequest
- MobileTokenResponse
- NextSubscriptionPayment
- NotFoundError
- OAuthError
- OneclickData
- PaymentCallback
- PaymentGatewayCreationResponse
- PaymentGatewayResponsePaymentData
- PaymentMethodsResponse
- PaymentPatchRequest
- PaymentRequest
- PaymentRequestCard
- PaymentRequestCardAccount
- PaymentRequestCryptocurrencyAccount
- PaymentRequestCustomer
- PaymentRequestEWalletAccount
- PaymentRequestLivingAddress
- PaymentRequestMerchantOrder
- PaymentRequestPaymentData
- PaymentResponse
- PaymentResponseCardAccount
- PaymentResponseCryptocurrencyAccount
- PaymentResponseCustomer
- PaymentResponsePaymentData
- PaymentUpdateResponse
- PaymentUpdateTransactionData
- PaymentsList
- PayoutCallback
- PayoutCreationResponse
- PayoutPaymentData
- PayoutRequest
- PayoutRequestCard
- PayoutRequestCardAccount
- PayoutRequestCryptocurrencyAccount
- PayoutRequestCustomer
- 支付请求电子钱包账户
- 支付请求居住地址
- 支付请求商家订单
- 支付请求支付数据
- 支付响应
- 支付响应卡账户
- 支付响应加密货币账户
- 支付响应客户
- 支付响应电子钱包账户
- 支付响应支付数据
- 支付更新请求
- 支付更新响应
- 支付列表
- Pix账户详情请求
- Pix账户详情响应
- 计划
- 计划数据列表
- 计划更新请求
- 计划更新请求计划数据
- 计划更新响应
- 周期性回调
- 周期性创建请求
- 周期性客户
- 周期性过滤参数
- 周期性网关创建响应
- 周期性网关响应周期性数据
- 周期性修补请求
- 周期性计划请求
- 周期性计划请求计划数据
- 周期性计划响应
- 周期性请求文件
- 周期性请求周期性数据
- 周期性响应
- 周期性响应文件
- 周期性响应商家订单
- 周期性响应周期性数据
- 周期性更新响应
- 周期性列表
- 重定向URL响应
- 退款回调
- 退款请求
- 退款请求客户
- 退款请求电子钱包账户
- 退款请求商家订单
- 退款请求支付数据
- 退款请求退款数据
- 退款响应
- 退款响应卡账户
- 退款响应客户
- 退款响应电子钱包账户
- 退款响应支付数据
- 退款响应退款数据
- 退款更新请求
- 退款更新响应
- 退款列表
- 重命名计划数据
- 报告
- 报告数据
- 报告请求
- 报告响应
- 请求
- 请求更新交易数据
- 响应计划数据
- 响应更新交易数据
- 返回URL
- 商家安排数据
- 安排数据
- 发货地址
- 订阅
- 订阅客户
- 订阅过滤参数
- 订阅获取响应
- 订阅获取响应计划
- 订阅列表
- 订阅更新请求
- 订阅更新请求订阅数据
- 订阅更新响应
- 支持支付方式
- 3DS安全数据
- 3DS安全响应
- 交易方法列表
- 交易请求
- 交易响应电子钱包账户
- 交易响应商家订单
- 交易更新请求
- 更新计划数据
- 更新订阅数据
- 更新订阅周期性数据
- 支付确认3DS请求
- 支付执行请求
- 支付更新请求
- 周期性确认3DS请求
- 周期性执行请求
- 周期性更新请求