anosmx/tap-payment-laravel

Laravel 对 Tap Payment 网关 API 的包装。https://tap.company

v0.0.8 2022-01-19 17:38 UTC

This package is auto-updated.

Last update: 2024-09-21 23:17:50 UTC


README

此软件包提供了一种与 Tap Payment https://tap.company 交互的简单方式。

Laravel 兼容性

安装

使用包管理器 composer 进行安装。

composer require anosmx/tap-payment-laravel

发布配置文件。

php artisan vendor:publish --tag=tap-payment-config

可用变量

TAP_API_TOKEN={Your Tap Payment Token}
TAP_CURRENCY='SAR'
TAP_TIMEZONE='Asia/Riyadh'
TAP_RECEIPT_BY_EMAIL=false
TAP_RECEIPT_BY_SMS=false
TAP_COUNTRY_CODE='966'
TAP_POST_URL='https://'
TAP_REDIRECT_URL='https://'
TAP_LANG_CODE='ar'

用法

可用类

Authorize
Card
Charge
Customer
Invoice
Order
Product
Recurring
Refund
Subscription
Token

类用法示例

使用 Facade 访问类。

use Anosmx\TapPayment\Facades\TapCharge;

$attributes = [
    'period_date_from'  => 1516315144000,
    'period_date_to'    => 1545172744000,
    'period_type'       => 1,
    'status'            => '',
    'starting_after'    => '',
    'limit'             => 25
];

$charges = TapCharge::listCharges($attributes);

或直接

use Anosmx\TapPayment\Authorize;

$authorize = new Authorize();
$authorize->updateAuthorize($authorize_id, [
    'description'   => 'Foo',
    'receipt_email' => true,
    'receipt_sms'   => false,
    'metadata_udf2' => 'Bar'
]);

每个类的函数中都可以找到可用的属性。例如

Anosmx\TapPayment\{ClassName}

许可证

MIT 许可证 (MIT)。