arm092/omnipay-telcell

Omnipay支付处理库的Telcell网关

资助包维护!
barryvdh

安装: 83

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 0

分支: 242

1.0.3 2022-11-11 21:11 UTC

This package is auto-updated.

Last update: 2024-09-12 01:42:16 UTC


README

Omnipay Laravel支付处理库的Telcell驱动程序

Latest Stable Version Total Downloads

Omnipay 是一个与框架无关、多网关的PHP 5.5+支付处理库。本包实现了Omnipay对Telcell的支持。

安装

Omnipay通过 Composer 安装。要安装,只需将其添加到您的 composer.json 文件中

{
    "require": {
        "arm092/omnipay-telcell": "~1.0"
    }
}

然后运行composer来更新您的依赖关系

composer update

或者您可以直接运行

composer require arm092/omnipay-telcell

基本用法

  1. 使用Omnipay网关类
    use Omnipay\Omnipay;
  1. 初始化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
  1. 调用购买,将自动重定向到Telcell托管页面
    $purchase = $gateway->purchase()->send();
    $purchase->redirect();
  1. 在您的 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问题跟踪器 报告它,或者更好的是,分支库并提交拉取请求。