Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ldy
/
payment
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7c32583c
authored
May 18, 2023
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_huishouqian' into 'master'
Dev huishouqian See merge request !9
2 parents
d5310884
78531dd1
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
105 additions
and
115 deletions
examples/hsq/config.php
examples/hsq/liteCharge.php
examples/hsq/notify.php
examples/hsq/transferConfig.php
src/Common/Hsq/Data/Charge/PubChargeData.php
src/Common/Hsq/Data/RefundData.php
src/Common/Hsq/HsqBaseStrategy.php
src/Common/Hsq/HsqTransBaseStrategy.php
src/Notify/HsqNotify.php
src/Notify/HsqTransferNotify.php
src/Notify/NotifyStrategy.php
src/Query/Hsq/HsqTransferQuery.php
src/Refund/HsqRefund.php
src/Trans/HsqTransfer.php
examples/hsq/config.php
View file @
7c32583
...
...
@@ -29,7 +29,7 @@ return [
/* 猎维(智能充) begin */
'key'
=>
'6a84817f0214990c0e52871aa33ca777'
,
//商户key
'merchantNo'
=>
'861002923881'
,
//商户号
'appid'
=>
'wx
7d8e1164d40f77be
'
,
//微信公众号APPID
'appid'
=>
'wx
fbe753bb28212636
'
,
//微信公众号APPID
// 'private_key' => dirname(__FILE__) .'/certFile/hsq/liewei_pri.pfx', //私钥
'private_key'
=>
'-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDXwmROITU7SwEN
...
...
examples/hsq/liteCharge.php
View file @
7c32583
...
...
@@ -12,9 +12,9 @@ $config = require_once __DIR__ . '/config.php';
$payData
=
[
'transNo'
=>
"WechatPay"
.
date
(
"YmdHis"
),
//商户订单号
'orderAmt'
=>
1
,
//交易金额(单位分)
'orderAmt'
=>
1
00
,
//交易金额(单位分)
'goodsInfo'
=>
'支付测试'
,
//商品说明
'openid'
=>
'oAFzv5
UAHlFeaiQjIXPGMrZWdPaA
'
,
'openid'
=>
'oAFzv5
a67bJ0aGk7cB-RfK0Yap8s
'
,
'longitude'
=>
'171.21'
,
//经度
'latitude'
=>
'22.33'
,
//纬度
];
...
...
examples/hsq/notify.php
View file @
7c32583
...
...
@@ -10,16 +10,7 @@ date_default_timezone_set('Asia/Shanghai');
$config
=
require_once
__DIR__
.
'/config.php'
;
$_POST
[
'req'
]
=
[
'method'
=>
'CALLBACK'
,
'format'
=>
'json'
,
'signType'
=>
'RSA2'
,
'signContent'
=>
'{"transNo":"WechatPay20230505172514","payType":"WECHAT_APPLET","orderAmt":1,"goodsInfo":"支付测试","returnUrl":null,"requestDate":"20230505172514","memo":"{\"openid\":\"oUpF8uMuAJO_M2pxb1Q9zNjWeS6o\",\"appid\":\"wxb63c89abb9243ad0\",\"spbillCreateIp\":\"127.0.0.1\",\"longitude\":null,\"latitude\":null}"}'
,
'version'
=>
'1.0'
,
'merchantNo'
=>
'814000473149'
,
// 'sign' => '219518285f7faea08921f367ec05958f629ef61d0216bf826599cf51d7541feeb08fb2e07f88b83f33f4db8443d81a2beafd0b1affbd8a2d529d8a6d7b6bc3445700edc448d666ac139acd7115dc61d6e7691527e7b05a1143006eef4ef7d67114359e833dc73a1f01a6cf3711e1955e268f2f47978d683fed54127d23a40f72',
'sign'
=>
'68d9975afec900871fc36212c2ccedac08ffea2b3f212f5d5d37ff8af78bd77f12dfa77cdfd291a2bcda61d462b9ef11c3479707f35300b76c361b4a87f6dcb856a5e1e56c2cdc6e894ce69ffee6fe2c5709dd4756779ac389a717d35cb203406135bc77a403735cd5da630f28f5cdd22259d32d2a07e4a5febb15f894940f9e'
,
];
$_POST
[
'req'
]
=
'method=CALLBACK&format=json&sign=115a949ed99f50978e0f301ee49b288cb83ff3cc0fe25ae8a6e9397524f34417ad32887fde2f3c20879879a5cb77f77c80161a7e868cf6d4b73879ec859f95d3a4531216f551abb8da050921a3a0db49362a7410c9ed8c71ea789ea56e49f4c9a7d82e437dcd41e1e58734720f0bba1c450f380948241c3444ada85700a6d856e0f2a8a01ff085a23092e0cad006d8a142e76af4907e4c17b2db47f2b512acb839e4b40a896bb8f98b594677590d39ee3af92cd324dddc6d4ce01cb19bbc4020b205415cd8d5b5b0ab6c0fbc7968ecb00571c43dd7f4a20cf8e9dc74209b17b7f4c75a4f4cae71fae16cac6ba2578f826d5ff9cf1dde2bed9ed8f6430909cac3&signType=RSA2&signContent=%7B%22buyerName%22%3A%22oAFzv5a67bJ0aGk7cB-RfK0Yap8s%22%2C%22channelOrderNo%22%3A%2223050815371110591231100592117922%22%2C%22finishedDate%22%3A%2220230508153801%22%2C%22fundBankCode%22%3A%22OTHERS%22%2C%22fundChannel%22%3A%22OTHERS%22%2C%22goodsInfo%22%3A%22%E6%94%AF%E4%BB%98%E6%B5%8B%E8%AF%95%22%2C%22memo%22%3A%22%7B%5C%22openid%5C%22%3A%5C%22oAFzv5a67bJ0aGk7cB-RfK0Yap8s%5C%22%2C%5C%22appid%5C%22%3A%5C%22wxfbe753bb28212636%5C%22%2C%5C%22latitude%5C%22%3A%5C%2222.33%5C%22%2C%5C%22spbillCreateIp%5C%22%3A%5C%22150.158.53.11%5C%22%2C%5C%22paylimit%5C%22%3A%5C%22no_credit%5C%22%2C%5C%22longitude%5C%22%3A%5C%22171.21%5C%22%7D%22%2C%22orderAmt%22%3A%221%22%2C%22orderStatus%22%3A%22SUCCESS%22%2C%22payOrderNo%22%3A%224200001871202305087489820896%22%2C%22payType%22%3A%22WECHAT_APPLET%22%2C%22requestDate%22%3A%2220230508153751%22%2C%22respCode%22%3A%22000000%22%2C%22respMsg%22%3A%22%E4%BA%A4%E6%98%93%E6%88%90%E5%8A%9F%22%2C%22tradeNo%22%3A%2225000020230420101055003876003836%22%2C%22transNo%22%3A%22WechatPay20230508153751%22%7D&version=1.0.0&merchantNo=861002923881'
;
try
{
$ret
=
Notify
::
run
(
Config
::
HSQ_CHARGE
,
$config
,
new
TestNotify
());
...
...
examples/hsq/transferConfig.php
View file @
7c32583
...
...
@@ -53,6 +53,8 @@ return [
// 'base_url' => 'https://paytest.baofoo.com/baofoo-fopay/pay', //测试接口上线时取消注释
/* demo end */
/* 猎电 begin */
// 'member_id'=> '1272710', //商户号
// 'terminal_id' => '80808', //终端号
...
...
@@ -61,6 +63,7 @@ return [
// 'private_key_pass' => 'Ldcharge888', //私钥密码
/* 猎电 end */
/* 猎维(智能充) begin */
'member_id'
=>
'1272712'
,
//商户号
'terminal_id'
=>
'80814'
,
//终端号
...
...
src/Common/Hsq/Data/Charge/PubChargeData.php
View file @
7c32583
...
...
@@ -70,7 +70,6 @@ class PubChargeData extends ChargeBaseData
'key'
=>
$this
->
key
,
/* 公共请求参数 end */
];
$this
->
retData
=
$signData
;
}
...
...
src/Common/Hsq/Data/RefundData.php
View file @
7c32583
...
...
@@ -15,8 +15,8 @@ class RefundData extends HsqBaseData
protected
function
checkDataParam
()
{
if
(
empty
(
$this
->
transNo
)
||
mb_strlen
(
$this
->
transNo
)
>
3
0
)
throw
new
PayException
(
'商户系统退款单号不能为空且长度不能超过30位'
);
if
(
empty
(
$this
->
origTransNo
)
||
mb_strlen
(
$this
->
origTransNo
)
>
3
0
)
throw
new
PayException
(
'原商户系统订单号不能为空且长度不能超过30位'
);
if
(
empty
(
$this
->
transNo
)
||
mb_strlen
(
$this
->
transNo
)
>
3
2
)
throw
new
PayException
(
'商户系统退款单号不能为空且长度不能超过30位'
);
if
(
empty
(
$this
->
origTransNo
)
||
mb_strlen
(
$this
->
origTransNo
)
>
3
2
)
throw
new
PayException
(
'原商户系统订单号不能为空且长度不能超过30位'
);
$totalFee
=
intval
(
$this
->
origOrderAmt
??
0
);
//订单总金额
$refundFee
=
intval
(
$this
->
orderAmt
??
0
);
//退款总金额
...
...
@@ -26,23 +26,29 @@ class RefundData extends HsqBaseData
protected
function
buildData
()
{
$signContent
=
[
/* 业务请求参数 begin */
'transNo'
=>
$this
->
transNo
,
//商户订单号
'refundType'
=>
$this
->
refundType
,
//退款类型
'origTransNo'
=>
$this
->
origTransNo
,
//原商户订单号
'origOrderAmt'
=>
$this
->
origOrderAmt
,
//原订单金额
'orderAmt'
=>
intval
(
$this
->
orderAmt
),
//退款金额,单位为:分
'requestDate'
=>
$this
->
requestDate
,
//请求时间
'refundReason'
=>
$this
->
refundReason
,
//退款原因
'returnUrl'
=>
(
$this
->
returnUrl
?:
''
)
,
//后端通知地址, 用户支付完成后,慧收钱服务器主动通知商户服务器里指定地址
/* 业务请求参数 end */
];
$signData
=
[
'version'
=>
$this
->
version
,
'ins_cd'
=>
$this
->
institutionId
,
//机构号,接入机构在富友的唯一代码
'mchnt_cd'
=>
$this
->
merchantId
,
//商户号, 富友分配给二级商户的商户号
'term_id'
=>
$this
->
terminalId
??
'88888888'
,
//终端号(没有真实终端号统一填88888888)
'random_str'
=>
$this
->
randomStr
,
//随机字符串
'mchnt_order_no'
=>
$this
->
order_no
,
//商户订单号, 商户系统内部的订单号(5到30个字符、只能包含字母数字,区分大小写)
'order_type'
=>
$this
->
order_type
,
//订单类型:ALIPAY(统一下单、条码支付、服务窗支付),WECHAT(统一下单、条码支付、公众号支付),UNIONPAY,BESTPAY(翼支付)
'refund_order_no'
=>
$this
->
refund_no
,
//商户撤销单号
'total_amt'
=>
$this
->
total_fee
,
//订单总金额
'refund_amt'
=>
$this
->
refund_fee
,
//退款总金额
'operator_id'
=>
$this
->
operator_id
??
''
,
//操作员
/* 公共请求参数 begin */
'method'
=>
$this
->
method
,
//方法名
'version'
=>
$this
->
version
,
//版本
'format'
=>
$this
->
format
,
//请求格式
'merchantNo'
=>
$this
->
merchantNo
,
//商户号
'signType'
=>
$this
->
signType
,
//加密类型
'signContent'
=>
json_encode
(
$signContent
,
JSON_UNESCAPED_UNICODE
),
'key'
=>
$this
->
key
,
/* 公共请求参数 end */
];
if
(
!
empty
(
$this
->
reserved_fy_term_id
))
$signData
[
'reserved_fy_term_id'
]
=
$this
->
reserved_fy_term_id
;
//富友终端号
if
(
!
empty
(
$this
->
reserved_origi_dt
))
$signData
[
'reserved_origi_dt'
]
=
$this
->
trade_date
;
//原交易日期( yyyyMMdd )!该值必定等于reserved_fy_settle_dt(富友接收交易时间。理论和合作方下单时间一致。微量夸日交易会不一致)。不填该值支持30天内的交易进行退款。填写该值,支持90天
$this
->
retData
=
$signData
;
}
}
\ No newline at end of file
src/Common/Hsq/HsqBaseStrategy.php
View file @
7c32583
...
...
@@ -51,12 +51,9 @@ abstract class HsqBaseStrategy implements BaseStrategy
}
$body
=
http_build_query
(
$body
);
if
(
empty
(
$body
))
throw
new
PayException
(
'支付数据异常'
);
$response
=
$this
->
curlPost
(
$body
,
$url
);
if
(
$response
[
'error'
])
throw
new
PayException
(
'网络发生错误,请稍后再试curl返回码:'
.
$response
[
'message'
]);
$retData
=
json_decode
(
$response
[
'body'
],
true
);
$result
=
json_decode
(
$retData
[
'result'
],
true
);
if
(
$result
[
'orderStatus'
]
==
'FAIL'
)
throw
new
PayException
(
'支付平台返回错误提示:'
.
$result
[
'respMsg'
]);
...
...
@@ -101,13 +98,10 @@ abstract class HsqBaseStrategy implements BaseStrategy
public
function
handle
(
array
$data
)
{
$buildClass
=
$this
->
getBuildDataClass
();
$this
->
reqData
=
new
$buildClass
(
$this
->
config
,
$data
);
$this
->
reqData
->
setSign
();
$body
=
$this
->
reqData
->
getData
();
$ret
=
$this
->
sendReq
(
$body
);
$flag
=
$this
->
verifySign
(
$ret
);
if
(
!
$flag
)
{
throw
new
PayException
(
'返回数据被篡改。请检查网络是否安全!'
);
...
...
src/Common/Hsq/HsqTransBaseStrategy.php
View file @
7c32583
...
...
@@ -104,7 +104,6 @@ abstract class HsqTransBaseStrategy implements BaseStrategy
public
function
handle
(
array
$data
)
{
$buildClass
=
$this
->
getBuildDataClass
();
$this
->
reqData
=
new
$buildClass
(
$this
->
config
,
$data
);
$this
->
reqData
->
setSign
();
$body
=
$this
->
reqData
->
getData
();
...
...
src/Notify/HsqNotify.php
View file @
7c32583
...
...
@@ -43,10 +43,17 @@ class HsqNotify extends NotifyStrategy
{
//支持直接读取input流
$data
=
$_POST
[
'req'
]
??
file_get_contents
(
'php://input'
);
if
(
count
(
$data
)
<
1
){
//如果参数为空,则不进行处理
if
(
empty
(
$data
)
){
//如果参数为空,则不进行处理
return
false
;
}
return
$data
;
$tmp
=
explode
(
"&"
,
urldecode
(
$data
));
$new_data
=
array
();
foreach
(
$tmp
as
$val
)
{
$tmp2
=
explode
(
"="
,
$val
);
$new_data
[
$tmp2
[
0
]]
=
$tmp2
[
1
];
}
return
$new_data
;
}
/**
...
...
@@ -87,28 +94,28 @@ class HsqNotify extends NotifyStrategy
if
(
empty
(
$publicKey
))
return
false
;
$sign
=
$retData
[
'sign'
];
//固定格式拼接后
$signArr
=
[
'method'
=>
$retData
[
'method'
],
'version'
=>
$retData
[
'version'
],
'format'
=>
$retData
[
'format'
],
'merchantNo'
=>
$retData
[
'merchantNo'
],
'signType'
=>
$retData
[
'signType'
],
'signContent'
=>
$retData
[
'signContent'
],
'key'
=>
$key
,
];
$signStr
=
http_build_query
(
$signArr
);
$signStr
=
ArrayUtil
::
createLinkstring
(
$signArr
);
//验签
$result
=
openssl_verify
(
$signStr
,
hex2bin
(
$sign
),
$publicKey
,
OPENSSL_ALGO_SHA256
);
if
(
$result
)
{
//验签成功
return
true
;
return
true
;
//验签成功
}
else
{
else
{
return
false
;
}
}
/**
...
...
@@ -120,29 +127,38 @@ class HsqNotify extends NotifyStrategy
* @return array
* @author yeran
*/
protected
function
getRetData
(
array
$
data
)
protected
function
getRetData
(
array
$
params
)
{
if
(
$this
->
config
->
returnRaw
)
{
$data
[
'channel'
]
=
Config
::
HSQ_CHARGE
;
return
$data
;
}
return
$data
;
// $retData = [
// 'cash_fee' => $data['cash_fee'],
// 'fee_type' => $data['fee_type'],
// 'appid' => $data['sub_appid'],
// 'sub_merchant_id' => $data['sub_merchant_id'],
// 'buyer_id' => $data['sub_openid'],
// 'order_no' => $data['out_trade_sn'],//平台
// 'meepay_trade_no' => $data['meepay_trade_no'],//米付
// 'pay_time' => date('Y-m-d H:i:s', $data['pay_time']),// 支付完成时间
// 'amount' => $data['total_amount'],
// 'trade_type' => $data['trade_type'],
// 'transaction_id' => $data['transaction_id'],//微信
// 'trade_state' => strtolower($data['result_code']),
// 'channel' => Config::MI_CHARGE,
// ];
// return $retData;
$data
=
json_decode
(
$params
[
'signContent'
],
true
);
// Array
// (
// [buyerName] => oAFzv5a67bJ0aGk7cB-RfK0Yap8s //openid
// [channelOrderNo] => 23051714261110391231100016376946 //请求渠道商户订单号
// [finishedDate] => 20230517142648
// [fundBankCode] => OTHERS
// [fundChannel] => OTHERS
// [goodsInfo] => 【猎电新能源】微信充值
// [memo] => {"openid":"oAFzv5a67bJ0aGk7cB-RfK0Yap8s","appid":"wxfbe753bb28212636","latitude":"22.33","spbillCreateIp":"150.158.53.11","paylimit":"no_credit","longitude":"171.21"}
// [orderAmt] => 3000
// [orderStatus] => SUCCESS
// [payOrderNo] => 4200001872202305170697281261 //渠道交易单号(支付宝/微信/银联返回的交易号)
// [payType] => WECHAT_APPLET
// [requestDate] => 20230517142644
// [respCode] => 000000
// [respMsg] => 交易成功
// [tradeNo] => 25000020230420100923003888927786 //交易订单号(慧收钱系统交易订单号)
// [transNo] => 20230517142644095535524955535120 //商户订单号(原支付交易对应的商户订单号)
// )
$retData
=
[
'openid'
=>
$data
[
'buyerName'
],
'order_no'
=>
$data
[
'transNo'
],
'transaction_id'
=>
$data
[
'tradeNo'
],
'amount'
=>
$data
[
'orderAmt'
],
'outtrxid'
=>
$data
[
'channelOrderNo'
],
'chnltrxid'
=>
$data
[
'payOrderNo'
],
'channel'
=>
Config
::
HSQ_CHARGE
,
];
return
$retData
;
}
/**
...
...
src/Notify/HsqTransferNotify.php
View file @
7c32583
...
...
@@ -5,6 +5,7 @@ use Payment\Common\PayException;
use
Payment\Common\HsqTransConfig
;
use
Payment\Config
;
use
Payment\Utils\BaoFooRsaUtil
;
use
Payment\Utils\DataParser
;
/**
...
...
@@ -24,7 +25,6 @@ class HsqTransferNotify extends NotifyStrategy
public
function
__construct
(
array
$config
)
{
parent
::
__construct
(
$config
);
try
{
$this
->
config
=
new
HsqTransConfig
(
$config
);
}
catch
(
PayException
$e
)
{
...
...
@@ -44,7 +44,14 @@ class HsqTransferNotify extends NotifyStrategy
if
(
empty
(
$data
)){
//如果参数为空,则不进行处理
return
false
;
}
return
$data
;
$tmp
=
explode
(
"&"
,
urldecode
(
$data
));
$result_data
=
array
();
foreach
(
$tmp
as
$val
)
{
$tmp2
=
explode
(
"="
,
$val
);
$result_data
[
$tmp2
[
0
]]
=
$tmp2
[
1
];
}
return
$result_data
;
}
/**
...
...
@@ -69,18 +76,16 @@ class HsqTransferNotify extends NotifyStrategy
protected
function
verifySign
(
array
$retData
)
{
if
(
empty
(
$this
->
config
->
publicKey
))
return
false
;
$publicKey
=
$this
->
config
->
publicKey
;
$retData
=
$retData
[
'
sign
'
];
$retData
=
$retData
[
'
data_content
'
];
//解密
$decrypt
=
BaoFooRsaUtil
::
decryptByCERFile
(
$retData
,
$publicKey
);
$result
=
json_decode
(
$decrypt
,
true
);
print_r
(
$result
);
die
;
$data_content
=
DataParser
::
toArray
(
$decrypt
);
$result
=
$data_content
[
'trans_reqDatas'
][
'trans_reqData'
]
??
''
;
if
(
$result
)
{
//验签成功
return
true
;
return
$result
;
}
else
{
return
false
;
...
...
@@ -99,27 +104,10 @@ class HsqTransferNotify extends NotifyStrategy
*/
protected
function
getRetData
(
array
$data
)
{
if
(
$this
->
config
->
returnRaw
)
{
$data
[
'channel'
]
=
Config
::
HSQ_CHARGE
;
return
$data
;
}
return
$data
;
// $retData = [
// 'cash_fee' => $data['cash_fee'],
// 'fee_type' => $data['fee_type'],
// 'appid' => $data['sub_appid'],
// 'sub_merchant_id' => $data['sub_merchant_id'],
// 'buyer_id' => $data['sub_openid'],
// 'order_no' => $data['out_trade_sn'],//平台
// 'meepay_trade_no' => $data['meepay_trade_no'],//米付
// 'pay_time' => date('Y-m-d H:i:s', $data['pay_time']),// 支付完成时间
// 'amount' => $data['total_amount'],
// 'trade_type' => $data['trade_type'],
// 'transaction_id' => $data['transaction_id'],//微信
// 'trade_state' => strtolower($data['result_code']),
// 'channel' => Config::MI_CHARGE,
// ];
// return $retData;
$retData
=
$data
;
$retData
[
'amount'
]
=
bcmul
(
$data
[
'trans_money'
]
??
0
,
100
);
//转账金额
$retData
[
'channel'
]
=
Config
::
HSQ_TRANSFER
;
return
$retData
;
}
/**
...
...
src/Notify/NotifyStrategy.php
View file @
7c32583
...
...
@@ -46,12 +46,13 @@ abstract class NotifyStrategy
// 检查异步通知返回的数据是否有误
$checkRet
=
$this
->
checkNotifyData
(
$notifyData
);
//
if ($checkRet === false) {// 失败,就返回错误
//
return $this->replyNotify(false, '返回数据验签失败,可能数据被篡改');
//
}
if
(
$checkRet
===
false
)
{
// 失败,就返回错误
return
$this
->
replyNotify
(
false
,
'返回数据验签失败,可能数据被篡改'
);
}
// 回调商户的业务逻辑
$flag
=
$this
->
callback
(
$notify
,
$notifyData
);
$flag
=
$this
->
callback
(
$notify
,
$checkRet
);
if
(
$flag
)
{
$msg
=
'OK'
;
}
else
{
...
...
src/Query/Hsq/HsqTransferQuery.php
View file @
7c32583
...
...
@@ -43,7 +43,6 @@ class HsqTransferQuery extends HsqTransBaseStrategy
protected
function
retData
(
array
$ret
)
{
$head
=
$ret
[
'trans_content'
][
'trans_head'
];
$data
=
$ret
[
'trans_content'
][
'trans_reqDatas'
][
0
][
'trans_reqData'
];
if
(
$head
[
'return_code'
]
!=
'0000'
)
{
$retData
=
[
...
...
@@ -54,6 +53,7 @@ class HsqTransferQuery extends HsqTransBaseStrategy
}
else
{
$data
=
$ret
[
'trans_content'
][
'trans_reqDatas'
][
0
][
'trans_reqData'
];
$retData
=
[
'is_success'
=>
'T'
,
'response'
=>
[
...
...
src/Refund/HsqRefund.php
View file @
7c32583
...
...
@@ -46,15 +46,7 @@ class HsqRefund extends HsqBaseStrategy
*/
protected
function
retData
(
array
$data
)
{
$backData
=
[
'order_type'
=>
$data
[
'order_type'
]
??
''
,
//订单类型
'order_no'
=>
$data
[
'mchnt_order_no'
]
??
''
,
//原交易商户订单号
'refund_no'
=>
$data
[
'refund_order_no'
]
??
''
,
//商户退款单号
'out_trade_no'
=>
$data
[
'transaction_id'
]
??
''
,
//渠道交易流水号
'out_refund_no'
=>
$data
[
'refund_id'
]
??
''
,
//渠道撤销流水号
'refund_fee'
=>
$data
[
'reserved_refund_amt'
]
??
0
,
//退款金额
'other'
=>
$data
];
$backData
=
json_decode
(
$data
[
'result'
]
,
true
);
return
$backData
;
}
...
...
src/Trans/HsqTransfer.php
View file @
7c32583
...
...
@@ -43,13 +43,15 @@ class HsqTransfer extends HsqTransBaseStrategy
protected
function
retData
(
array
$ret
)
{
$head
=
$ret
[
'trans_content'
][
'trans_head'
];
$data
=
$ret
[
'trans_content'
][
'trans_reqDatas'
][
0
][
'trans_reqData'
];
$data
=
$ret
[
'trans_content'
][
'trans_reqDatas'
][
0
][
'trans_reqData'
]
??
''
;
if
(
$head
[
'return_code'
]
!=
'0000'
)
{
$retData
=
[
'is_success'
=>
'F'
,
'error'
=>
$head
[
'return_msg'
],
'channel'
=>
Config
::
HSQ_TRANSFER
,
'response'
=>
[
'error'
=>
$head
[
'return_msg'
],
'channel'
=>
Config
::
HSQ_TRANSFER
,
],
];
}
else
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment