From 986457d74fb57a6f595942c54064f67ca23c289f Mon Sep 17 00:00:00 2001 From: dutsc <1020018707@qq.com> Date: Wed, 16 Aug 2023 13:33:56 +0800 Subject: [PATCH] wxnotify --- mobile/source/helpers/dalianpay/library/Crypt.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mobile/source/helpers/dalianpay/library/Crypt.php b/mobile/source/helpers/dalianpay/library/Crypt.php index d5904af..01f603b 100644 --- a/mobile/source/helpers/dalianpay/library/Crypt.php +++ b/mobile/source/helpers/dalianpay/library/Crypt.php @@ -57,8 +57,16 @@ class Crypt // 升序排列 ksort($data); // 转字符串 - $pre_sign_str = http_build_query($data,null,'&'); + // $pre_sign_str = http_build_query($data,null,'&'); // $pre_sign_str = $data . ''; + // 构建排序后的字符串 + $pre_sign_str = ''; + foreach ($data as $key => $value) { + $sortedString .= $key . '=' . $value . '&'; + } + + // 移除末尾的多余字符 + $pre_sign_str = rtrim($sortedString, '&'); echo "[pre_sign_str(jiao yi message)]: {$pre_sign_str}"; // die();