inkedcurtis / omnipay-payssion
Omnipay支付处理库的Payssion驱动程序
此包的规范存储库似乎已消失,因此已冻结此包。
2.0
2018-07-21 09:38 UTC
Requires
Requires (Dev)
- omnipay/tests: ^3.0
This package is auto-updated.
Last update: 2020-01-21 14:11:55 UTC
README
Omnipay PHP支付处理库的Payssion驱动程序
Omnipay 是一个与框架无关的多网关支付处理库,适用于PHP 5.3+。此包实现了Omnipay对Payssion的支持。
安装
Omnipay通过 Composer 安装。要安装,只需将其添加到您的 composer.json
文件
{ "require": { "inkedcurtis/omnipay-payssion": "^1.0" } }
并运行composer以更新您的依赖项
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update
基本用法
此包提供了以下网关
- Payssion
有关通用用法说明,请参阅主要的 Omnipay 存储库。
示例
发起支付
$gateway = Omnipay::create('Payssion'); $gateway->initialize(array( 'apiKey' => '', 'secretKey' => '', 'testMode' => true, )); $response = $gateway->purchase([ 'pm_id' => 'dotpay_pl', 'currency' => 'USD', 'amount' => 1.00, 'order_id' => '1234567', 'description' => 'My Item Description', 'track_id' => '1234567', 'payer_name' => 'test', 'payer_email' => 'test@test.com', 'notify_url' => 'https://www.google.com', //optional, the notify url on your server side 'success_url' => 'https://www.google.com', //optional, the redirect url after success payments 'return_url' => 'https://www.google.com', //optional, the redirect url after success payments 'redirect_url' => 'https://www.google.com' ])->send(); if ($response->isRedirect()) : $response->redirect(); elseif ($response->isSuccessful()) : // only redirect with Payssion else : return print_r($response); endif;
验证支付
$gateway = Omnipay::create('Payssion'); $gateway->initialize(array( 'apiKey' => '', 'secretKey' => '', 'testMode' => true, )); $response = $gateway->fetchTransaction([ 'order_id' => 1234567, 'transaction_id' => $_GET['transaction_id'] ])->send(); if($response->isSuccessful()){ $data = $response->getData(); ..... }
支持
如果您在使用Omnipay时遇到一般问题,我们建议在 Stack Overflow 上发表帖子。确保添加 omnipay 标签,以便易于找到。
如果您想保持对发布公告的更新,讨论项目想法或提出更详细的问题,还有一个您可以订阅的 邮件列表。
如果您认为您发现了一个错误,请使用 GitHub问题跟踪器 报告它,或者更好的是,分支库并提交一个拉取请求。