Commit 9e25c63d35b00726f9ce8f4a352fed5f8c530471

Authored by zhouhaihai
1 parent e629295d

iospay

Showing 2 changed files with 27 additions and 0 deletions   Show diff stats
src/ProtocolCode.lua
... ... @@ -178,6 +178,7 @@ actionCodes = {
178 178 Store_purchaseOrderResult = 554,
179 179 Store_ayncPurchaseRpc = 555,
180 180 Store_myCardRechargeRpc = 556,
  181 + Store_iosRechargeRpc = 557,
181 182  
182 183  
183 184 Email_listRpc = 600,
... ...
src/actions/StoreAction.lua
... ... @@ -116,6 +116,32 @@ function _M.myCardRechargeRpc(agent, data)
116 116 return true
117 117 end
118 118  
  119 +-- mycard 充值 入口
  120 +function _M.iosRechargeRpc(agent, data)
  121 + local role = agent.role
  122 + local msg = MsgPack.unpack(data)
  123 + local id = msg.id
  124 + local dataSet = csvdb["shop_rechargeCsv"][id]
  125 + if not dataSet then return end
  126 + local roleId = role:getProperty("id")
  127 +
  128 + role.ignoreHeartbeat = true
  129 + --创建订单号
  130 + local partnerOrderId = makeOrder(roleId, id)
  131 + -- 签名
  132 + local secret_key = "9647d2efe1074c73b9ac19af4337a70e"
  133 + local need = {
  134 + out_trade_no = partnerOrderId,
  135 + money = dataSet.rmb,
  136 + game_money = dataSet.diamond,
  137 + product_id = dataSet.productId,
  138 + }
  139 + local sign = signPms(need, secret_key)
  140 +
  141 + SendPacket(actionCodes.Store_iosRechargeRpc, MsgPack.pack({ order = partnerOrderId, sign = sign}))
  142 + return true
  143 +end
  144 +
119 145 function _M.purchaseOrderResult(agent, data)
120 146 local role = agent.role
121 147  
... ...