Commit 8ba57e2c5c8cc592a938170321c75b64728ba427
1 parent
e130015d
云游戏的充值消息
Showing
2 changed files
with
27 additions
and
0 deletions
Show diff stats
src/ProtocolCode.lua
... | ... | @@ -206,6 +206,7 @@ actionCodes = { |
206 | 206 | Store_getExploreCommandRewardRpc = 563, --探索指令 |
207 | 207 | Store_getTotalRechargeAwardRpc = 564, -- 累计充值 |
208 | 208 | |
209 | + Store_biliCloudRechargeRpc = 596, | |
209 | 210 | Store_biliAndroidRechargeRpc = 597, |
210 | 211 | Store_biliCpsRechargeRpc = 598, |
211 | 212 | Store_biliUoRechargeRpc = 599, | ... | ... |
src/actions/StoreAction.lua
... | ... | @@ -130,6 +130,32 @@ function _M.biliUoRechargeRpc(agent, data) |
130 | 130 | return true |
131 | 131 | end |
132 | 132 | |
133 | +-- 云游戏sdk充值 | |
134 | +function _M.biliCloudRechargeRpc(agent, data) | |
135 | + local role = agent.role | |
136 | + local msg = MsgPack.unpack(data) | |
137 | + local id = msg.id | |
138 | + local dataSet = csvdb["shop_rechargeCsv"][id] | |
139 | + if not dataSet then return end | |
140 | + local roleId = role:getProperty("id") | |
141 | + | |
142 | + role.ignoreHeartbeat = true | |
143 | + --创建订单号 | |
144 | + local partnerOrderId = role:getPurchaseOrder(id) | |
145 | + -- 签名 | |
146 | + local secret_key = "c97a19c2c00143d6b0f0da2bc52208e7" | |
147 | + local need = { | |
148 | + out_trade_no = partnerOrderId, | |
149 | + money = dataSet.rmb * 100, | |
150 | + game_money = dataSet.diamond, | |
151 | + notify_url = msg.notifyUrl | |
152 | + } | |
153 | + local sign = signPms(need, secret_key) | |
154 | + | |
155 | + SendPacket(actionCodes.Store_biliCloudRechargeRpc, MsgPack.pack({ order = partnerOrderId, sign = sign})) | |
156 | + return true | |
157 | +end | |
158 | + | |
133 | 159 | -- google 充值 入口 |
134 | 160 | function _M.googleRechargeRpc(agent, data) |
135 | 161 | local role = agent.role | ... | ... |