diff --git a/third_party/phpcommon b/third_party/phpcommon index f401b4f..7ecf558 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit f401b4f89a47b3f4d2835a647d68ad11deac9275 +Subproject commit 7ecf558df93a2656631782e76c6d35697da72808 diff --git a/webapp/controller/PayController.class.php b/webapp/controller/PayController.class.php index 8e9d622..e77c40c 100644 --- a/webapp/controller/PayController.class.php +++ b/webapp/controller/PayController.class.php @@ -412,10 +412,22 @@ class PayController{ $itemid = $_REQUEST['itemid']; $itemnum = $_REQUEST['itemnum']; + $params = array( + 'account_id' => $_REQUEST['account_id'], + 'itemid' => 1, + 'itemnum' => 1, + 'price' => 0.01 + ); + $timestamp = time(); + $params['sign'] = phpcommon\md5Sign($params, '06ba97e28ea905b0b7ed5477746b07f1', $timestamp); + $params['timestamp'] = $timestamp; + $iv = 'wx1dd2f605f4f8496b'; + $key = 'c868a478c81ff3c168b35d703f787d3c'; + $str_encoded = '2001_' . base64_encode(phpcommon\aesEncrypt(json_encode($params), $iv, $key)); echo json_encode(array( 'errcode' => 0, 'errmsg'=> '', - 'data' => 'hello' + 'data' => $str_encoded )); } }