mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2026-06-07 02:12:25 +08:00
细节优化
This commit is contained in:
@ -61,16 +61,21 @@ class Wechat
|
||||
{
|
||||
return 'session key不存在';
|
||||
}
|
||||
$aes_key = base64_decode($session_data['session_key']);
|
||||
|
||||
|
||||
// iv长度
|
||||
if(strlen($iv) != 24)
|
||||
{
|
||||
return 'iv长度错误';
|
||||
}
|
||||
$aes_iv = base64_decode($iv);
|
||||
|
||||
// 加密函数
|
||||
if(!function_exists('openssl_decrypt'))
|
||||
{
|
||||
return 'openssl不支持';
|
||||
}
|
||||
|
||||
$aes_cipher = base64_decode($encrypted_data);
|
||||
$result = openssl_decrypt($aes_cipher, "AES-128-CBC", $aes_key, 1, $aes_iv);
|
||||
$result = openssl_decrypt($aes_cipher, "AES-128-CBC", base64_decode($session_data['session_key']), 1, base64_decode($iv));
|
||||
$data = json_decode($result, true);
|
||||
if($data == NULL)
|
||||
{
|
||||
|
||||
@ -126,6 +126,12 @@ class PayEase
|
||||
return DataReturn('密钥证书未配置', -1);
|
||||
}
|
||||
|
||||
// 加密函数
|
||||
if(!function_exists('openssl_decrypt'))
|
||||
{
|
||||
return DataReturn('openssl不支持', -1);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'merchantId' => $this->config['merchantId'],
|
||||
'orderAmount' => $params['total_price']*100,
|
||||
|
||||
Reference in New Issue
Block a user