Skip to content

Commit

Permalink
feat(doc): update the doc
Browse files Browse the repository at this point in the history
  • Loading branch information
helei112g committed Jan 30, 2020
1 parent f1fd451 commit 068bdb8
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
**打赏名单**

名字 | 金额 | 留言
---|---|---|---
---|---|---
孝兵 | 5.00 | 谢谢,正在使用你的支付拓展包
** | 5.00 | 小哥哥,你是xxx
** | 5.00 | 正在正使用
Expand Down
91 changes: 91 additions & 0 deletions src/Gateways/CMBank/AppCharge.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php

/*
* The file is part of the payment lib.
*
* (c) Leo <dayugog@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Payment\Gateways\CMBank;

use Payment\Contracts\IGatewayRequest;
use Payment\Exceptions\GatewayException;

/**
* @package Payment\Gateways\CMBank
* @author : Leo
* @email : dayugog@gmail.com
* @date : 2020/1/30 10:38 下午
* @version : 1.0.0
* @desc : app支付
**/
class AppCharge extends CMBaseObject implements IGatewayRequest
{
const ONLINE_METHOD = 'https://netpay.cmbchina.com/netpayment/BaseHttp.dll?MB_EUserPay';

const SANDBOX_METHOD = 'http://121.15.180.66:801/NetPayment/BaseHttp.dll?MB_EUserPay';

/**
* 获取第三方返回结果
* @param array $requestParams
* @return mixed
* @throws GatewayException
*/
public function request(array $requestParams)
{
// 初始 网关地址
$this->setGatewayUrl(self::ONLINE_METHOD);
if ($this->isSandbox) {
$this->setGatewayUrl(self::SANDBOX_METHOD);
}
}

/**
* @param array $requestParams
* @return mixed
*/
protected function getRequestParams(array $requestParams)
{
$nowTime = time();
$timeExpire = $requestParams['time_expire'] ?? 0;
$timeExpire = $timeExpire - $nowTime;
if ($timeExpire < 3) {
$timeExpire = 30; // 如果设置不合法,默认改为30
}

$params = [
'dateTime' => date('YmdHis', $nowTime),
'branchNo' => self::$config->get('branch_no', ''),
'merchantNo' => self::$config->get('mch_id', ''),
'date' => date('Ymd', $requestParams['date'] ?? $nowTime),
'orderNo' => $requestParams['order_no'] ?? '',
'amount' => $requestParams['amount'] ?? '', // 固定两位小数,最大11位整数
'expireTimeSpan' => $timeExpire, // 分钟
'payNoticeUrl' => self::$config->get('notify_url', ''),
'payNoticePara' => $requestParams['return_param'] ?? '',
'clientIP' => $requestParams['client_ip'] ?? '',
'cardType' => $requestParams['limit_pay'] ?? '', // A:储蓄卡支付,即禁止信用卡支付
'subMerchantNo' => $requestParams['sub_mch_id'] ?? '', // 二级商户编码
'subMerchantName' => $requestParams['sub_mch_name'] ?? '', // 二级商户名称
'subMerchantTPCode' => $requestParams['sub_mch_tp_code'] ?? '', // 二级商户类别编码
'subMerchantTPName' => $requestParams['sub_mch_tp_name'] ?? '', // 二级商户类别名称
'payModeType' => $requestParams['mode_type'] ?? '', // 空或00:不设限制; 01:仅不允许微信支付;
'agrNo' => $requestParams['agr_no'] ?? '',
'merchantSerialNo' => $requestParams['merchant_serial_no'] ?? '',
'userID' => $requestParams['user_id'] ?? '',
'mobile' => $requestParams['mobile'] ?? '',
'lon' => $requestParams['lon'] ?? '',
'lat' => $requestParams['lat'] ?? '',
'riskLevel' => $requestParams['risk_level'] ?? '',
'signNoticeUrl' => self::$config->get('sign_notify_url', ''),
'signNoticePara' => self::$config->get('sign_return_param', ''),
//'extendInfo' => '',
//'extendInfoEncrypType' => '',
];

return $params;
}
}
17 changes: 17 additions & 0 deletions src/Gateways/CMBank/AppleCharge.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Payment\Gateways\CMBank;


/**
* @package Payment\Gateways\CMBank
* @author : Leo
* @email : dayugog@gmail.com
* @date : 2020/1/30 10:39 下午
* @version : 1.0.0
* @desc :
**/
class AppleCharge
{

}
17 changes: 17 additions & 0 deletions src/Gateways/CMBank/QrCharge.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Payment\Gateways\CMBank;


/**
* @package Payment\Gateways\CMBank
* @author : Leo
* @email : dayugog@gmail.com
* @date : 2020/1/30 10:38 下午
* @version : 1.0.0
* @desc :
**/
class QrCharge
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @desc : 一网通支付: 客户首次一网通支付时,商户必须为客户生成一网通支付协议号,招行系统将引导客户先进行绑卡签约,再完成支付。
* 非首次支付时,商户传送已签约的客户协议号,客户输入支付密码等信息后完成支付。
**/
class Charge extends CMBaseObject implements IGatewayRequest
class WapCharge extends CMBaseObject implements IGatewayRequest
{
const ONLINE_METHOD = 'https://netpay.cmbchina.com/netpayment/BaseHttp.dll?MB_EUserPay';

Expand Down
17 changes: 17 additions & 0 deletions src/Gateways/CMBank/WebCharge.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Payment\Gateways\CMBank;


/**
* @package Payment\Gateways\CMBank
* @author : Leo
* @email : dayugog@gmail.com
* @date : 2020/1/30 10:38 下午
* @version : 1.0.0
* @desc :
**/
class WebCharge
{

}

0 comments on commit 068bdb8

Please sign in to comment.