From 935db93ac884d7c5a6fe8ccb2bc6df4e3d70e1bc Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 2 Aug 2023 16:28:33 +0800 Subject: [PATCH] 1 --- webapp/controller/ShopController.class.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index bd4eb789..86de9285 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -211,6 +211,7 @@ class ShopController extends BaseAuthedController { return; } + $secretKey = 'e58f(1dcf22245985c21ff31f2f66ec4a^^TDAFF(Adaf)'; $nowTime = myself()->_getNowTime(); $fiatAmount = $goodsMeta['price']; $orderId = OrderId::gen(); @@ -226,6 +227,21 @@ class ShopController extends BaseAuthedController { $orderId, $nowTime ); + /* + 签名方式:将所有的参数用&连接起来做md5加secret_key + */ + $signStr = implode("&", $params); + $sign = md5($signStr . $secretKey); + array_push( + $params, + $sign + ); + myself()->_rspData( + array( + 'order_id' => $orderId, + 'params' => $params + ) + ); } public function queryInAppBalance()