Commit 8ae04b5aaf0eed8dadb4165bb6b34b97ddb28652
1 parent
54833afe
mycard
Showing
1 changed file
with
24 additions
and
0 deletions
Show diff stats
src/actions/StoreAction.lua
| ... | ... | @@ -91,6 +91,30 @@ function _M.googleRechargeRpc(agent, data) |
| 91 | 91 | return true |
| 92 | 92 | end |
| 93 | 93 | |
| 94 | +-- mycard 充值 入口 | |
| 95 | +function _M.myCardRechargeRpc(agent, data) | |
| 96 | + local role = agent.role | |
| 97 | + local msg = MsgPack.unpack(data) | |
| 98 | + local id = msg.id | |
| 99 | + local dataSet = csvdb["shop_rechargeCsv"][id] | |
| 100 | + if not dataSet then return end | |
| 101 | + local roleId = role:getProperty("id") | |
| 102 | + | |
| 103 | + role.ignoreHeartbeat = true | |
| 104 | + --创建订单号 | |
| 105 | + local partnerOrderId = makeOrder(roleId, id) | |
| 106 | + -- 签名 | |
| 107 | + local secret_key = "48759e07540f46d9af17ec82669b4272" | |
| 108 | + local need = { | |
| 109 | + out_trade_no = partnerOrderId, | |
| 110 | + money = dataSet.rmb, | |
| 111 | + game_money = dataSet.diamond, | |
| 112 | + } | |
| 113 | + local sign = signPms(need, secret_key) | |
| 114 | + | |
| 115 | + SendPacket(actionCodes.Store_googleRechargeRpc, MsgPack.pack({ order = partnerOrderId, sign = sign})) | |
| 116 | + return true | |
| 117 | +end | |
| 94 | 118 | |
| 95 | 119 | function _M.purchaseOrderResult(agent, data) |
| 96 | 120 | local role = agent.role | ... | ... |