post('app_sources', ''); $order_type = $request->post('order_type'); // if (empty($order_type) || empty($appresource)){ if (empty($order_type)){ return api_error_return('参数错误'); } // 畅联H5支付宝支付 已经废了 // array_push($setting, ['is_open'=>1,'channel'=>8, 'title'=>'支付宝h5支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // 畅联A版支付宝支付 // array_push($setting, ['is_open'=>1,'channel'=>10, 'title'=>'支付宝A版支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // 实名 // if ($order_type == 2){ // //// if ($appresource != 'ios'){ //// 畅联微信支付 // array_push($setting, ['channel'=>7, 'title'=>'微信支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_wechat_pay.png']); //// } // //// if ($appresource != 'ios'){ // if ($request->uid == 7512635){ // // 支付宝原生支付 // array_push($setting, ['channel'=>2, 'title'=>'支付宝', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); //// // } // // } // 汇付支付宝支付 // array_push($setting, ['is_open'=>1,'channel'=>14, 'title'=>'支付宝支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // 无卡快捷支付 银盛直联 // array_push($setting, ['is_open'=>1,'channel'=>20, 'title'=>'无卡快捷银联支付(支持信用卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 石区支付宝支付 // array_push($setting, ['is_open'=>1,'channel'=>22, 'title'=>'支付宝支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // 商城购买 if ($order_type == 4){ // mo宝富友银联支付 // array_push($setting, ['is_open'=>1,'channel'=>9, 'title'=>'银联支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 提示苹果 无法使用无效 // 畅联D版支付宝支付 // array_push($setting, ['is_open'=>1,'channel'=>11, 'title'=>'支付宝D版支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); //// if ($appresource == 'ios'){ //// if ($request->uid == 7503399){ //// } //// } // 易票联 支付宝支付 // if (in_array($request->uid, [7493487, 7493666,7494925,7523024])){ // array_push($setting, ['is_open'=>1,'channel'=>12, 'title'=>'支付宝', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // } // array_push($setting, ['is_open'=>1,'channel'=>78, 'title'=>'支付宝', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // 畅联微信支付 // array_push($setting, ['is_open'=>1,'channel'=>7, 'title'=>'微信支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_wechat_pay.png']); // if ($appresource != 'ios'){ // if (in_array($request->uid, [7493487,7493666])){ //云闪付 // array_push($setting, ['is_open'=>1,'channel'=>13, 'title'=>'云闪付', 'icon'=>getWebUrl().'/static/img/payconfig/ysf.png']); // } // } if ($appresource == 'android'){ // 余额支付 // array_push($setting, ['is_open'=>1,'channel'=>3, 'title'=>'余额支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yue_mkjw.png']); // 石区长微信支付 // array_push($setting, ['is_open'=>1,'channel'=>17, 'title'=>'微信支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_wechat_pay.png']); // 石区支付宝支付 // array_push($setting, ['is_open'=>1,'channel'=>16, 'title'=>'支付宝支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // 石学长 银联支付 array_push($setting, ['is_open'=>1,'channel'=>15, 'title'=>'银联(协议绑卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 银联快捷 // array_push($setting, ['is_open'=>1,'channel'=>18, 'title'=>'银联快捷', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 无卡快捷支付 银盛直联 // array_push($setting, ['is_open'=>1,'channel'=>20, 'title'=>'无卡快捷银联支付(支持信用卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); } if ($appresource == 'ios'){ // 余额支付 // array_push($setting, ['is_open'=>1,'channel'=>3, 'title'=>'余额支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yue_mkjw.png']); // 石区长微信支付 // array_push($setting, ['is_open'=>1,'channel'=>17, 'title'=>'微信支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_wechat_pay.png']); // 石区支付宝支付 // array_push($setting, ['is_open'=>1,'channel'=>16, 'title'=>'支付宝支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // 石学长 银联支付 array_push($setting, ['is_open'=>1,'channel'=>15, 'title'=>'银联', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 银联快捷 // array_push($setting, ['is_open'=>1,'channel'=>18, 'title'=>'银联快捷', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 无卡快捷支付 // array_push($setting, ['is_open'=>1,'channel'=>20, 'title'=>'无卡快捷银联支付(支持信用卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); } // array_push($setting, ['is_open'=>2,'channel'=>99, 'title'=>'数字资产支付', 'icon'=>getWebUrl().'/static/img/payconfig/shuzi.png']); } // 余额充值 // { // if ($order_type == 5){ // // // if ($appresource == 'android'){ // // // 余额支付 //// array_push($setting, ['is_open'=>1,'channel'=>3, 'title'=>'余额支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yue_mkjw.png']); // // // 石区长微信支付 //// array_push($setting, ['is_open'=>1,'channel'=>17, 'title'=>'微信支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_wechat_pay.png']); // // // 石区支付宝支付 //// array_push($setting, ['is_open'=>1,'channel'=>16, 'title'=>'支付宝支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // // // 石学长 银联支付 // array_push($setting, ['is_open'=>1,'channel'=>15, 'title'=>'银联', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // // // 银联快捷 //// array_push($setting, ['is_open'=>1,'channel'=>18, 'title'=>'银联快捷', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // // // 无卡快捷支付 // array_push($setting, ['is_open'=>1,'channel'=>20, 'title'=>'无卡快捷银联支付(支持信用卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // // // usdt //// array_push($setting, ['is_open'=>1,'channel'=>19, 'title'=>'USDT转账', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // } // // if ($appresource == 'ios'){ // // // 石区支付宝支付 //// array_push($setting, ['is_open'=>1,'channel'=>16, 'title'=>'支付宝支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // // // 石学长 银联支付 // array_push($setting, ['is_open'=>1,'channel'=>15, 'title'=>'银联(协议绑卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // // // 银联快捷 首信易 //// array_push($setting, ['is_open'=>1,'channel'=>18, 'title'=>'银联快捷', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // // // 无卡快捷支付 // array_push($setting, ['is_open'=>1,'channel'=>20, 'title'=>'无卡快捷银联支付(支持信用卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // // // usdt //// array_push($setting, ['is_open'=>1,'channel'=>19, 'title'=>'USDT转账', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // // } // // // // // //// array_push($setting, ['is_open'=>2,'channel'=>99, 'title'=>'数字资产支付', 'icon'=>getWebUrl().'/static/img/payconfig/shuzi.png']); // // // } // } // 购买服务商 if ($order_type == 6){ // mo宝富友银联支付 // array_push($setting, ['is_open'=>1,'channel'=>9, 'title'=>'银联支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 提示苹果 无法使用无效 // 畅联D版支付宝支付 // array_push($setting, ['is_open'=>1,'channel'=>11, 'title'=>'支付宝D版支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); //// if ($appresource == 'ios'){ //// if ($request->uid == 7503399){ //// } //// } // 易票联 支付宝支付 // if (in_array($request->uid, [7493487, 7493666,7494925,7523024])){ // array_push($setting, ['is_open'=>1,'channel'=>12, 'title'=>'支付宝', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // } // array_push($setting, ['is_open'=>1,'channel'=>78, 'title'=>'支付宝', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // 畅联微信支付 // array_push($setting, ['is_open'=>1,'channel'=>7, 'title'=>'微信支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_wechat_pay.png']); // if ($appresource != 'ios'){ // if (in_array($request->uid, [7493487,7493666])){ //云闪付 // array_push($setting, ['is_open'=>1,'channel'=>13, 'title'=>'云闪付', 'icon'=>getWebUrl().'/static/img/payconfig/ysf.png']); // } // } // 汇付支付宝支付 // array_push($setting, ['is_open'=>1,'channel'=>14, 'title'=>'支付宝支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); if ($appresource == 'android'){ // 余额支付 // array_push($setting, ['is_open'=>1,'channel'=>3, 'title'=>'余额支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yue_mkjw.png']); // 石区长微信支付 // array_push($setting, ['is_open'=>1,'channel'=>17, 'title'=>'微信支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_wechat_pay.png']); // 石区支付宝支付 // array_push($setting, ['is_open'=>1,'channel'=>16, 'title'=>'支付宝支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // 石学长 银联支付 array_push($setting, ['is_open'=>1,'channel'=>15, 'title'=>'银联(协议绑卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 银联快捷 // array_push($setting, ['is_open'=>1,'channel'=>18, 'title'=>'银联快捷', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 无卡快捷支付 直连银盛 array_push($setting, ['is_open'=>1,'channel'=>20, 'title'=>'无卡快捷银联支付(支持信用卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); } if ($appresource == 'ios'){ // 余额支付 // array_push($setting, ['is_open'=>1,'channel'=>3, 'title'=>'余额支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yue_mkjw.png']); // 石区长微信支付 // array_push($setting, ['is_open'=>1,'channel'=>17, 'title'=>'微信支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_wechat_pay.png']); // 石区支付宝支付 // array_push($setting, ['is_open'=>1,'channel'=>16, 'title'=>'支付宝支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // 石学长 银联支付 array_push($setting, ['is_open'=>1,'channel'=>15, 'title'=>'银联(协议绑卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 银联快捷 // array_push($setting, ['is_open'=>1,'channel'=>18, 'title'=>'银联快捷', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 无卡快捷支付 array_push($setting, ['is_open'=>1,'channel'=>20, 'title'=>'无卡快捷银联支付(支持信用卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); } // array_push($setting, ['is_open'=>2,'channel'=>99, 'title'=>'数字资产支付', 'icon'=>getWebUrl().'/static/img/payconfig/shuzi.png']); } } // 支付方式配置 public function payconfig(Request $request){ $setting = []; $appresource = $request->post('app_sources', ''); $order_type = $request->post('order_type'); // if (empty($order_type) || empty($appresource)){ if (empty($order_type)){ return api_error_return('参数错误'); } // 石区支付宝支付 array_push($setting, ['is_open'=>1,'channel'=>22, 'title'=>'支付宝支付', 'icon'=>getWebUrl().'/static/img/payconfig/ic_zhifubao.png']); // 商城购买 if ($order_type == 4){ if ($appresource == 'android'){ // 石学长 银联支付 array_push($setting, ['is_open'=>1,'channel'=>15, 'title'=>'银联(协议绑卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); } if ($appresource == 'ios'){ // 石学长 银联支付 array_push($setting, ['is_open'=>1,'channel'=>15, 'title'=>'银联', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); } } // 购买服务商 if ($order_type == 6){ if ($appresource == 'android'){ // 石学长 银联支付 array_push($setting, ['is_open'=>1,'channel'=>15, 'title'=>'银联(协议绑卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 无卡快捷支付 直连银盛 // array_push($setting, ['is_open'=>1,'channel'=>20, 'title'=>'无卡快捷银联支付(支持信用卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); } if ($appresource == 'ios'){ // 石学长 银联支付 array_push($setting, ['is_open'=>1,'channel'=>15, 'title'=>'银联(协议绑卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); // 无卡快捷支付 // array_push($setting, ['is_open'=>1,'channel'=>20, 'title'=>'无卡快捷银联支付(支持信用卡)', 'icon'=>getWebUrl().'/static/img/payconfig/ic_yinlian_pay.png']); } // array_push($setting, ['is_open'=>2,'channel'=>99, 'title'=>'数字资产支付', 'icon'=>getWebUrl().'/static/img/payconfig/shuzi.png']); } // 余额支付 return api_succ_return(['msg'=>'成功', 'data'=>['setting'=>$setting]]); } // 生成支付订单 public function paymentInfo(Request $request) { // 这是测试 上线要干掉 // return api_error_return('暂未开放'); $post = $request->post(); $user = $request->user_info; $curandroid = env('app.CUR_ANDROID_VERSION', ''); $curios = env('app.CUR_IOS_VERSION', '');; $curAndroidVersion = str_replace('.', '', $curandroid); $curAndroidVersion = dispRepair($curAndroidVersion, 4, '0', '0'); $curIosVersion = str_replace('.', '', $curios); $curIosVersion = dispRepair($curIosVersion, 4, '0', '0'); $app_sources = $request->param('app_sources'); $app_version = $request->param('app_version'); $app_version = str_replace('.', '', $app_version); $app_version = dispRepair($app_version, 4, '0', '0'); if ($app_sources == 'ios'){ if ($curIosVersion > $app_version){ return api_error_return('app版本号过低,请更新'); } } if ($app_sources == 'android'){ if ($curAndroidVersion > $app_version){ return api_error_return('app版本号过低,请更新'); } } if (empty($app_sources) || empty($app_version)){ if ($curAndroidVersion > $app_version){ return api_error_return('app版本号过低,请更新'); } } if ($post['order_type'] == 6){ if ($user['store_type'] == 1){ return api_error_return('已是服务商,无需再次开通'); } } try { $channel = $request->data['channel']; // 支付方式 1 支付宝支付 2 微信支付 3 余额 4 线下 // if (!in_array($channel, [2, 5, 6, 7, 8, 9, 10, 11, 12, 78])) { if (!in_array($channel, [14, 15, 20, 22])) { return api_error_return('支付类型错误'); } $order_type = $request->data['order_type']; // 订单类型 // if (!in_array($order_type, [2, 4])) { // return api_error_return('订单类型错误'); // } // if (intval($order_type) == 4){ // if (!in_array(intval($channel), $pay_timearr)){ // return api_error_return('订单类型错误'); // } // } if ($post['order_type'] == 4) { if (empty($post['order_id'])) { return api_error_return('参数错误'); } $m_order = new ShopOrderModel(); $orderinfo = $m_order->where('order_sn', $post['order_id'])->find(); if ($orderinfo['status'] != 0) { return api_error_return('状态错误'); } $count = Db::name('payment')->where('uid', $request->uid)->where('order_type', 4)->where('state', 7)->whereTime('creat_at', '-2 hours')->count('id'); // 这是测试 线要干掉 if ($count > 20){ return api_error_return('未支付订单过多'); } } // if (strpos($request->user['path'], '5344240') || intval($request->user['id']) == 5344240){ // return api_error_return('失败,请联系客服'); // } switch ($channel) { case 1: return WxPayServices::instance()->userId($request->uid)->data($request->data)->getUnifiedOrder(); break; case 2: // 支付宝支付 $result = AliPayServices::instance()->uid($request->uid)->data($request->data)->getUnifiedOrder(); break; case 3: getActionSecury($request->uid, $request->post('security_pass', '')); $ser = new \app\api\services\BalancePayServices(); $ser->balanceToOrder($request->uid, $request->post('order_id', '')); $result = api_succ_return(['msg'=>'成功', 'data'=>[]]); break; // case 4: //// return OfflinePayServices::instance()->uid($request->uid)->data($request->data)->getUnifiedOrder(); // break; // case 5: // // 多乐宝贝 支付支付 // { // $pay = new ThirdPayServices(); // $result = $pay->getPayInfo($request->uid, $request->data); // } // break; // case 6: //// 第三方支付 微信支付 //// 多乐宝 微信支付 // { // $pay = new ThirdPayServices(); // $result = $pay->getWxPayInfo($request->uid, $request->data); // } // break; // case 7: //// 第三方支付 畅联 微信支付 // { // $pay = new ThirdPayServices(); // $result = $pay->getWxPayInfoCL($request->uid, $request->data); // } // break; // case 8: //// 第三方支付 畅联 支付宝支付 // { // $pay = new ThirdPayServices(); // $result = $pay->getAliPayInfoCL($request->uid, $request->data, 'h5ban'); // } // break; // case 9: //// 第三方支付 mo宝 富有 银联支付 // { // $pay = new ThirdPayServices(); // $params = $request->data; // $params['app_sources'] = $request->post('app_sources', 'ios'); // $result = $pay->getBankPayInfoFY($request->uid, $params); // // } // break; // case 10: //// 第三方支付 畅联 A版支付宝支付 // { // $pay = new ThirdPayServices(); // $result = $pay->getAliPayInfoCL($request->uid, $request->data, 'aban'); // } // break; // case 11: //// 第三方支付 畅联 D版支付宝支付 // { // $pay = new ThirdPayServices(); // $result = $pay->getAliPayInfoCL($request->uid, $request->data, 'dban'); // } // break; // case 12: //// 第三方支付 易票联支付宝支付 // { // $pay = new ThirdPayServices(); // $result = $pay->getZfbPayInfoYPL($request->uid, $request->data); // } // break; // case 13: //// 第三方支付 易票联云闪付 // { // sr_throw('支付失败'); // $pay = new ThirdPayServices(); // $result = $pay->getYsfPayInfoYPL($request->uid, $request->data); // } // break; case 14: //// 第三方支付 汇付支付支付 { $pay = new ThirdPayServices(); $result = $pay->getHfPayInfoHF($request->uid, $request->data); } break; case 15: // 第三方支付 石区长 { $pay = new ThirdPayServices(); $result = $pay->getPayInfoSQZ($request->uid, $request->data); } break; case 16: // 第三方支付 支付宝 石区长 { $pay = new ThirdPayServices(); $result = $pay->getPayInfoSQZAlipay($request->uid, $request->data); } break; case 17: // 第三方支付 微信 石区长 { $pay = new ThirdPayServices(); $result = $pay->getPayInfoSQZWechat($request->uid, $request->data); } break; case 18: // 第三方支付 银联快捷 石区长 首信易 { $pay = new ThirdPayServices(); $result = $pay->getPayInfoSQZBankkuai($request->uid, $request->data); } break; case 19: // 第三方支付 usdt充值 { $pay = new ThirdPayServices(); $result = $pay->getPayInfoUsdt($request->uid, $request->data); } break; case 20: // 直连银盛 无卡快捷 { $pay = new ThirdPayServices(); $result = $pay->getPayInfoYSwk($request->uid, $request->data); // $result = $pay->kjPayWithCode($request->uid, $request->data); } break; case 22: // 支付宝 电科科技支付 { $pay = new ThirdPayServices(); $result = $pay->getPayInfoDiankeZfb($request->uid, $request->data); // $result = $pay->kjPayWithCode($request->uid, $request->data); } break; case 56: // 第三方支付 易票联统一支付 { $pay = new ThirdPayServices(); $result = $pay->getYsfPayInfoTY($request->uid, $request->data); } break; } // if (intval($channel) > 55){ // $pay = new ThirdPayServices(); // $result = $pay->getZfbPayInfoYPL($request->uid, $request->data); // } } catch (Exception $e) { // sr_log('payment'. $e->getMessage()); return api_error_return($e->getMessage()); } return $result; } public function zlysSurePay(Request $request){ $post = $request->post(); if (empty($post['trade_no']) || empty($post['sms_code'])){ return api_error_return('参数错误'); } Db::startTrans(); try { $ser = new ThirdPayServices(); $res = $ser->kjPayWithCode($post['trade_no'], $post['sms_code']); Db::commit(); }catch (\Exception $e){ Db::rollback(); return api_error_return($e->getMessage()); } return $res; } // 直连银盛 银行卡列表 public function zlysBankList(Request $request){ $where = array(); $post = $request->post(); $keyword = $post['keyword']; if (!empty($keyword)){ $where[] = ['bank_name|bank_sub', 'like', "%{$keyword}%"]; } $where[] = ['status', '=', "1"]; $list = Db::name('ys_banklist')->where($where)->page($post['page'], $post['limit'])->order('id asc')->select()->toArray(); return api_succ_return(['msg'=>'成功', 'data'=>$list]); } public function zlysBankPayWay(Request $request){ return api_succ_return(['msg'=>'成功', 'data'=>[ ['bank_name'=>'工商银行','xiane'=>'单笔1万、单日1万、单月5万' ,'jieji'=>'是','xinyong'=>'是'], ['bank_name'=>'中国银行','xiane'=>'单笔5万,单日5万' ,'jieji'=>'否','xinyong'=>'是'], ['bank_name'=>'建设银行','xiane'=>'单笔1万、单日1万、单月5万' ,'jieji'=>'是','xinyong'=>'是'], ['bank_name'=>'招商银行','xiane'=>'单笔5万,单日5万' ,'jieji'=>'否','xinyong'=>'是'], ['bank_name'=>'光大银行','xiane'=>'单笔0.5万、单日5万 ' ,'jieji'=>'是','xinyong'=>'是'], ['bank_name'=>'民生银行','xiane'=>'2万/2万' ,'jieji'=>'是','xinyong'=>'是'], ['bank_name'=>'浦发银行','xiane'=>'借单笔/日2万、贷单笔/日1万、月不限' ,'jieji'=>'是','xinyong'=>'是'], ['bank_name'=>'平安银行','xiane'=>'单笔5万、单日5万、月不限' ,'jieji'=>'是','xinyong'=>'否'], ['bank_name'=>'广发银行','xiane'=>'贷记卡(单笔3w,单日3w)、借记卡(单笔2w,单日2w)' ,'jieji'=>'是','xinyong'=>'是'], ['bank_name'=>'中信银行','xiane'=>'单笔5万、日/月不限' ,'jieji'=>'是','xinyong'=>'是'], ['bank_name'=>'交通银行','xiane'=>'单笔2万,单日2万,单月5万' ,'jieji'=>'否','xinyong'=>'是'], ['bank_name'=>'渤海银行','xiane'=>'借单笔3w,单日3w;贷单笔2w,单日2w' ,'jieji'=>'是','xinyong'=>'是'], ['bank_name'=>'上海银行','xiane'=>'借单笔1w单日1万;贷单笔2w,日不限' ,'jieji'=>'是','xinyong'=>'是'], ['bank_name'=>'华夏银行','xiane'=>'日累计2万,月累计60万' ,'jieji'=>'是','xinyong'=>'否'], ['bank_name'=>'邮储银行','xiane'=>'借记卡:无限额,以发卡测为准;贷记卡:单笔2万、单日2万','jieji'=>'是','xinyong'=>'是'], ['bank_name'=>'浙商银行','xiane'=>'单笔2万、单日2万' ,'jieji'=>'是','xinyong'=>'是'], ['bank_name'=>'区域银行','xiane'=>'无' ,'jieji'=>'是','xinyong'=>'是']] ]); } /** * 支付宝支付回调 * @param Request $request * @return mixed */ public function aliResult(Request $request) { // sr_log(json_encode($request->param())); return AliPayServices::instance()->data($request->param())->getNotifyInfo()->afterPay(); } /** * 支付宝支付回调 多来贝 * @param Request $request * @return mixed */ public function aliResultDLB(Request $request){ sr_log('----------------------支付三方回调-------------------------'); sr_log($request); sr_log($request->param()); sr_log('----------------------支付三方回调-------------------------'); // DLB1649854201945040279940469OP $result = [ 'order_id' => 'DLB1649854201945040279940469OP' ]; // 897d9ea909093173b24dd89c772181e4 // if (!$result || !$result->sign){ // echo 'success'; // die(); // } // $sign = thirdPayGetSign($result, '897d9ea909093173b24dd89c772181e4'); // if ($result['sign'] != $sign){ // echo 'success'; // die(); // } $pay_info= Db::name('payment')->where('out_trade_no', $result['order_id'])->find(); if (!$pay_info){ echo 'success'; die(); }else{ if ($pay_info['state'] != 7){ echo 'success'; die(); } Db::startTrans(); try { Db::name('payment')->where('id', $pay_info['id'])->update(['state' => 6, 'pay_at' => date('Y-m-d H:i:s')]); // 更改订单状态 switch ($pay_info['order_type']) { case 1: // 充值 break; case 3: // 充值会员 // break; case 4: //购买商品 // $order = Order::where(['order_sn' => explode(',', $pay_info['remarks'])])->select()->toArray(); // Order::payDoneOrderCallback($order, 3, $pay_info['uid']); $m_goods = new ShopGoodsModel(); $m_user = new UserModel(); $m_shoporder = new ShopOrderModel(); // 更改订单状态 $order = ShopOrderModel::where('order_sn', $pay_info['remarks'])->find(); $nowTime = date('Y-m-d H:i:s', time()); Db::name('shop_order')->where(['order_sn' => $pay_info['remarks']]) ->update(['pay_type' => 2, 'status' => 1, 'updated_time' => $nowTime]); // 增加销量 $orderGoods = OrderGoods::where(['order_id' => $order['order_id']])->select()->toArray(); foreach ($orderGoods as $k => $v) { ShopGoodsModel::where(['goods_id' => $v['goods_id']])->inc('sales_volume', $v['num'])->inc('real_sales_volume', $v['num'])->update(); } // 送积分 edit_user_score(5, $order['user_id'], $order['rebate_score']); edit_user_redscore(1, $order['user_id'], $order['rebate_lock_score']); break; } Db::commit(); echo 'success'; die; } catch (\Exception $e) { Db::rollback(); echo 'failure'; die; } } echo 'success'; die(); } /** * 微信支付回调 多来贝 * @param Request $request * @return mixed */ public function wechatResultDLB(Request $request){ sr_log('----------------------支付三方回调-------------------------'); sr_log(json_encode($request->param())); sr_log('----------------------支付三方回调-------------------------'); $result = $request->param(); // {"body":"\u8d2d\u4e70\u5546\u54c1","order_no":"DLB1649940431291160101494681OP","external_order_no":"35054704392204140847101649940430","channel_order_no":"22041420471399027444900","total_amount":"0.01","pay_amount":"0.01","status":"1","note":"","pay_time":"1649940443","sign":"A836A4214BE26C145DF55C0F1F1ACDAB"} // { // "body": "购买商品", // "order_no": "DLB1649939394489656266205439OP", // "external_order_no": "55936444392204140829541649939394", // "channel_order_no": "22041420300550260054535", // "total_amount": "0.01", // "pay_amount": "0.01", // "status": "1", // "note": "", // "pay_time": "1649939414", // "sign": "7614744071B389F19388E681DD02A353" // } // 897d9ea909093173b24dd89c772181e4 // sr_log('开始回调'); try { if (!$result || !$result['sign']){ sr_log('11111'); echo 'success'; die(); } $sign = thirdPayGetSign($result, '897d9ea909093173b24dd89c772181e4'); if ($result['sign'] != $sign){ sr_log('222222'); echo 'success'; die(); } if ($result['status'] != 1){ sr_log('33333333'); echo 'success'; die(); } }catch (Exception $e){ echo 'success'; sr_log('aaa'.$e->getMessage()); die(); } $pay_info= Db::name('payment')->where('out_trade_no', $result['order_no'])->find(); if (!$pay_info){ sr_log('333333333'); echo 'success'; die(); }else{ if ($pay_info['state'] != 7){ sr_log('8888'.'已经处理过了'); echo 'success'; die(); } if ($result['total_amount'] < $pay_info['total_fee']){ sr_testDb(json_encode($pay_info), 1); sr_log('9999'.'支付金额错误'); echo 'success'; die(); } Db::startTrans(); try { Db::name('payment')->where('id', $pay_info['id'])->update(['state' => 6, 'pay_at' => date('Y-m-d H:i:s')]); // 更改订单状态 switch ($pay_info['order_type']) { case 1: // 充值 break; case 3: // 充值会员 // break; case 4: //购买商品 // $order = Order::where(['order_sn' => explode(',', $pay_info['remarks'])])->select()->toArray(); // Order::payDoneOrderCallback($order, 3, $pay_info['uid']); $m_goods = new ShopGoodsModel(); $m_user = new UserModel(); $m_shoporder = new ShopOrderModel(); // 更改订单状态 $order = ShopOrderModel::where('order_sn', $pay_info['remarks'])->find(); $nowTime = date('Y-m-d H:i:s', time()); Db::name('shop_order')->where(['order_sn' => $pay_info['remarks']]) ->update(['pay_type' => 2, 'status' => 1, 'updated_time' => $nowTime]); // 增加销量 $orderGoods = OrderGoods::where(['order_id' => $order['order_id']])->select()->toArray(); foreach ($orderGoods as $k => $v) { ShopGoodsModel::where(['goods_id' => $v['goods_id']])->inc('sales_volume', $v['num'])->inc('real_sales_volume', $v['num'])->update(); } // 送积分 edit_user_score(5, $order['user_id'], $order['rebate_score']); edit_user_redscore(1, $order['user_id'], $order['rebate_lock_score']); break; } Db::commit(); echo 'success'; die; } catch (\Exception $e) { Db::rollback(); echo 'failure'; sr_log('微信多乐宝报错:'. $e->getMessage()); die; } } echo 'success'; die(); } /** * 微信支付回调 畅联 * @param Request $request * @return mixed */ public function wechatResultCL(Request $request){ sr_log('----------------------支付三方回调-------------------------'); sr_log(json_encode($request->param())); sr_log('----------------------支付三方回调-------------------------'); $result = $request->param(); // { // "callbacks": "CODE_SUCCESS", // "appid": "1059174", // "pay_type": "wechat", // "success_url": "http:\/\/www.baidu.com", // "error_url": "http:\/\/www.baidu.com", // "out_trade_no": "90898975872204150713401650021220", // "amount": "0.02", // "sign": "3F63CCE3522D487BEEDBDCA97B306C86" //} // "amount": "609", try { if (!$result || !$result['sign']){ sr_log('cl11111'); echo 'success'; die(); } $sign = thirdPayCheckSignCL($result, 'XMLfjHMPOGexsSaadIWSVCNG0XJBClZZ'); if ($result['sign'] != $sign){ sr_log('cl222222'); echo 'success'; die(); } if ($result['callbacks'] != 'CODE_SUCCESS'){ sr_log('cl33333333'); echo 'success'; die(); } }catch (Exception $e){ echo 'success'; sr_log('claaa'.$e->getMessage()); die(); } $pay_info= Db::name('payment')->where('out_trade_no', $result['out_trade_no'])->find(); if (!$pay_info){ sr_log('cl333333333'); echo 'success'; die(); }else{ if ($pay_info['state'] != 7){ sr_log('cl8888'.'已经处理过了'); echo 'success'; die(); } if ($result['amount'] < $pay_info['total_fee']){ sr_testDb(json_encode($pay_info), 1); sr_log('cl9999'.'支付金额错误'); echo 'success'; die(); } Db::startTrans(); try { $pay_info= Db::name('payment')->where('out_trade_no', $result['out_trade_no'])->lock(true)->find(); Db::name("thirdpay_back")->insert([ 'out_order_no'=>$result['out_trade_no'], 'content'=>json_encode($result), 'create_time'=>sr_getcurtime(time()), 'type'=>1, 'uid'=>$pay_info['uid'] ]); if (empty($pay_info)) { throw new Exception('畅联并发了'); } Db::name('payment')->where('id', $pay_info['id'])->update(['state' => 6, 'pay_at' => date('Y-m-d H:i:s')]); // 更改订单状态 switch ($pay_info['order_type']) { case 1: // 充值 break; case 3: // 充值会员 // break; case 4: //购买商品 // $order = Order::where(['order_sn' => explode(',', $pay_info['remarks'])])->select()->toArray(); // Order::payDoneOrderCallback($order, 3, $pay_info['uid']); $m_goods = new ShopGoodsModel(); $m_user = new UserModel(); $m_shoporder = new ShopOrderModel(); // 更改订单状态 $order = ShopOrderModel::where('order_sn', $pay_info['remarks'])->find(); $nowTime = date('Y-m-d H:i:s', time()); Db::name('shop_order')->where(['order_sn' => $pay_info['remarks']]) ->update(['status' => 1, 'pay_type'=>7,'updated_time' => $nowTime]); // 增加销量 $orderGoods = OrderGoods::where(['order_id' => $order['order_id']])->select()->toArray(); foreach ($orderGoods as $k => $v) { ShopGoodsModel::where(['goods_id' => $v['goods_id']])->inc('sales_volume', $v['num'])->inc('real_sales_volume', $v['num'])->update(); } $user = $m_user->where('id', $pay_info['uid'])->find(); // if ($user['pid'] > 0){ // if (Db::name('user')->where('id', $user['pid'])->where('is_auth', 1)->find()){ // edit_user_score(15, $user['pid'], number_format($pay_info['total_fee']/100, 4, '.', '')); // } // // } // 送积分 edit_user_score(5, $order['user_id'], $order['rebate_score']); edit_user_redscore(1, $order['user_id'], $order['rebate_lock_score']); break; } Db::commit(); } catch (\Exception $e) { Db::rollback(); sr_log('cl微信报错:'. $e->getMessage()); echo 'failure'; die; } echo 'success'; die(); } echo 'success'; die(); } /** * 支付宝支付回调 畅联 * @param Request $request * @return mixed */ public function AliResultCL(Request $request){ sr_log('----------------------支付三方回调-------------------------'); sr_log(json_encode($request->param())); sr_log('----------------------支付三方回调-------------------------'); $result = $request->param(); // { // "callbacks": "CODE_SUCCESS", // "appid": "1059174", // "pay_type": "wechat", // "success_url": "http:\/\/www.baidu.com", // "error_url": "http:\/\/www.baidu.com", // "out_trade_no": "90898975872204150713401650021220", // "amount": "0.02", // "sign": "3F63CCE3522D487BEEDBDCA97B306C86" //} // "amount": "609", // try { // if (!$result || !$result['sign']){ // sr_log('cl11111'); // echo 'success'; // die(); // } // $sign = thirdPayCheckSignCL($result, 'XMLfjHMPOGexsSaadIWSVCNG0XJBClZZ'); // if ($result['sign'] != $sign){ // sr_log('cl222222'); // echo 'success'; // die(); // } // // if ($result['callbacks'] != 'CODE_SUCCESS'){ // sr_log('cl33333333'); // echo 'success'; // die(); // } // // }catch (Exception $e){ // echo 'success'; // sr_log('claaa'.$e->getMessage()); // die(); // } $pay_info= Db::name('payment')->where('out_trade_no', $result['out_trade_no'])->find(); if (!$pay_info){ sr_log('cl333333333'); echo 'success'; die(); }else{ if ($pay_info['state'] != 7){ sr_log('cl8888'.'已经处理过了'); echo 'success'; die(); } if ($result['amount'] < $pay_info['total_fee']){ sr_testDb(json_encode($pay_info), 1); sr_log('cl9999'.'支付金额错误'); echo 'success'; die(); } $key = 'api'.$request->pathinfo().$result['out_trade_no']; Db::startTrans(); try { redisLock($key); $pay_info= Db::name('payment')->where('out_trade_no', $result['out_trade_no'])->lock(true)->find(); Db::name("thirdpay_back")->insert([ 'out_order_no'=>$result['out_trade_no'], 'content'=>json_encode($result), 'create_time'=>sr_getcurtime(time()), 'type'=>1, 'uid'=>$pay_info['uid'] ]); if (empty($pay_info)) { throw new Exception('畅联支付宝并发了'); } Db::name('payment')->where('id', $pay_info['id'])->update(['state' => 6, 'pay_at' => date('Y-m-d H:i:s')]); // 更改订单状态 switch ($pay_info['order_type']) { case 1: // 充值 break; case 3: // 充值会员 // break; case 4: //购买商品 // $order = Order::where(['order_sn' => explode(',', $pay_info['remarks'])])->select()->toArray(); // Order::payDoneOrderCallback($order, 3, $pay_info['uid']); $m_goods = new ShopGoodsModel(); $m_user = new UserModel(); $m_shoporder = new ShopOrderModel(); // 更改订单状态 $order = ShopOrderModel::where('order_sn', $pay_info['remarks'])->find(); $nowTime = date('Y-m-d H:i:s', time()); Db::name('shop_order')->where(['order_sn' => $pay_info['remarks']]) ->update(['status' => 1, 'pay_type'=>8,'updated_time' => $nowTime]); // 增加销量 $orderGoods = OrderGoods::where(['order_id' => $order['order_id']])->select()->toArray(); foreach ($orderGoods as $k => $v) { ShopGoodsModel::where(['goods_id' => $v['goods_id']])->inc('sales_volume', $v['num'])->inc('real_sales_volume', $v['num'])->update(); } $user = $m_user->where('id', $pay_info['uid'])->find(); // if ($user['pid'] > 0){ // if (Db::name('user')->where('id', $user['pid'])->where('is_auth', 1)->find()){ // edit_user_score(15, $user['pid'], number_format($pay_info['total_fee']/100, 4, '.', '')); // } // // } // 送积分 edit_user_score(5, $order['user_id'], $order['rebate_score']); edit_user_redscore(1, $order['user_id'], $order['rebate_lock_score']); break; } Db::commit(); } catch (\Exception $e) { Db::rollback(); if ($e->getCode() != apiPingFanCode()){ redisFree($key); } sr_log('cl支付宝报错:'. $e->getMessage()); echo 'failure'; die; } redisFree($key); echo 'success'; die(); } echo 'success'; die(); } /** * mo宝银联回调 富友 * @param Request $request * @return mixed */ public function BankResultFY(Request $request){ $res = file_get_contents('php://input'); sr_log('----------------------支付三方富有回调-------------------------'); sr_log($res); sr_log('----------------------支付三方富有回调-------------------------'); // $res = '{"mchnt_cd":"0002900F0096235","message":"Y+s9Pef1211xf3Ibyn+OWwgJPT6byY+8KNlelvpVdiA2FdIAQdaxsZcD0zz/NIt4pQDh0ogyRSh6XlG89XFH6v+YdJe3wMZlbFK//dVHZdpk/jaRbt8dKxIv6ViS/EtQldRKWHQqcrmG8/CHTPweM5+K4GUMmaqRuqYD3+6qFTT7Mt2teDgYkPhPc55epXvrYxJXKEX5tyAyPogDM+Yi6uEXWntMJHaqjM1hIv8/1EfLceCDeNzc8GAM/EllWjUeUoUMvPQ7X3Ay0itv2wS96THh4Iwxk60LWhek+lZaG2EY2spVJmMNSktt/htqwf/LtBpm9FBiJDuJTuOWD4lHqazEHUnwA1kDsLtTSKqqiLJiesanXs5nQ7h3f0Nmu94qCP9vIvm9ZWSXwehPB7kRXp5vWgcjXMzWlNWbHJmLt0myHl/6EesMMAHRCS+Le3o1JVExgFDccI1jcpwUll6GqCmT7G1qRilt30LOhHhDk9IPJRdiRJvqcWP003GLUt9E6Z+PSHuJlCILVWZVlaAVh4Bl2sMCd84exiJVCXZPaXDaCoMHmbbMtaKaWCWn4El6HlC5tONZpdNX5OkDN0FZxxBrDvPr0M3BZgQhHmvQRfPjzLYV3BgT8iIwlT6G2x/lv/7jbk/7JhPRGLtZ09UCuFu3r1hB3pRVXVm/yMaNlZQ=","resp_code":"0000","resp_desc":"交易成功"}'; $result = json_decode($res); if (isset($result->mchnt_cd) && isset($result->message) && isset($result->resp_code) && isset($result->resp_desc)) { if ($result->resp_code == 0000) { $res_decode = json_decode(RSA_openssl($result->message, 'decode')); if (isset($res_decode->order_st) && $res_decode->order_st == 1) { $out_trade_no = 'FYYL' . $res_decode->order_id; $pay_info = Db::name('payment')->where('out_trade_no', $out_trade_no)->find(); if ($pay_info) { if ($pay_info['state'] == 7) { if ($res_decode->order_amt < bcmul($pay_info['total_fee'], 100, 0)) { echo 'success'; die(); } $key = 'api'.$request->pathinfo().$out_trade_no; Db::startTrans(); try { redisLock($key); $pay_info = Db::name('payment')->where('out_trade_no', $out_trade_no)->lock(true)->find(); Db::name("thirdpay_back")->insert([ 'out_order_no' => $out_trade_no, 'content' => json_encode($res_decode), 'create_time' => sr_getcurtime(time()), 'type' => 2, 'uid' => $pay_info['uid'] ]); Db::name('payment')->where('id', $pay_info['id'])->update(['state' => 6, 'pay_at' => date('Y-m-d H:i:s')]); // 更改订单状态 switch ($pay_info['order_type']) { case 1: // 充值 break; case 3: // 充值会员 // break; case 4: //购买商品 // $order = Order::where(['order_sn' => explode(',', $pay_info['remarks'])])->select()->toArray(); // Order::payDoneOrderCallback($order, 3, $pay_info['uid']); $m_goods = new ShopGoodsModel(); $m_user = new UserModel(); $m_shoporder = new ShopOrderModel(); // 更改订单状态 $order = ShopOrderModel::where('order_sn', $pay_info['remarks'])->find(); $nowTime = date('Y-m-d H:i:s', time()); Db::name('shop_order')->where(['order_sn' => $pay_info['remarks']]) ->update(['status' => 1, 'pay_type' => 9, 'updated_time' => $nowTime]); // 增加销量 $orderGoods = OrderGoods::where(['order_id' => $order['order_id']])->select()->toArray(); foreach ($orderGoods as $k => $v) { ShopGoodsModel::where(['goods_id' => $v['goods_id']])->inc('sales_volume', $v['num'])->inc('real_sales_volume', $v['num'])->update(); } $user = $m_user->where('id', $pay_info['uid'])->find(); // if ($user['pid'] > 0){ // if (Db::name('user')->where('id', $user['pid'])->where('is_auth', 1)->find()){ // edit_user_score(15, $user['pid'], number_format($pay_info['total_fee']/100, 4, '.', '')); // } // // } // 送积分 edit_user_score(5, $order['user_id'], $order['rebate_score']); edit_user_redscore(1, $order['user_id'], $order['rebate_lock_score']); // 释放用户福利积分或者锁定积分到余额 $sf_money = intval(intval($pay_info['total_fee'])/100) * 5; if ($sf_money > 0){ $is_sf = false; if ($user['score_away'] > $sf_money && !$is_sf){ if ($user['score_away'] <= $sf_money){ $sf_money = intval($user['score_away']); } edit_user_score(24, $pay_info['uid'], $sf_money); edit_user_scoreaway(8, $pay_info['uid'], $sf_money); $is_sf = true; } if ($user['score_lock'] > $sf_money && !$is_sf){ edit_user_score(25, $pay_info['uid'], $sf_money); edit_user_lock_score(2, $pay_info['uid'], $sf_money); $is_sf = true; } } break; } Db::commit(); } catch (\Exception $e) { Db::rollback(); if ($e->getCode() != apiPingFanCode()){ redisFree($key); } sr_log('fy支付报错:' . $e->getMessage()); echo 'failure'; die; } } } } } } redisFree($key); echo 'success'; die; } // 进件审核回调 public function yplApplyResult(Request $request){ $res = file_get_contents('php://input'); sr_log('----------------------ypl审核回调-------------------------'); sr_log($res); sr_log('----------------------ypl审核回调-------------------------'); echo "0000"; die(); } public function ZfbResultYPL(Request $request){ $res = file_get_contents('php://input'); sr_log('----------------------ypl回调-------------------------'); sr_log($res); sr_log('----------------------ypl回调-------------------------'); // {"amount":5,"payTime":"20220622201730","transactionNo":"32202206228301997902995","cashAmount":5,"customerCode":"562012003860535","payState":"00","attachData":"attachData","channelOrder":"192022062222001491231433402953","buyerId":"2088612998991235","buyerLogonId":"sun***@163.com","nonceStr":"fba32d45251940f1b4acbfe5112aa7f6","procedureFee":0,"payerInfo":{"cardType":"D","fundChannel":"ALIPAYACCOUNT"},"outTradeNo":"YPL202206212246385110016927164"} $res = json_decode($res, true); // $res = json_decode('{"amount":5,"payTime":"20220622201730","transactionNo":"32202206228301997902995","cashAmount":5,"customerCode":"562012003860535","payState":"00","attachData":"attachData","channelOrder":"192022062222001491231433402953","buyerId":"2088612998991235","buyerLogonId":"sun***@163.com","nonceStr":"fba32d45251940f1b4acbfe5112aa7f6","procedureFee":0,"payerInfo":{"cardType":"D","fundChannel":"ALIPAYACCOUNT"},"outTradeNo":"YPL202206212246385110016927164"}', true); Db::startTrans(); try { if ($res['payState'] != '00'){ echo "0000"; die(); } $pay_info= Db::name('payment')->where('out_trade_no', $res['outTradeNo'])->lock(true)->find(); // if (Db::name('thirdpay_back')->where('out_order_no')->find()){ // echo "0000"; // die(); // } Db::name("thirdpay_back")->insert([ 'out_order_no'=>$res['outTradeNo'], 'content'=>json_encode($res), 'create_time'=>sr_getcurtime(time()), 'type'=>3, 'uid'=>$pay_info['uid'] ]); Db::name('payment')->where('id', $pay_info['id'])->update(['state' => 6, 'pay_at' => date('Y-m-d H:i:s')]); // 更改订单状态 switch ($pay_info['order_type']) { case 1: // 充值 break; case 3: // 充值会员 // break; case 4: //购买商品 // $order = Order::where(['order_sn' => explode(',', $pay_info['remarks'])])->select()->toArray(); // Order::payDoneOrderCallback($order, 3, $pay_info['uid']); $m_goods = new ShopGoodsModel(); $m_user = new UserModel(); $m_shoporder = new ShopOrderModel(); // 更改订单状态 $order = ShopOrderModel::where('order_sn', $pay_info['remarks'])->find(); $nowTime = date('Y-m-d H:i:s', time()); Db::name('shop_order')->where(['order_sn' => $pay_info['remarks']]) ->update(['status' => 1, 'pay_type'=>8,'updated_time' => $nowTime]); // 增加销量 $orderGoods = OrderGoods::where(['order_id' => $order['order_id']])->select()->toArray(); foreach ($orderGoods as $k => $v) { ShopGoodsModel::where(['goods_id' => $v['goods_id']])->inc('sales_volume', $v['num'])->inc('real_sales_volume', $v['num'])->update(); } $user = $m_user->where('id', $pay_info['uid'])->find(); // if ($user['pid'] > 0){ // if (Db::name('user')->where('id', $user['pid'])->where('is_auth', 1)->find()){ // edit_user_score(15, $user['pid'], number_format($pay_info['total_fee']/100, 4, '.', '')); // } // // } // 送积分 edit_user_score(5, $order['user_id'], $order['rebate_score']); edit_user_redscore(1, $order['user_id'], $order['rebate_lock_score']); // 释放用户福利积分或者锁定积分到余额 $sf_money = intval(intval($pay_info['total_fee'])/100) * 5; if ($sf_money > 0){ $is_sf = false; if ($user['score_away'] > $sf_money && !$is_sf){ if ($user['score_away'] <= $sf_money){ $sf_money = intval($user['score_away']); } edit_user_score(24, $pay_info['uid'], $sf_money); edit_user_scoreaway(8, $pay_info['uid'], $sf_money); $is_sf = true; } if ($user['score_lock'] > $sf_money && !$is_sf){ edit_user_score(25, $pay_info['uid'], $sf_money); edit_user_lock_score(2, $pay_info['uid'], $sf_money); $is_sf = true; } } break; } Db::commit(); } catch (\Exception $e) { Db::rollback(); sr_log('ypl报错:'. $e->getMessage()); echo "0000"; die(); } echo "0000"; die(); } public function ZfbResultHF(Request $request){ /** * 判断支付异步回调业务处理 * User: shuaishuai.niu * Date: 2020/11/16 * Time: 14:01 */ // $res = file_get_contents('php://input'); // $post_data = json_decode($_POST['data'],1); sr_log('----------------------汇付回调-------------------------'); sr_log($_POST['data']); sr_log('----------------------汇付回调-------------------------'); $params = $_POST['data']; # 加载SDK需要的文件 include_once "../extend/thirdpay/AdapaySdk/init.php"; # 加载商户的配置文件 include_once "../extend/thirdpay/config.php"; $adapay_tools = new \AdaPaySdk\AdapayTools(); # POST 接收的数据的key # create_time, data, prod_mode, sign, id, type,app_id # array( # 'app_id' => 'app_fe1ec54d-e7cd-432a-a994-c12c3d8295f8', # 'created_time' => '20201115182858', # 'end_time' => '20201115182904', # 'expend' => [ # 'bank_type' => 'OTHERS', # 'open_id' => '1123213123123', # 'sub_open_id'=> '36323333333' # ], # 'id' => '002112020111518285710173995928213929984', # 'order_no' => 'SH20201115182857625624', # 'out_trans_id' => '4200000839202011155051561044', # 'party_order_id' => '02212011156653808201465', # 'pay_amt' => '02212011156653808201465', # 'pay_channel' => '02212011156653808201465', # 'status' => 'succeeded' # ) $post_data = json_decode($_POST['data'],1); // $post_data = json_decode('{"app_id":"app_4f8d1f05-bcfd-4e9e-b093-b60c43036f2d","created_time":"1662776991","description":"\u8d2d\u4e70\u5546\u54c1","expend":{"pay_info":"https:\/\/qr.alipay.com\/bax04520xxibramp0fkm30ac"},"id":"002112022091010295110414500898441043968","object":"payment","order_no":"HFPAY202209101029485308739531608","party_order_id":"02212209103779136200665","pay_amt":"0.19","pay_channel":"alipay","prod_mode":"true","query_url":"https:\/\/api.adapay.tech\/v1\/expire\/payments\/1\/fae1cfb9d8fd3b44cf5645dab40603a4","status":"succeeded"}', true); $post_data_str = json_encode($post_data,JSON_UNESCAPED_UNICODE); $post_sign_str = isset($_POST['sign']) ? $_POST['sign']: ''; // 此处只是个示例 需要测试请去掉注释 //$post_data_str = "{\"app_id\":\"app_fe1ec54d-e7cd-432a-a994-c12c3d8295f8\",\"created_time\":\"20201115182858\",\"end_time\":\"20201115182904\",\"expend\":{\"bank_type\":\"OTHERS\",\"open_id\":\"o8jhotwaUEffs1fyWE5O3N4HWvbk\",\"sub_open_id\":\"o4WGIxA59TYBzEKdwz_s6actNIYY\"},\"id\":\"002112020111518285710173995928213929984\",\"order_no\":\"SH20201115182857625624\",\"out_trans_id\":\"4200000839202011155051561044\",\"party_order_id\":\"02212011156653808201465\",\"pay_amt\":\"0.01\",\"pay_channel\":\"wx_pub\",\"status\":\"succeeded\"}"; // //$sign_flag = $adapay_tools->verifySign($post_data_str,"YXOWP5pyL38cZvXbVTyr4Lp9tpr2IzYmc5+EXuNofMTPPlCMfgXX4aBHT8QhxmKMYe95TBklWrM6IAdSLqIBXyc7CYnEYh0o54QHH4H\/yKy5yiOqFCbcHAHPhtJPU28rj+dHbG7YG\/4Qk5psFoBuOTP99ACizLy\/uiILYY3UhJk="); # 先校验签名和返回的数据的签名的数据是否一致 $sign_flag = $adapay_tools->verifySign($post_data_str, $post_sign_str); // sr_log('汇付支付宝回调:'.json_encode($post_data)); // sr_log('$post_data_str:'.$post_data_str); if ($sign_flag){ // sr_log("签名验证通过"); # 业务方自己的逻辑 // $res = {"app_id":"app_4f8d1f05-bcfd-4e9e-b093-b60c43036f2d","created_time":"1662713634","description":"\u8d2d\u4e70\u5546\u54c1","expend":{"pay_info":"https:\/\/qr.alipay.com\/bax08139bwvehcew1b3t30c8"},"id":"002112022090916535410414235160744284160","object":"payment","order_no":"HFPAY20220909165205254560022948","party_order_id":"02212209096083454601956","pay_amt":"0.19","pay_channel":"alipay","prod_mode":"true","query_url":"https:\/\/api.adapay.tech\/v1\/expire\/payments\/1\/380d6a9c3aa72e53eeb65e04ec062043","status":"succeeded"} Db::startTrans(); try { if ($post_data['status'] != 'succeeded'){ sr_throw('成功1'); } $pay_info= Db::name('payment')->where('out_trade_no', $post_data['order_no'])->lock(true)->find(); if ($pay_info['state'] != 7){ sr_throw('成功1'); } $service = new ThirdPayServices(); $service->payBack($post_data['order_no'], 0, 14, json_encode($params)); Db::commit(); } catch (\Exception $e) { Db::rollback(); sr_log('汇付支付宝回调报错:'. $e->getMessage()); return api_succ_return('成功2'.$e->getMessage()); die(); } return api_succ_return('成功'); die(); }else{ sr_log('签名不通过:['.$post_sign_str.']'.'post_data_str--['.$post_data_str.']'); return api_succ_return('成功1'); die(); } } /** * 微信支付回调 * @param Request $request * @return mixed */ public function wxResult(Request $request) { file_put_contents('/www/wwwroot/lxzn.lebogyl.com/wechat.txt', var_export(file_get_contents('php://input'), true) . '--------' . date('H:i:s') . PHP_EOL, FILE_APPEND); file_put_contents('/www/wwwroot/lxzn.lebogyl.com/wechat1.txt', var_export($request->header(), true) . '--------' . date('H:i:s') . PHP_EOL, FILE_APPEND); // $data['body'] = '{"id":"d7d3eeff-7dc7-525b-99ea-fe362afc0ce8","create_time":"2022-03-31T21:20:42+08:00","resource_type":"encrypt-resource","event_type":"TRANSACTION.SUCCESS","summary":"支付成功","resource":{"original_type":"transaction","algorithm":"AEAD_AES_256_GCM","ciphertext":"y5G7RcAN27Nc42W/Ciw97A+Ts8SeRx/72EDgdDbr2Jc4zK00rCW4T2h8Fp/ny+9Hefii4EhrwRD4g76QMKW81kA44x9j9/uH/jmjR0wCglnDuwaoePPDACgYpBL1gj+O9zxqtzcvpRTyQtzEpbtxG9aVp3muNVfh52le9qZbtNaDjMJfCjZRj6a4qJ1XHxjwS3AC5I3E5q9n3a2nyhMiEsgiwbTR5m+fUY3FTxE1WGO7DY+xfYoz3GDiGdGi+gsDeLBxX/w3U1ieajUTUCtBlf9XAaa08fAuj05F6/SicntJc9SnRxNGBVqmX7LrWWKI6jpRdmSOHYfUuoz4+e1FzPBAtAY+9BjYcRP+XdRf659YpuWlUuzvTPQ+gdiADPo4Aszt8jHqtYADxLoeO7KwZraVme5oH5RPogiGd/30Pqn6y3PkhDmkpnvYmL9xDYB2PQMxbNeZX9n3mtDE41ZqoYUULPJSGhxc/fAtFrLV/C5Vj/NVPhomQhRBZgQx8myfUA4yRrJF/Xs0oVIbkUknoXacRBm02qaTNmxv+dLv+YrIQ9xt/3KP3VoaHvTqVAkEza65kGDijEyNdRQJYw==","associated_data":"transaction","nonce":"hZrJycCZANaX"}}'; // $data['header'] =array ( // 'host' => 'lbktza.lebogyl.com', // 'content-length' => '923', // 'user-agent' => 'Mozilla/4.0', // 'pragma' => 'no-cache', // 'wechatpay-timestamp' => '1648733686', // 'wechatpay-signature' => 'bkSmqJCBL4PpkhvReywNR1e6RCUfKLJmKpKTp0EkVYWMU6MSOeA8pI4BaKCPHmqene3cr5vM3+I0T9hcr0NpxlWiau87S97L+amCRT6UBpLy6Rzf6+jewMJccJCxN/SnjUXKA08N7gdw5YLFdeW1XMpQDSftBWpAPiVylf2XtrfWvhzq/D/xQINDPMb9HMbWXVRdcj9FKMr3uzGzLnM2SB4OzIXifW5MsYxbuSS1GRjKaSRM0q41e9oAeTegJ6MlY1QN+WuXByhexO64/CWcSthektvoj9RYPNbftGUj0nOQizNPWjIzzJouQmuyJ6uTKOi8VU5t8F3HXEI42RKW1A==', // 'connection' => 'Keep-Alive', // 'content-type' => 'application/json', // 'wechatpay-serial' => '3266CA67E9DE559412849E0E65845FC22BABA399', // 'wechatpay-nonce' => 'XGjZGY2a0zqxYecblrRAX8N3ASFuDCcb', // 'wechatpay-signature-type' => 'WECHATPAY2-SHA256-RSA2048', // 'accept' => '*/*', // ); $data['body'] = file_get_contents('php://input'); $data['header'] = $request->header(); return \app\api\services\WxPayServices::instance()->data($data)->getNotifyInfo()->afterPay(); } // 绑定支付宝账号 public function bindAlipay(Request $request, UserDataModel $model) { $re_data = $request->data; if (isset($re_data['real_name']) || isset($re_data['alipay'])) { return api_error_return('参数错误--算出sign_str不要传real_name跟alipay'); } [$sign_str] = $request->getMore([ ['sign_str', ''] ], true); if (empty($sign_str)) return api_error_return('参数错误'); $data = json_decode(AESjiemi($sign_str)); if (empty($data)) return api_error_return('参数错误'); $data = object_array($data); try { return api_succ_return(['msg' => '绑定成功', 'data' => $model->bindAlipay($data, $request->uid)]); } catch (\Exception $e) { return api_error_return('绑定失败'); } } // 解绑支付宝 public function unbindAlipay(Request $request, UserDataModel $model){ try { return api_succ_return(['msg' => '解绑成功', 'data' => $model->unbindAlipay($request)]); } catch (\Exception $e) { return api_error_return('解绑失败'); } } // public function payResult(Request $request){ //// $out_no = $request->post('') //// $out_trade_no = 'YPL202209240649074123527091115'; // // // } public function thirdPaySqzBack(Request $request){ // 协议绑卡 // {"orderid":"SYL202209280158007492161561569","opstate":"0","ovalue":"0.26","systime":"2022\/09\/28 02:25:47","sysorderid":"22092802252822020418","completiontime":"2022\/09\/28 02:25:47","attach":"","msg":"","sign":"aa9b11c9ea303c43424ec7d762fca0da"} sr_log('----------------------thirdPaySqzBack支付三方sqz回调-------------------------'); sr_log($request->param()); sr_log('----------------------支付三方sqz回调-------------------------'); $params = $request->param(); if (isset($params['orderid']) && isset($params['opstate']) && isset($params['ovalue'])){ // 校验签名 if (isset($params['sign'])){ $sign = md5('orderid='.$params['orderid'].'&opstate='.$params['opstate'].'&ovalue='.$params['ovalue'].env('PAYSQZ.SIGNKEY')); if ($sign === $params['sign']){ if ($params['opstate'] == 0){ Db::startTrans(); try { $service = new ThirdPayServices(); $service->payBack($params['orderid'], $params['ovalue'], 15, json_encode($params)); Db::commit(); }catch (\Exception $e){ Db::rollback(); sr_log($e->getMessage()); return 'opstate=0'.$e->getMessage(); } }else{ return 'opstate=01'; } }else{ sr_log('协议绑卡签名不通过'); return 'opstate=0'; } } } return 'opstate=0'; } public function thirdPaySqzAliBack(Request $request){ // {"orderid":"SYL202209280158007492161561569","opstate":"0","ovalue":"0.26","systime":"2022\/09\/28 02:25:47","sysorderid":"22092802252822020418","completiontime":"2022\/09\/28 02:25:47","attach":"","msg":"","sign":"aa9b11c9ea303c43424ec7d762fca0da"} sr_log('----------------------三方支付宝sqz回调-------------------------'); sr_log($request->param()); sr_log('----------------------三方支付宝sqz回调-------------------------'); $params = $request->param(); if (isset($params['orderid']) && isset($params['opstate']) && isset($params['ovalue'])){ // 校验签名 if (isset($params['sign'])){ $sign = md5('orderid='.$params['orderid'].'&opstate='.$params['opstate'].'&ovalue='.$params['ovalue'].env('PAYSQZ.SIGNKEY')); if ($sign === $params['sign']){ if ($params['opstate'] == 0){ Db::startTrans(); try { $service = new ThirdPayServices(); $service->payBack($params['orderid'], $params['ovalue'], 16, json_encode($params)); Db::commit(); }catch (\Exception $e){ Db::rollback(); sr_log($e->getMessage()); return 'opstate=0'.$e->getMessage(); } }else{ return 'opstate=01'; } }else{ return 'opstate=0'; } } } return 'opstate=0'; } public function thirdPayZfbNewBack(Request $request){ // {"pay":"true","appId":"dianke","amount":"28","orderId":"20230206160818959664875","version":"1.0","transactionId":"2023020622001491231429909739","sign":"D9560AEACD28FD948D979AF098C06451"} sr_log('----------------------三方支付宝电科回调-------------------------'); sr_log($request->param()); sr_log('----------------------三方支付宝电科回调-------------------------'); $params = $request->param(); // $params = json_decode('{"pay":"true","appId":"dianke","amount":"23","orderId":"20230211051634709607926","version":"1.0","transactionId":"2023021122001411311446728675","sign":"CE5B60938178B3F383E332D652A9EFB9"}', true); $service = new ThirdPayServices(); if (isset($params['orderId']) && isset($params['amount']) && isset($params['pay']) && $params['pay']=='true'){ // 校验签名 if (isset($params['sign'])){ $back_sign = $params['sign']; unset($params['sign']); $sign = $service->diankesign($params); if ($sign == $back_sign){ Db::startTrans(); try { $service->payBack($params['orderId'], $params['amount'], 22, json_encode($params)); Db::commit(); }catch (\Exception $e){ Db::rollback(); sr_log('电科报错'.$e->getMessage()); return 'success'; } }else{ return 'success'; } } } return 'success'; } // 代付回调 public function thirdPayZfbNewBackdf(Request $request){ // {"status":"1","appId":"diankef","amount":"120","orderId":"WD51565253559","version":"1.0","sign":"90B754A2099D32097399A103A9451DE2"} sr_log('----------------------三方支付宝代付电科回调-------------------------1'); sr_log($request->param()); sr_log('----------------------三方支付宝代付电科回调-------------------------2'); $params = $request->param(); // $params = json_decode('{"status":"1","appId":"diankef","amount":"120","orderId":"WD51565253559","version":"1.0","sign":"90B754A2099D32097399A103A9451DE2"}', true); $service = new ThirdPayServices(); if (isset($params['orderId']) && isset($params['amount'])){ // 校验签名 if (isset($params['sign'])){ $back_sign = $params['sign']; unset($params['sign']); $sign = $service->diankesigndf($params); if ($sign == $back_sign){ // Db::startTrans(); // try { try { $service->payDfBack($params['orderId'], $params['amount'], $params, json_encode($params)); }catch (Exception $e){ sr_log('电科报错'.$e->getMessage()); return 'success'; } // Db::commit(); // }catch (\Exception $e){ // Db::rollback(); // sr_log('电科报错'.$e->getMessage()); // return 'success'; // return $e->getMessage(); // } }else{ return 'success'; } } } return 'success'; } public function thirdPaySqzWeixinBack(Request $request){ // {"orderid":"SYL202209280158007492161561569","opstate":"0","ovalue":"0.26","systime":"2022\/09\/28 02:25:47","sysorderid":"22092802252822020418","completiontime":"2022\/09\/28 02:25:47","attach":"","msg":"","sign":"aa9b11c9ea303c43424ec7d762fca0da"} sr_log('----------------------三方微信sqz回调-------------------------'); sr_log($request->param()); sr_log('----------------------三方微信sqz回调-------------------------'); $params = $request->param(); if (isset($params['orderid']) && isset($params['opstate']) && isset($params['ovalue'])){ // 校验签名 if (isset($params['sign'])){ $sign = md5('orderid='.$params['orderid'].'&opstate='.$params['opstate'].'&ovalue='.$params['ovalue'].env('PAYSQZ.SIGNKEY')); if ($sign === $params['sign']){ if ($params['opstate'] == 0){ Db::startTrans(); try { $service = new ThirdPayServices(); $service->payBack($params['orderid'], $params['ovalue'], 17, json_encode($params)); Db::commit(); }catch (\Exception $e){ Db::rollback(); sr_log($e->getMessage()); return 'opstate=0'.$e->getMessage(); } }else{ return 'opstate=01'; } }else{ return 'opstate=0'; } } } return 'opstate=0'; } public function thirdPaySqzKuaiBack(Request $request){ // {"orderid":"SK202210082016332330018423433","opstate":"0","ovalue":"0.21","systime":"2022\/10\/08 20:17:39","sysorderid":"22100820163428020468","completiontime":"2022\/10\/08 20:17:39","attach":"","msg":"","sign":"a969e851d73444f5d8c34d7782e4d9f3"} sr_log('----------------------三方银行快捷sqz回调-------------------------'); sr_log($request->param()); sr_log('----------------------三方银行快捷sqz回调-------------------------'); $params = $request->param(); // $params['orderid'] = 'SK202210082016332330018423433'; // $params['opstate'] = 0; // $params['ovalue'] = 0.21; // $params['systime'] = "2022\/10\/08 20:17:39"; // $params['sysorderid'] = "22100820163428020468"; // $params['completiontime'] = "22100820163428020468"; // $params['sign'] = "a969e851d73444f5d8c34d7782e4d9f3"; if (isset($params['orderid']) && isset($params['opstate']) && isset($params['ovalue'])){ // 校验签名 if (isset($params['sign'])){ $sign = md5('orderid='.$params['orderid'].'&opstate='.$params['opstate'].'&ovalue='.$params['ovalue'].env('PAYSQZ.SXY_SIGNKEY')); if ($sign === $params['sign']){ if ($params['opstate'] == 0){ Db::startTrans(); try { $service = new ThirdPayServices(); $service->payBack($params['orderid'], $params['ovalue'], 18, json_encode($params)); Db::commit(); }catch (\Exception $e){ Db::rollback(); sr_log($e->getMessage()); return 'opstate=0'.$e->getMessage(); } }else{ return 'opstate=01'; } }else{ sr_log('yinsheng快捷银行签名有问题'); return 'opstate=01'; } } } return 'opstate=0'; } public function thirdPayYsBack(Request $request){ sr_log('----------------------银盛回调-------------------------'); sr_log($request->param()); sr_log('----------------------银盛回调-------------------------'); $params = $request->post(); $res = $this->sign_verify($params); if ($res){ Db::startTrans(); try { $service = new ThirdPayServices(); $service->payBack($params['out_trade_no'], $params['settlement_amount'], 20, json_encode($params)); Db::commit(); }catch (\Exception $e){ Db::rollback(); sr_log('银盛回调报错:'.$e->getMessage()); return 'success'; } }else{ sr_log('银盛签名有问题'); return 'success'; } return 'success'; } /** * 验签转明码 * @param input check * @param input msg * @return data * @return success */ public function sign_check($sign, $data) { $publickeyFile = env('ZLYS.CER_PATH'); //公钥 $certificateCAcerContent = file_get_contents($publickeyFile); $certificateCApemContent = '-----BEGIN CERTIFICATE-----' . PHP_EOL . chunk_split(base64_encode($certificateCAcerContent), 64, PHP_EOL) . '-----END CERTIFICATE-----' . PHP_EOL; // 签名验证 $success = openssl_verify($data, base64_decode($sign), openssl_get_publickey($certificateCApemContent), OPENSSL_ALGO_SHA1); return $success; } //验签 public function sign_verify($data) { //返回的数据处理 $sign = trim($data['sign']); unset($data['sign']); ksort($data); $url = ""; foreach ($data as $key => $val) { /* 验证签名 */ if ($val) $url .= $key . '=' . $val . '&'; } $str = trim($url, '&'); if ($this->sign_check($sign, $str) != true) { return false; } else { return true; } } public function userSignBank(Request $request){ sr_log('----------------------支付三方签约sqz回调-------------------------'); sr_log($request->param()); sr_log('----------------------支付三方签约sqz回调-------------------------'); // $res = file_get_contents('php://input'); // sr_log('----------------------sqz签约回调-------------------------'); // sr_log($res); // sr_log('----------------------sqz签约回调-------------------------'); // {"orderid":"signbank534422852485710152","opstate":"0","userno":"57270bf05df92c95f5ad21d9166d8e38","sign":"dd8e86baede215b3687713258213a721"} $para = $request->param(); if (isset($para['userno']) && $para['userno']){ // 校验签名 if (isset($para['orderid']) && isset($para['opstate']) && isset($para['userno']) && isset($para['sign'])){ $sign = md5('orderid='.$para['orderid'].'&opstate='.$para['opstate'].'&userno='.$para['userno'].env('PAYSQZ.SIGNKEY')); if ($sign === $para['sign']){ $sign_orderinfo = Db::name('user_bank_sign')->where('signorder_id', $para['orderid'])->find(); if ($sign_orderinfo){ // 获取userno 然后保存 Db::name('user_bank_sign')->where('signorder_id', $para['orderid'])->save([ 'userno'=>$para['userno'], 'status'=>2 ]); } }else{ return 'error'; } } $res = $request->param('signorder_id'); // // https://www.yj.com/api/userSignBank?signorder_id=signbank534422851555549509 $order_id = $res; $sign_info = Db::name('user_bank_sign')->where('signorder_id', $order_id)->find(); // if ($sign_info) // userno } } public function sylSurePay(Request $request){ Db::startTrans(); try { $third_pay = new ThirdPayServices(); $third_pay->sylSurePay($request->uid, $request->post()); Db::commit(); }catch (\Exception $e){ Db::rollback(); return api_error_return($e->getMessage()); } return api_succ_return('支付订单提交成功,稍后请关注订单列表'); } // 用户绑定银行卡 public function userToSignBank(Request $request){ // Db::startTrans(); try { $third_pay = new ThirdPayServices(); $sign_url = $third_pay->userBankSign($request->uid, $request->post()); Db::commit(); }catch (\Exception $e){ Db::rollback(); return api_error_return($e->getMessage()); } return api_succ_return(['msg'=>'成功', 'data'=>['sign_url'=>$sign_url]]); } // 用户解绑银行卡 public function userToUnSignBank(Request $request){ Db::startTrans(); try { $third_pay = new ThirdPayServices(); $third_pay->userUnBankSign($request->uid, $request->post()); Db::commit(); }catch (\Exception $e){ Db::rollback(); return api_error_return($e->getMessage()); } return api_succ_return('成功'); } // 用户绑定银行卡签名 public function myBankSignList(Request $request){ $list = Db::name('user_bank_sign')->where('uid', $request->uid)->where('status', 2)->field('id,name,bank_card,phone')->withAttr('bank_card', function ($val, $data){ $len = strlen($val); return substr($val,0, 4).'****'.substr($val,$len-5, $len-1); })->select()->toArray(); return api_succ_return(['msg'=>'成功', 'data'=>$list]); } public function ylBindCanSignList(Request $request){ return api_succ_return(['msg'=>'成功', 'data'=>[ 'chuxuka'=>['中国银行','建设银行','工商银行','浦发银行','光大银行','华夏银行','民生银行','平安银行','上海银行','交通银行','邮政储蓄银行','中信银行','浙商银行','广东省农村信用社','山西省农村信用社','内蒙古自治区农村信用社','吉林农村信用社','河南省农村信用社','黄河农村商业银行','深圳农村商业银行','天津滨海农村商业银行股份有限公司','大连农村商业银行','鄞州银行','天津农商银行','辽宁省农村信用社','湖北农信','云南省农村信用社联合社','陕西省农村信用社','青海省农村信用社联合社','湖南省农村信用社','黑龙江省农村信用社','广西农村信用社','苏州银行','四川省农村信用社','甘肃省农村信用社','山东省农村信用社联合社','广西北部湾银行','抚顺银行股份有限公司','辽阳银行股份有限公司','贵州银行','晋中银行股份有限公司','西藏银行股份有限公司','新疆汇和银行股份有限公司','江苏江阴农村商业银行股份有限公司','大连银行','阜新银行','吉林银行','宁夏银行','嘉兴银行','常熟农商银行','江苏江南农村商业银行股份公司','江苏长江商行','台州银行','温州银行','浙江稠州商业银行','绍兴银行','宁波通商银行股份有限公司','温州民商银行','浙江民泰商业银行','浙江泰隆商业银行','金华银行股份有限公司','南洋商业银行','贵阳银行','韩亚银行','宜宾商业银行','自贡市商业银行','顺德农村商业银行','桂林银行股份有限公司','承德银行','富滇银行','昆仑银行','新韩银行中国','邢台银行','张家口市商业银行','沧州银行','兰州银行','友利银行','焦作中旅银行','泉州银行','厦门国际银行','营口银行','朝阳银行股份有限公司','广东华兴银行','长沙银行','锦州银行','九江银行','石嘴山银行股份有限公司','哈尔滨银行','龙江银行','江西银行','攀枝花市商业银行','重庆三峡银行','广州银行','晋城银行','上饶银行','赣州银行','长城华西银行','盛京银行','甘肃银行','中原银行','湖北银行','郑州银行','富邦华一银行有限公司','星展银行','乐山市商业银行股份有限公司','长治银行','上海华瑞银行','湖南三湘银行','海南银行','福建海峡银行','北京农商银行','河北省农村信用社','上海农村商业银行','江苏省农村信用社联合社','浙江农信','安徽省农村信用社联合社','福建省农村信用社联合社','江西省农村信用社','海南省农村信用社','重庆农村商业银行','贵州省农村信用社','新疆自治区农村信用社','武汉农村商业银行','成都农商银行','张家港农村商业银行','江苏紫金农村商业银行','无锡农村商业银行','太仓农村商业银行','昆山农村商业银行','广东南海农村商业银行','浙江长兴农村商业银行'], 'xinyongka'=>['招商银行','中国银行','中信银行','民生银行','浦发银行','平安银行','光大银行','广东发展银行','上海银行','华夏银行','工商银行','建设银行','交通银行','邮政储蓄银行','浙商银行','北京银行'] ]]); } }