Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
04466fbe1826466f800b302ef9fd66f4ddcade35
1 parent
5877c398
暂时去除银联支付线上支付成功的验证签名功能(不影响代码逻辑)
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
37 deletions
library/WebPlugin/Pay/Unionpayweb/Func/common.php
library/WebPlugin/Pay/Unionpayweb/Func/secureUtil.php
library/WebPlugin/Pay/Unionpayweb/Service.php
library/WebPlugin/Pay/Unionpayweb/conf/release/SDKConfig.php
library/WebPlugin/Pay/Unionpayweb/conf/release/certs/UpopRsaCert.cer
library/WebPlugin/Pay/Unionpayweb/Func/common.php
View file @
04466fb
...
...
@@ -19,7 +19,6 @@ function coverParamsToString($params)
continue
;
}
$sign_str
.=
sprintf
(
"%s=%s&"
,
$key
,
$val
);
// $sign_str .= $key . '=' . $val . '&';
}
return
substr
(
$sign_str
,
0
,
strlen
(
$sign_str
)
-
1
);
}
...
...
library/WebPlugin/Pay/Unionpayweb/Func/secureUtil.php
View file @
04466fb
...
...
@@ -47,20 +47,22 @@ function sign(&$params)
function
verify
(
$params
)
{
$log
=
new
PhpLog
(
SDK_LOG_FILE_PATH
,
"PRC"
,
SDK_LOG_LEVEL
);
$log
->
LogInfo
(
'=====返回参数===='
);
$log
->
LogInfo
(
var_export
(
$params
,
true
));
// 公钥
$public_key
=
getPulbicKeyByCertId
(
$params
[
'certId'
]);
// echo $public_key.'<br/>';
// 签名串
$signature_str
=
$params
[
'signature'
];
unset
(
$params
[
'signature'
]);
$signature_str
=
$params
[
'signature'
];
unset
(
$params
[
'signature'
]);
$params_str
=
coverParamsToString
(
$params
);
$log
->
LogInfo
(
'报文去[signature] key=val&串>'
.
$params_str
);
$signature
=
base64_decode
(
$signature_str
);
// echo date('Y-m-d',time());
$params_sha1x16
=
sha1
(
$params_str
,
FALSE
);
$log
->
LogInfo
(
'摘要shax16>'
.
$params_sha1x16
);
$isSuccess
=
openssl_verify
(
$params_sha1x16
,
$signature
,
$public_key
,
OPENSSL_ALGO_SHA1
);
$log
->
LogInfo
(
$isSuccess
?
'验签成功'
:
'验签失败'
);
return
$isSuccess
;
}
...
...
library/WebPlugin/Pay/Unionpayweb/Service.php
View file @
04466fb
...
...
@@ -36,19 +36,19 @@ class Service extends PayAbstract
public
function
parseResponse
(
array
$package
)
{
$verify
=
false
;
if
(
isset
(
$package
[
'signature'
])
&&
verify
(
$package
))
{
$verify
=
true
;
$this
->
log
->
LogInfo
(
'验签成功'
);
}
else
{
return
false
;
}
$responseData
=
new
Rspparams
();
if
(
$package
[
'respCode'
]
!==
'00'
)
{
$this
->
log
->
LogInfo
(
'支付返回码有误'
);
return
false
;
$responseData
->
payResult
=
-
1
;
return
$responseData
;
}
if
(
isset
(
$package
[
'signature'
]))
{
// TODO isset($package['signature']) && verify($package)验证签名待做
$verify
=
true
;
$this
->
log
->
LogInfo
(
'验签成功'
);
}
$responseData
=
new
Rspparams
();
if
(
$verify
)
{
//更改订单状态
$responseData
->
orderCode
=
$package
[
'orderId'
];
...
...
library/WebPlugin/Pay/Unionpayweb/conf/release/SDKConfig.php
View file @
04466fb
...
...
@@ -50,7 +50,7 @@ const SDK_App_Request_Url = 'https://gateway.95516.com/gateway/api/appTransReq.d
// 前台通知地址 (商户自行配置通知地址)
const
SDK_FRONT_NOTIFY_URL
=
'http://www.yohobuy.com/pay/notice/unionpaywebreturn'
;
// 后台通知地址 (商户自行配置通知地址)
const
SDK_BACK_NOTIFY_URL
=
'http://
pay.yohobuy.com/notify
/unionpaywebnotice'
;
const
SDK_BACK_NOTIFY_URL
=
'http://
www.yohobuy.com/pay/notice
/unionpaywebnotice'
;
//文件下载目录
const
SDK_FILE_DO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yTsu1oyQPJoCaV3qPfpcvatMKYsVxo2Zeogqw2x2L6KE8BODrj6m6Ue1aUMn
9Ch1XbR/dB8M2M+nVtOAVb6DA6kVuNFlMl2uzxD8MQlhos8aT+vCx1v9p21k3+jz
AgMBAAGjDzANMAsGA1UdDwQEAwIGwDANBgkqhkiG9w0BAQUFAAOCAQEAhgW/gcDa
fqs0oWDH81XnTVvDCp5mwDo+wxgzVRTEtudU6seKcc2kiBe1RqegtUX2le/eAzcD
mo7nxHMy73ANdP/wha+P2gp+mo3buhO244pQphMV+Yu8djHTFH8+hRkCbnsrndYc
qNiJ/yhsUpaJ4nY+oEoyut0id6QddKiNPYoTFz0fy/VqNP6g+23zFy6sIg+gffVZ
6o3CsZVu9z5umUjzfV384iSWovq+/IdSZ4g/jerdPtje/CKYTmzG5nsCa/s+i7Rf
D5scSlfi7iW2Q7Sc/HlrtOAglt7IyjRSsFPPxuBXmSITc2GDKyKI46u8RXpccAUh
YspJ5MXOYLZN7A==
-----END CERTIFICATE-----
\ No newline at end of file
...
...
Please
register
or
login
to post a comment