razmiksaghoyan / omnipay-telcell
Omnipay支付处理库的TelCell网关
dev-master
2023-04-02 21:08 UTC
Requires
- omnipay/common: ^3
Requires (Dev)
- omnipay/tests: ^3
This package is auto-updated.
Last update: 2024-10-01 00:14:12 UTC
README
Omnipay Laravel支付处理库的TelCell驱动器
Omnipay 是一个不依赖于框架的多网关支付处理库,适用于PHP 5.5+。此包实现了Omnipay的TelCell支持。
安装
Omnipay通过 Composer 安装。要安装,只需将其添加到您的 composer.json
文件中
{ "require": { "razmiksaghoyan/omnipay-telcell": "dev" } }
然后运行Composer来更新您的依赖关系
composer update
或者您可以简单地运行
composer require razmiksaghoyan/omnipay-telcell
基本用法
- 使用Omnipay网关类
use Omnipay\Omnipay;
- 初始化TelCell网关
$gateway = Omnipay::create('Telcell'); $gateway->setShopId(env('SHOP_ID')); $gateway->setShopKey(env('SHOP_KEY')); $gateway->setSum(10); // Amount to charge $gateway->setInfo([]); // Additional information $gateway->setTransactionId(XXXX); // Transaction ID from your system
- 调用购买,将自动重定向到TelCell的托管页面
$purchase = $gateway->purchase()->send(); $purchase->redirect();
- 创建一个webhook控制器来处理您的
RETURN_URL
上的回调请求,并按以下方式捕获webhook
$gateway = Omnipay::create('Telcell'); $gateway->setShopId(env('SHOP_ID')); $gateway->setShopKey(env('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问题跟踪器 报告它,或者更好的是,分叉库并提交一个pull request。