wjminions / omnipay-migs-hosted-checkout
Omnipay支付处理库的Migs Hosted Checkout网关
1.1.1
2019-04-26 06:19 UTC
Requires
- omnipay/common: ~2.0
README
Omnipay PHP支付处理库的migs-hosted-checkout驱动器
Omnipay是一个与框架无关的多网关支付处理库,适用于PHP 5.3+。此包实现了Omnipay的migs-hosted-checkout支持。
安装
Omnipay通过Composer安装。要安装,只需将其添加到您的composer.json
文件中
{ "require": { "lokielse/omnipay-migs-hosted-checkout": "dev-master" } }
然后运行Composer以更新您的依赖项
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update
基本用法
此包提供了以下网关
用法
沙盒参数可在以下位置找到:Apple Pay开发者中心
消费
$gateway = Omnipay::create('migs-hosted-checkout_Express'); $gateway->setMerId($config['merId']); $gateway->setReturnUrl($config['returnUrl']); $gateway->setNotifyUrl($config['notifyUrl']); $order = [ 'orderId' => date('YmdHis'), //Your order ID 'txnTime' => date('YmdHis'), //Should be format 'YmdHis' 'orderDesc' => 'My order title', //Order Title 'txnAmt' => '100', //Order Total Fee ]; $response = $gateway->purchase($order)->send(); $response->getRedirectHtml(); //For PC/Wap $response->getTradeNo(); //For APP
返回/通知
$gateway = Omnipay::create('ApplePay_Apple'); $gateway->setMerId($config['merId']); $response = $gateway->completePurchase(['request_params'=>$_REQUEST])->send(); if ($response->isPaid()) { //pay success }else{ //pay fail }
查询订单状态
$response = $gateway->Omnipay::queryStatus([ 'orderId' => '20150815121214', //Your site trade no, not union tn. 'txnTime' => '20150815121214', //Order trade time 'txnAmt' => '200', //Order total fee ])->send(); var_dump($response->isSuccessful()); var_dump($response->getData());
消费撤销
$response = $gateway->consumeUndo([ 'orderId' => '20150815121214', //Your site trade no, not union tn. 'txnTime' => date('YmdHis'), //Regenerate a new time 'txnAmt' => '200', //Order total fee 'queryId' => 'xxxxxxxxx', //Order total fee ])->send(); var_dump($response->isSuccessful()); var_dump($response->getData());
退款
$response = $gateway->refund([ 'orderId' => '20150815121214', //Your site trade no, not union tn. 'txnTime' => '20150815121214', //Order trade time 'txnAmt' => '200', //Order total fee ])->send(); var_dump($response->isSuccessful()); var_dump($response->getData());
文件传输
$response = $gateway->fileTransfer([ 'txnTime' => '20150815121214', //Order trade time 'settleDate' => '0119', //Settle Date 'fileType' => '00', //File Type ])->send(); var_dump($response->isSuccessful()); var_dump($response->getData());
有关一般使用说明,请参阅主Omnipay存储库。
相关
支持
如果您在使用Omnipay时遇到一般问题,我们建议在Stack Overflow上发布。请务必添加omnipay标签,以便轻松找到。
如果您想了解发布公告,讨论项目想法或提出更详细的问题,还可以订阅邮件列表。
如果您认为您发现了错误,请使用GitHub问题跟踪器报告,或者更好的方法是分支库并提交拉取请求。