国通支付
This commit is contained in:
parent
3fc672ebb5
commit
a2375b0050
@ -305,7 +305,7 @@ class Abutment extends Api
|
||||
'biz_content' => array(
|
||||
"mer_id"=>"120448160200",
|
||||
"deal_flag"=>'0',
|
||||
"out_trade_no"=>"dlh1730358966979",
|
||||
"out_trade_no"=>"dlh1730187196979",
|
||||
// "order_id"=>"120448160200000562407290003182",
|
||||
"mer_prtcl_no"=>"1204481602000201",
|
||||
"icbc_appid"=>$this->APP_ID
|
||||
@ -451,10 +451,10 @@ class Abutment extends Api
|
||||
'method' => 'POST',
|
||||
'isNeedEncrypt'=>false,
|
||||
'biz_content' => array(
|
||||
"icbcOrderSubNo"=>"7",
|
||||
"icbcOrderNo"=>"120448160200000552410310006232",
|
||||
"outAgreeNo"=>"1204481602030201"
|
||||
// "outAgreeNo"=>"dlh17304530429791"
|
||||
"icbcOrderSubNo"=>"11",
|
||||
"icbcOrderNo"=>"120448160200000572410290005130",
|
||||
// "outAgreeNo"=>"1204481601980201"
|
||||
"outAgreeNo"=>"1204481602020201"
|
||||
// "outAgreeNo"=>"1204481602020201"
|
||||
),
|
||||
'extraParams'=>[]
|
||||
|
||||
@ -49,7 +49,7 @@ class Gh extends Api
|
||||
);
|
||||
}
|
||||
// 工行支付
|
||||
public function pay($money="",$decive_info="111",$type=""){
|
||||
public function pay($money="",$decive_info="111",$type="",$partner_id="",$store_type_id=""){
|
||||
$user_id = $this->user_id;
|
||||
$merchant = 70; //商户获取金额比例
|
||||
$our = 5; //服务费
|
||||
@ -83,6 +83,7 @@ class Gh extends Api
|
||||
$order_num = 4;
|
||||
$order_submit_act_input = array($userAccount,$basic,$general1,$general2);
|
||||
}
|
||||
|
||||
$request = [
|
||||
'serviceUrl' => 'https://gw.open.icbc.com.cn/api/cardbusiness/aggregatepay/b2c/online/consumepurchase/V2',
|
||||
'method' => 'POST',
|
||||
@ -133,16 +134,25 @@ class Gh extends Api
|
||||
$data['user_id'] = $user_id;
|
||||
$data['open_id'] = $user_msg['openid'];
|
||||
$data['dtime'] = date("Y-m-d H:i:s");
|
||||
$rest = Db::name("abutment_log")->save($data);
|
||||
$rest = Db::name("abutment_log")->insertGetId($data);
|
||||
$res = $this->apiClient->execute($request,$msg_id,"");
|
||||
$result = json_decode($res,true);
|
||||
// print_r("<pre>");
|
||||
// var_dump($result);
|
||||
$r = json_decode($result['wx_data_package'],true);
|
||||
$out_trade_no = createSn('user', 'id');
|
||||
$data['order_sn'] = $out_trade_no;
|
||||
$data['user_id'] = $user_id;
|
||||
$data['order_amount'] = $money;
|
||||
$data['partner_id'] = $partner_id;
|
||||
$data['store_type_id'] = $store_type_id;
|
||||
$data['pay_time'] = date("Y-m-d H:i:s");
|
||||
Db::name("distribution_pay")->save($data);
|
||||
$r['nonceStr'] = $r['noncestr'];
|
||||
$r['timeStamp'] = $r['timestamp'];
|
||||
$r['paySign'] = $r['sign'];
|
||||
$r['order_num'] = $order_num;
|
||||
$r['alog_id'] = $rest;
|
||||
return JsonServer::success('查询成功',$r);
|
||||
|
||||
}
|
||||
@ -150,44 +160,8 @@ class Gh extends Api
|
||||
return substr(md5("donglonghui".time().mt_rand(1,1000000)),8,13);
|
||||
}
|
||||
// 查询回调记录
|
||||
public function checkReturn($money=1,$type=""){
|
||||
$aa = urldecode(file_get_contents("php:://input"));
|
||||
Log::write($aa, 'test_aaa');die;
|
||||
$user_id = $this->user_id;
|
||||
$merchant = 70; //商户获取金额比例
|
||||
$our = 5; //服务费
|
||||
$other = 3; // 其他分销推广人员费用
|
||||
$user_billions = 22; // 其他+服务费
|
||||
$user_msg = UserAuth::where("user_id",$user_id)->find();
|
||||
$out = "dlh1731383512979";
|
||||
$basic = $this->basic($user_id,$out,$money,$our,$user_msg,$type);
|
||||
$general1 = $this->general1($user_id,$out,$money,$other,$user_msg,$type);
|
||||
$general2 = $this->general2($user_id,$out,$money,$user_billions,$user_msg,$type);
|
||||
// $basic['']
|
||||
$order_submit_act_input = array($basic,$general1,$general2);
|
||||
if($type != 0){
|
||||
$userAccount = $this->userAccount($user_id,$out,$money,$merchant,$user_msg);
|
||||
$order_num = 4;
|
||||
$order_submit_act_input = array($userAccount,$basic,$general1,$general2);
|
||||
}
|
||||
|
||||
$request = [
|
||||
'serviceUrl' => 'https://gw.open.icbc.com.cn/api/cardbusiness/aggregatepay/b2c/online/consumepurchase/V2',
|
||||
'method' => 'POST',
|
||||
'isNeedEncrypt'=>false,
|
||||
'biz_content' => array(
|
||||
"return_code"=>"0",
|
||||
"return_msg"=>"success",
|
||||
"order_submit_act_input"=>$order_submit_act_input
|
||||
),
|
||||
'extraParams'=>[]
|
||||
];
|
||||
print_r("<pre>");
|
||||
var_dump($request);
|
||||
$msg_id = $this->getMsgId();
|
||||
$res = $this->apiClient->execute($request,$msg_id,"");
|
||||
$result = json_decode($res,true);
|
||||
var_dump($result);
|
||||
public function checkReturn($alog_id){
|
||||
$abutment =
|
||||
}
|
||||
// 用户账户
|
||||
public function userAccount($user_id,$out,$money,$merchant,$user_msg){
|
||||
|
||||
@ -65,7 +65,7 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwRUsPpbQPhBWrxFhG00k9VBgnHc7dCZyTQYI
|
||||
'openid'=>"ouOMm41xnIKqoZ66ygwJa-qJQpgw",
|
||||
'payWay'=>"1",
|
||||
'ip'=>$_SERVER['REMOTE_ADDR'],
|
||||
'timeStamp'=>date("Y-m-d H:i:s"),
|
||||
'timeStamp'=>time(),
|
||||
'version'=>"1.0.0"
|
||||
];
|
||||
$d =$this->ASCII($data);
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
require_once ROOT_PATH . "/../vendor/hf/BsPayDemo/loader.php";
|
||||
require_once ROOT_PATH . "/../vendor/hf/BsPaySdk/init.php";
|
||||
use app\common\basics\Api;
|
||||
use BsPaySdk\core\BsPay;
|
||||
|
||||
require_once ROOT_PATH . "/../vendor/hf/BsPaySdk/init.php";
|
||||
|
||||
class Huifu extends Api
|
||||
{
|
||||
|
||||
@ -143,8 +143,8 @@ class Pay extends Api
|
||||
}else{
|
||||
$client = 1;
|
||||
}
|
||||
$result = PayLogic::distributionPay($user_id,$post,$client);
|
||||
// $result = PayLogic::abc($user_id,$post);
|
||||
// $result = PayLogic::distributionPay($user_id,$post,$client);
|
||||
$result = PayLogic::abc($user_id,$post);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -679,7 +679,9 @@ class PayLogic extends Logic
|
||||
$sha256 = hash('sha256', $d);
|
||||
openssl_public_encrypt($d,$msg,$publicKey);
|
||||
$msgd = base64_encode($msg);
|
||||
$url = "http://jghwucyshtgjcbrnxgwe.gtxygroup.com/testterpay/yyfsevr/order/pay";
|
||||
}
|
||||
|
||||
//
|
||||
public static function distributionPay($user_id,$post,$client){
|
||||
$out_trade_no = createSn('user', 'id');
|
||||
|
||||
10
vendor/hf/BsPaySdk/config/MerConfig.php
vendored
10
vendor/hf/BsPaySdk/config/MerConfig.php
vendored
@ -6,16 +6,16 @@ class MerConfig {
|
||||
/**
|
||||
* @var string 商户rsa私钥,用来进行对斗拱接口调用的请求数据加签
|
||||
*/
|
||||
public $rsa_merch_private_key = "";
|
||||
public $rsa_merch_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCE9tnPTe7fe/JtQeWzMsVJIJvJ/A0nf1p6cLP6XiUGXAk6ulQx3qVzlDXP4k2/ywjR18NmI2gELIvQ8Qxpa5R2EmW/Oc4Ur1Q4VUlAle1w+L9Lm7Z7RNFLCa5ZZYg3n+pRmSmXXv8T+yrId5m54kvF2JwF4xUGZMaLxqvewuVHm12nBKYmAT2R3kAiBRQGdY1/xaYCtcmNwX6Amiq4whmq9G1LnR3SyO4/zhowO89Oe5l223j6znRjRRIJ5hJVsDoDxoaQe5EnjAVIt2sxTa2N+9ev2E6C6u+IbJHP5aQ3joOEPh9FbeAcPx3QtEtPRQNQqKl9m6hbQzAZz4zFvOEhAgM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FBo02w7W4RxvPpgMMCNBrqJKUfQlrT8OrjZ9+2fZ/YOScIiSQnCHR+WvXgctjQbfnRGdNtOk2NlMRvmK+0AHEea0E2LetBVRijgUpIswo0pRY/QmMW8Ho7CA51Rseluk5rzfnIJHwHidcoY6";
|
||||
|
||||
/**
|
||||
* @var string 商户汇付rsa公钥,用来进行对斗拱接口应答数据的验签,以及部分请求数据非对称加密
|
||||
*/
|
||||
public $rsa_huifu_public_key = '';
|
||||
public $rsa_huifu_public_key = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhPbZz03u33vybUHlszLFSSCbyfwNJ39aenCz+l4lBlwJOrpUMd6lc5Q1z+JNv8sI0dfDZiNoBCyL0PEMaWuUdhJlvznOFK9UOFVJQJXtcPi/S5u2e0TRSwmuWWWIN5/qUZkpl17/E/sqyHeZueJLxdicBeMVBmTGi8ar3sLlR5tdpwSmJgE9kd5AIgUUBnWNf8WmArXJjcF+gJoquMIZqvRtS50d0sjuP84aMDvPTnuZdtt4+s50Y0USCeYSVbA6A8aGkHuRJ4wFSLdrMU2tjfvXr9hOgurviGyRz+WkN46DhD4fRW3gHD8d0LRLT0UDUKipfZuoW0MwGc+MxbzhIQIDAQAB';
|
||||
|
||||
public $product_id = '';
|
||||
public $product_id = 'PAYUN';
|
||||
|
||||
public $sys_id = '';
|
||||
public $sys_id = '6666000156739560';
|
||||
|
||||
public $huifu_id = '';
|
||||
public $huifu_id = '6666000156739560';
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user