Commit a2242df4e4951cb4cf8ec4b94b87773b97211dc3

Authored by jiyue
2 parents 1df833f9 344d2df3

Merge branch 'cn/develop' into cn/publish/release

src/actions/StoreAction.lua
1 1 local _M = {}
2 2  
3 3 local md5 = require "md5"
  4 +local httpc = require("http.httpc")
4 5  
5 6 -- 入口在正式服关闭 -- mock 充值
6 7 function _M.rechargeRpc(agent , data)
... ... @@ -282,9 +283,33 @@ function _M.dyhxAndroidRechargeRpc(agent, data)
282 283 end
283 284  
284 285 local rechargeHandler = {
285   - ali = function(cp_order_id, rechargeId, result)
  286 + ali = function(cp_order_id, rechargeId, cfg, result)
  287 + local codeurl = skynet.getenv("codeurl")
  288 + local content = {
  289 + ["paytype"] = "alipay",
  290 + ["rechargeid"] = rechargeId,
  291 + ["order"] = cp_order_id,
  292 + ["title"] = cfg.title,
  293 + ["rmb"] = cfg.rmb,
  294 + }
  295 + local status, body = httpc.get(codeurl, "/payorder?" .. httpGetFormatData(content), {})
  296 + if status == 200 then
  297 + result["orderInfo"] = body
  298 + end
286 299 end,
287   - wx = function(cp_order_id, rechargeId, result)
  300 + wx = function(cp_order_id, rechargeId, cfg, result)
  301 + local codeurl = skynet.getenv("codeurl")
  302 + local content = {
  303 + ["paytype"] = "wxpay",
  304 + ["rechargeid"] = rechargeId,
  305 + ["order"] = cp_order_id,
  306 + ["title"] = cfg.title,
  307 + ["rmb"] = cfg.rmb,
  308 + }
  309 + local status, body = httpc.get(codeurl, "/payorder?" .. httpGetFormatData(content), {})
  310 + if status == 200 then
  311 + result["orderInfo"] = body
  312 + end
288 313 end,
289 314 }
290 315  
... ... @@ -306,10 +331,11 @@ function _M.getCpOrderIdRpc(agent, data)
306 331 result["order"] = partnerOrderId
307 332 local handler = rechargeHandler[type]
308 333 if handler then
309   - handler(partnerOrderId, id, result)
  334 + handler(partnerOrderId, id, dataSet, result)
310 335 end
311 336  
312 337 SendPacket(actionCodes.Store_getCpOrderIdRpc, MsgPack.pack(result))
  338 + return true
313 339 end
314 340  
315 341  
... ...
src/models/RolePlugin.lua
... ... @@ -2429,7 +2429,7 @@ function RolePlugin.bind(Role)
2429 2429 end
2430 2430 local rechargeId = back
2431 2431 local rechargeData = csvdb["shop_rechargeCsv"][rechargeId]
2432   - if params.amount == 0 then
  2432 + if tonumber(params.amount) == 0 then
2433 2433 if params.product_id ~= rechargeData.iap_product_id then
2434 2434 skynet.error(string.format("[recharge] fake order: %s, roleId: %d, order: %s, rmb %s, get %s",
2435 2435 params.transactionId, roleId, partnerOrderStr, rechargeData.iap_product_id, params.product_id
... ...
src/services/dbseed.lua
... ... @@ -33,7 +33,7 @@ local function initRedisDb( ... )
33 33 return
34 34 end
35 35 local redisVal = tonum(redisproxy:hget(tbName, keyName))
36   - if redisVal < mysqlVal then
  36 + if redisVal < mysqlVal or redisVal == 0 then
37 37 redisproxy:hset(tbName, keyName, mysqlVal)
38 38 end
39 39 end
... ...