arm092 / omnipay-telcell
Omnipay支付处理库的Telcell网关
1.0.3
2022-11-11 21:11 UTC
Requires
- php: ^7.2|8.*
- moneyphp/money: ^3.1|^4.0.3
- php-http/client-implementation: ^1
- php-http/discovery: ^1.14
- php-http/message: ^1.5
- symfony/http-foundation: ^2.1|^3|^4|^5|^6
Requires (Dev)
Suggests
- league/omnipay: The default Omnipay package provides a default HTTP Adapter.
This package is auto-updated.
Last update: 2024-09-12 01:42:16 UTC
README
Omnipay Laravel支付处理库的Telcell驱动程序
Omnipay 是一个与框架无关、多网关的PHP 5.5+支付处理库。本包实现了Omnipay对Telcell的支持。
安装
Omnipay通过 Composer 安装。要安装,只需将其添加到您的 composer.json
文件中
{ "require": { "arm092/omnipay-telcell": "~1.0" } }
然后运行composer来更新您的依赖关系
composer update
或者您可以直接运行
composer require arm092/omnipay-telcell
基本用法
- 使用Omnipay网关类
use Omnipay\Omnipay;
- 初始化Telcell网关
$gateway = Omnipay::create('Telcell'); $gateway->setShopId(env('TELCELL_SHOP_ID')); $gateway->setShopKey(env('TELCELL_SHOP_KEY')); $gateway->setLanguage(\App::getLocale()); // Language $gateway->setAmount(200); // Amount to charge $gateway->setDescription(1); // Product description $gateway->setValidDays(1); // Days during which the invoice is valid $gateway->setTransactionId(XXXX); // Transaction ID from your system
- 调用购买,将自动重定向到Telcell托管页面
$purchase = $gateway->purchase()->send(); $purchase->redirect();
- 在您的
CALLBACK_URL
上创建一个webhook控制器来处理回调请求,并按以下方式捕获webhook
$gateway = Omnipay::create('Telcell'); $gateway->setShopId(env('TELCELL_SHOP_ID')); $gateway->setShopKey(env('TELCELL_SHOP_KEY')); $purchase = $gateway->completePurchase()->send(); // Do the rest with $purchase and response with 'OK' if ($purchase->isSuccessful()) { // Your logic } return new Response('OK');
有关一般使用说明,请参阅主要的 Omnipay 存储库。
支持
如果您在使用Omnipay时遇到一般问题,我们建议在 Stack Overflow 上发布。请务必添加 omnipay 标签,以便更容易找到。
如果您想了解最新发布公告,讨论项目想法或提出更详细的问题,还可以订阅一个 邮件列表。
如果您认为您已找到错误,请使用 GitHub问题跟踪器 报告它,或者更好的是,分支库并提交拉取请求。