Commit b35c0d0bc7f79502653a939c5f32c9c27606d36f
Merge remote-tracking branch 'origin/cn/develop' into cn/develop
Showing
1 changed file
with
15 additions
and
2 deletions
Show diff stats
src/actions/StoreAction.lua
| ... | ... | @@ -52,6 +52,19 @@ local function signPms(params, secret_key) |
| 52 | 52 | return md5.sumhexa(urlCode .. secret_key):lower() |
| 53 | 53 | end |
| 54 | 54 | |
| 55 | +local function signDyhPms(params, secret_key) | |
| 56 | + local keys = table_keys(params) | |
| 57 | + table.sort(keys) | |
| 58 | + local str2Sign = "" | |
| 59 | + for index, key in ipairs(keys) do | |
| 60 | + if str2Sign ~= "" then | |
| 61 | + str2Sign = str2Sign .. '&' | |
| 62 | + end | |
| 63 | + str2Sign = str2Sign .. string.format("%s=%s", key, params[key]) | |
| 64 | + end | |
| 65 | + return md5.sumhexa(str2Sign .. secret_key):lower() | |
| 66 | +end | |
| 67 | + | |
| 55 | 68 | -- bili android 充值 入口 |
| 56 | 69 | function _M.biliAndroidRechargeRpc(agent, data) |
| 57 | 70 | local role = agent.role |
| ... | ... | @@ -226,7 +239,7 @@ function _M.iosRechargeRpc(agent, data) |
| 226 | 239 | --创建订单号 |
| 227 | 240 | local partnerOrderId = role:getPurchaseOrder(id,nil,choose) |
| 228 | 241 | -- 签名 |
| 229 | - local secret_key = "1916d62251dd4a8aa5e452121eefc9a1" | |
| 242 | + local secret_key = "2b2036e1f44640a59168c92462714870" | |
| 230 | 243 | local need = { |
| 231 | 244 | out_trade_no = partnerOrderId, |
| 232 | 245 | money = dataSet.rmb * 100, |
| ... | ... | @@ -234,7 +247,7 @@ function _M.iosRechargeRpc(agent, data) |
| 234 | 247 | product_id = dataSet.iap_product_id, |
| 235 | 248 | notify_url = msg.notifyUrl |
| 236 | 249 | } |
| 237 | - local sign = signPms(need, secret_key) | |
| 250 | + local sign = signDyhPms(need, secret_key) | |
| 238 | 251 | |
| 239 | 252 | SendPacket(actionCodes.Store_iosRechargeRpc, MsgPack.pack({ order = partnerOrderId, sign = sign})) |
| 240 | 253 | return true | ... | ... |