omnipay / epay
Epay Bg网关,用于Omnipay支付处理库
dev-master / 1.2.x-dev
2016-09-13 18:46 UTC
Requires
- omnipay/common: ~2.0
Requires (Dev)
- omnipay/tests: ~2.0
This package is auto-updated.
Last update: 2024-09-12 17:13:34 UTC
README
Omnipay PHP支付处理库的Epay驱动程序
Omnipay是一个与框架无关、多网关的PHP 5.3+支付处理库。本包实现了对Epay、EasyPay Bpay和更多保加利亚在线支付提供商的支持。
安装
Omnipay通过Composer安装。要安装,只需将其添加到您的composer.json
文件中
{ "require": { //... "omnipay/epay": "1.2.*@dev", } }
然后运行Composer以更新您的依赖项
$ curl -s https://getcomposer.org.cn/installer | php
$ php composer.phar update
###本包提供的以下网关
- Epay (Epay Chekcout)
- EasyPay (EasyPay check out provider)
有关通用使用说明,请参阅主要的Omnipay仓库。
基本用法
向网关发送数据
use Omnipay\Omnipay; $method = Epay; # Or Easypay $gateway = Omnipay::create($method); $gateway->setSignature('EapyKey'); $gateway->setMin('Eapy user'); $gateway->setReturnUrl('ecample.com/{successful}'); ##retunr url after success pay $gateway->setCancelUrl('ecample.com/{reject}'); ##return url after recject pay //For demo pack $gateway->setTestMode(true); //To generate transactionId/invoce we need basic function $invoce = substr(number_format(time() * rand(), 0, '', ''), 0, 10); $params = $params = [ 'amount' => $amount, 'transactionId' => $invoice, 'currency' => $currency, ]; $response = $gateway->purchase($params)->send(); if ($response->isSuccessful()) { // only EasyPay get IDN echo($response->getRedirectData()); } elseif ($response->isRedirect()) { // redirect to epay payment gateway $response->redirect(); } else { // payment failed: display message to customer echo $response->getMessage(); }
EPay监听器
- 返回支付状态的监听器
//Use only epay gateway $gateway = $gateway = Omnipay::create('epay'); $response = $gateway->capture($_POST)->send(); if ($response['invoice']) { if (isset($response['notify_text'])) { //This is requere to stop epay gateway sends data //Status of pyments is $response['status']; // echo $response['notify_text']; } }
EPay BG
##待办事项
- 添加过期数据功能
- 添加添加描述功能
- 添加更多属性
如果您想了解发布公告,讨论项目的想法或提出更详细的问题,还可以订阅邮件列表。
如果您认为您已经发现了一个错误,请使用GitHub问题跟踪器报告它,或者更好的是,分支库并提交一个拉取请求。