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()