Commit 389be2d9 by wangyu

feat: 调整公众号支付

1 parent d0622ee2
......@@ -12,6 +12,8 @@ class BackPubChargeData extends FuBaseData
public function getData()
{
$data = [];
//TODO: 貌似不需要根据订单类型判断,返回参数中存在 reserved_pay_info 字段,该字段为JSON字符串,与发起支付时所需要参数相同,可以直接根据该字段值返回package
if (!empty($this->reserved_pay_info)) {
switch ($this->trade_type) {
case 'JSAPI': //微信公众号
case 'LETPAY': //小程序
......@@ -31,12 +33,12 @@ class BackPubChargeData extends FuBaseData
break;
default:
}
$this->retData['package'] = $data;
}
$this->retData['package'] = !empty($this->reserved_pay_info) ? json_decode($this->reserved_pay_info, true) : $data;
$this->retData['other'] = [
'out_trade_no' => $this->reserved_fy_order_no ?: '',
'attach' => $this->reserved_addn_inf ?: ''
];
return parent::getData();
}
......
......@@ -18,27 +18,31 @@ class BackPubChargeData extends SwBaseData
public function getData()
{
$data = [];
switch ($this->pay_type){
case '010':{ //微信
switch ($this->pay_type) {
case '010':
{ //微信
$data = [
'appId' => $this->appId,
'timeStamp' => time() . '',
'timeStamp' => $this->timeStamp,
'nonceStr' => $this->nonceStr,
'package' => $this->package_str,
'signType' => $this->signType,// 签名算法,暂支持MD5
'signType' => $this->signType, // 签名算法,暂支持MD5
'paySign' => $this->paySign
];
break;
}
case '020':{ //支付宝
case '020':
{ //支付宝
$data = [
'ali_trade_no' => $this->ali_trade_no,
];
break;
}
case '060':{
case '060':
{
$data = [
'token_id' => $this->token_id,
];
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!