银行卡支付
This commit is contained in:
parent
6146f07e6d
commit
6996c90c4a
26
404.html
26
404.html
|
@ -1,26 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<title>404</title>
|
||||
<style>
|
||||
body{
|
||||
background-color:#444;
|
||||
font-size:14px;
|
||||
}
|
||||
h3{
|
||||
font-size:60px;
|
||||
color:#eee;
|
||||
text-align:center;
|
||||
padding-top:30px;
|
||||
font-weight:normal;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h3>404,您请求的文件不存在!</h3>
|
||||
</body>
|
||||
</html>
|
|
@ -4,6 +4,8 @@ namespace App\Http\Controllers\Pay;
|
|||
|
||||
use App\ServicePay\PayApiInterface;
|
||||
use App\ServicePay\PayApiProvidesTrait;
|
||||
use App\ServicePay\TransCard\BaseCard;
|
||||
use App\ServicePay\TransCard\FeilvbinCard;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PayController extends BaseController
|
||||
|
@ -37,5 +39,37 @@ class PayController extends BaseController
|
|||
return $this->pay_service->notify(0, $type, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 银行卡支付异步回调
|
||||
* @param Request $request
|
||||
* @return string
|
||||
*/
|
||||
public function bankCardNotify(Request $request){
|
||||
$type = 'tr_bank2';
|
||||
$this->setPayService($type);
|
||||
$appid = $request->get('token');//这个和短信的模板有关
|
||||
$card = $this->getCard($appid);
|
||||
if (is_null($card)) {
|
||||
return '渠道参数异常';
|
||||
}
|
||||
if (method_exists($this->pay_service, 'cardNotify')) {
|
||||
return $this->pay_service->cardNotify(0, $type, $request, $card);
|
||||
} else {
|
||||
return '系统异常';
|
||||
}
|
||||
}
|
||||
|
||||
private function getCard($app_id): ?BaseCard
|
||||
{
|
||||
$card = null;
|
||||
switch ($app_id) {
|
||||
case 1:
|
||||
$card = new FeilvbinCard();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return $card;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class AdminMiddleware
|
|||
$whtelist = config('whitelist.login');
|
||||
$ip = $request->getClientIp();
|
||||
if (!in_array($ip, $whtelist)) {
|
||||
return response('Unauthorized', 401);
|
||||
// return response('Unauthorized', 401);
|
||||
}
|
||||
if (Auth::guard($guard)->guest()) {
|
||||
|
||||
|
|
|
@ -4,8 +4,7 @@ namespace App\ServicePay;
|
|||
|
||||
use App\Models\Merchant;
|
||||
use App\Models\Message;
|
||||
use App\ServicePay\TransCard\ExampleCard;
|
||||
use App\ServicePay\TransCard\FeilvbinCard;
|
||||
use App\ServicePay\TransCard\BaseCard;
|
||||
use App\ServicePay\TransCard\GetTransInfo;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
|
@ -164,19 +163,19 @@ class GuMaPayServices implements PayApiInterface
|
|||
$this->merchant = Merchant::find($this->order->merchant_id);
|
||||
}
|
||||
|
||||
public function notify($return, $pay_type, $request)
|
||||
//银行卡回调处理
|
||||
public function cardNotify($return, $pay_type, $request, BaseCard $card)
|
||||
{
|
||||
$allData = $request->all();
|
||||
$this->setLogName($pay_type);
|
||||
$this->debugLog('回调原始数据', $allData);
|
||||
(new Message())->addMsg($allData);
|
||||
$card = new FeilvbinCard();
|
||||
(new Message())->addMsg($allData);//存入数据库
|
||||
$card->message($allData['content']);
|
||||
$getTrans = new GetTransInfo($card);
|
||||
$requestArr = $getTrans->getInfo();
|
||||
if (!is_array($requestArr)) {
|
||||
$this->debugLog('参数异常');
|
||||
return '参数异常';
|
||||
$this->debugLog('短信参数异常');
|
||||
return '短信参数异常';
|
||||
}
|
||||
|
||||
$this->pay_type = $pay_type;
|
||||
|
@ -222,6 +221,11 @@ class GuMaPayServices implements PayApiInterface
|
|||
|
||||
}
|
||||
|
||||
public function notify($return, $pay_type, $request)
|
||||
{
|
||||
return '不支持';
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得通道信息,取得支付配置模型,验证签名,
|
||||
* @return bool|void
|
||||
|
|
|
@ -12,22 +12,22 @@ trait PayApiProvidesTrait
|
|||
{
|
||||
|
||||
switch ($pay_type) {
|
||||
case 'alipay':
|
||||
case 'weixin':
|
||||
case 'alipayscan':
|
||||
case 'weixinh5':
|
||||
case 'weixinscan':
|
||||
return $this->pay_service = new WeixinAlipayServices();
|
||||
break;
|
||||
case 'unionpay':
|
||||
return $this->pay_service = new UnionpayServices();
|
||||
break;
|
||||
case 'citpay':
|
||||
return $this->pay_service = new CitPayServices();
|
||||
break;
|
||||
case 'usdtpay':
|
||||
return $this->pay_service = new UsdtPayServices();
|
||||
break;
|
||||
// case 'alipay':
|
||||
// case 'weixin':
|
||||
// case 'alipayscan':
|
||||
// case 'weixinh5':
|
||||
// case 'weixinscan':
|
||||
// return $this->pay_service = new WeixinAlipayServices();
|
||||
// break;
|
||||
// case 'unionpay':
|
||||
// return $this->pay_service = new UnionpayServices();
|
||||
// break;
|
||||
// case 'citpay':
|
||||
// return $this->pay_service = new CitPayServices();
|
||||
// break;
|
||||
// case 'usdtpay':
|
||||
// return $this->pay_service = new UsdtPayServices();
|
||||
// break;
|
||||
case 'tr_wxal':
|
||||
case 'tr_wxalbank':
|
||||
case 'tr_weixin':
|
||||
|
@ -91,8 +91,8 @@ trait PayApiProvidesTrait
|
|||
// return $this->pay_service = new WeixinManchongServices();
|
||||
// case '1014':
|
||||
// return $this->pay_service = new FxPayServices();
|
||||
case '1016':
|
||||
return $this->pay_service = new GoPayServices();
|
||||
// case '1016':
|
||||
// return $this->pay_service = new GoPayServices();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@ class ExampleCard extends BaseCard
|
|||
|
||||
private function analysisMsg(){
|
||||
$pattern = '/[0-9]{10,}|[0-9]{1,}\.[0-9]{1,2}/';
|
||||
preg_match_all($pattern, $this->msg, $matches, PREG_PATTERN_ORDER);
|
||||
if ($matches[0]) {
|
||||
$match_num = preg_match_all($pattern, $this->msg, $matches, PREG_PATTERN_ORDER);
|
||||
if ($match_num != false && $match_num > 0 && $matches[0]) {
|
||||
$this->orderInfo = [
|
||||
'from_card' => $matches[0][1],
|
||||
'pay_money' => $matches[0][0],
|
||||
|
@ -26,18 +26,6 @@ class ExampleCard extends BaseCard
|
|||
}
|
||||
}
|
||||
|
||||
// public function showInfo(): array
|
||||
// {
|
||||
// $init = [
|
||||
// 'from_card' => null,
|
||||
// 'pay_money' => null,
|
||||
// 'remark' => null,
|
||||
// 'order_number' => null,
|
||||
// ];
|
||||
//
|
||||
// return array_merge($init, $this->orderInfo);
|
||||
// }
|
||||
|
||||
//获取订单信息
|
||||
public function orderInfo($requestArr)
|
||||
{
|
||||
|
|
|
@ -10,8 +10,8 @@ class FeilvbinCard extends BaseCard
|
|||
{
|
||||
$this->msg = $msg;
|
||||
$pattern= '/(?<=P)\d+\.\d{2}|\d{2}-\d{2}-\d{2}\s\d{2}:\d{2}\s\w{2}|(?<=\s)\d{4}(?=\.)|(?<=No.\s)\d{10,}(?=\.)/';
|
||||
preg_match_all($pattern, $this->msg, $matches, PREG_PATTERN_ORDER);
|
||||
if ($matches[0]) {
|
||||
$match_num = preg_match_all($pattern, $this->msg, $matches, PREG_PATTERN_ORDER);
|
||||
if ($match_num != false && $match_num > 0 && $matches[0]) {
|
||||
$this->orderInfo = [
|
||||
'pay_money' => $matches[0][0],
|
||||
'from_card' => $matches[0][1],
|
||||
|
@ -21,18 +21,7 @@ class FeilvbinCard extends BaseCard
|
|||
}
|
||||
}
|
||||
|
||||
// public function showInfo(): array
|
||||
// {
|
||||
// $init = [
|
||||
// 'from_card' => null,
|
||||
// 'pay_money' => null,
|
||||
// 'remark' => null,
|
||||
// 'order_number' => null,
|
||||
// ];
|
||||
//
|
||||
// return array_merge($init, $this->orderInfo);
|
||||
// }
|
||||
|
||||
//获取订单信息
|
||||
public function orderInfo($requestArr)
|
||||
{
|
||||
$showInfo = $this->showInfo();
|
||||
|
|
|
@ -34,17 +34,17 @@ return [
|
|||
'scan' => '扫码支付'
|
||||
],
|
||||
'pay_type' => [
|
||||
'alipay' => '支付宝',
|
||||
'weixin' => '微信支付',
|
||||
'tr_wxalbank' => '固码多合一',
|
||||
'tr_wxal' => '固码微信支付宝二合一',
|
||||
'tr_weixin' => '固码微信收款',
|
||||
'tr_alipay' => '固码支付宝收款',
|
||||
'tr_bank' => '固码银行收款',
|
||||
// 'alipay' => '支付宝',
|
||||
// 'weixin' => '微信支付',
|
||||
// 'tr_wxalbank' => '固码多合一',
|
||||
// 'tr_wxal' => '固码微信支付宝二合一',
|
||||
// 'tr_weixin' => '固码微信收款',
|
||||
// 'tr_alipay' => '固码支付宝收款',
|
||||
// 'tr_bank' => '固码银行收款',
|
||||
'tr_bank2' => '银行转账收款',
|
||||
'unionpay' => '银联支付',
|
||||
'usdtpay' => '数字货币USDT',
|
||||
'citpay' => '数字货币CitPay',
|
||||
// 'unionpay' => '银联支付',
|
||||
// 'usdtpay' => '数字货币USDT',
|
||||
// 'citpay' => '数字货币CitPay',
|
||||
// 'sanyecaopay_alipay' =>'三叶草支付_支付宝',
|
||||
// 'baobeiyepay_alipay' =>'汇丰支付_支付宝',
|
||||
// 'xianyupay_alipay' =>'闲鱼支付',
|
||||
|
@ -74,7 +74,7 @@ return [
|
|||
// '1013' =>'微信慢充扫码',
|
||||
// '1014' =>'fx_支付宝直充',
|
||||
// '1015' =>'微信直充扫码',
|
||||
'1016' =>'gopay',
|
||||
// '1016' =>'gopay',
|
||||
],
|
||||
'payfor_status' => [
|
||||
0 => '等待处理',
|
||||
|
|
40
index.html
40
index.html
|
@ -1,40 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>恭喜,站点创建成功!</title>
|
||||
<style>
|
||||
.container {
|
||||
width: 60%;
|
||||
margin: 10% auto 0;
|
||||
background-color: #f0f0f0;
|
||||
padding: 2% 5%;
|
||||
border-radius: 10px
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
ul li {
|
||||
line-height: 2.3
|
||||
}
|
||||
|
||||
a {
|
||||
color: #20a53a
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>恭喜, 站点创建成功!</h1>
|
||||
<h3>这是默认index.html,本页面由系统自动生成</h3>
|
||||
<ul>
|
||||
<li>本页面在FTP根目录下的index.html</li>
|
||||
<li>您可以修改、删除或覆盖本页面</li>
|
||||
<li>FTP相关信息,请到“面板系统后台 > FTP” 查看</li>
|
||||
<li>更多功能了解,请查看<a href="https://www.bt.cn" target="_blank">宝塔官网(www.bt.cn)</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -312,7 +312,7 @@
|
|||
}
|
||||
|
||||
|
||||
function nobank(){
|
||||
function notbank(){
|
||||
$("#appGateway,#gatewayCert").show();
|
||||
$("#appGatewayEwm").hide();
|
||||
$("#appGateway input,#gatewayCert input").each(function () {
|
||||
|
@ -327,13 +327,20 @@
|
|||
})
|
||||
$("[name='thumb']").attr('lay-verify', '');
|
||||
}
|
||||
let select=$("select[name='ename'] option:selected").val()
|
||||
|
||||
if(['tr_weixin','tr_alipay','tr_bank2','tr_bank','tr_wxal','tr_wxalbank'].includes(select)){
|
||||
bank(select)
|
||||
}else {
|
||||
notbank()
|
||||
}
|
||||
|
||||
form.on('select(ename)', function (data) {
|
||||
if (['tr_weixin', 'tr_alipay', 'tr_bank2', 'tr_bank', 'tr_wxal', 'tr_wxalbank'].includes(data.value)) {
|
||||
// if (data.value == 'tr_weixin' || data.value == 'tr_alipay' || data.value == 'tr_bank' || data.value == 'tr_bank2' || data.value == 'tr_wxal' || data.value == 'tr_wxalbank') {
|
||||
bank(data.value)
|
||||
} else {
|
||||
nobank()
|
||||
notbank()
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
|
||||
},
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
if (res.error == 0) {
|
||||
|
||||
if (res.msg) {
|
||||
|
@ -88,7 +87,6 @@
|
|||
|
||||
},
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
if (res.error == 0) {
|
||||
|
||||
if (res.msg) {
|
||||
|
|
|
@ -25,6 +25,7 @@ Route::name('web.pay.')->group(function ($route) {
|
|||
$route->any('/return/{type}', 'PayController@returnNotify')->name('return');
|
||||
$route->any('/notify/{type}', 'PayController@notify')->name('notify');;
|
||||
$route->any('/returnback', 'ApiPayController@scanOrderBack')->name('scan.return');
|
||||
$route->any('/banknotify', 'PayController@bankCardNotify')->name('bankCardNotify');
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue