Commit 19c418d9d1fac35708fb0a7b41ae0d7c3019a234
1 parent
814c57b1
bili-android渠道的充值方法,先临时用改造后的google
Showing
1 changed file
with
25 additions
and
0 deletions
Show diff stats
src/actions/StoreAction.lua
@@ -78,6 +78,31 @@ local function signPms(params, secret_key) | @@ -78,6 +78,31 @@ local function signPms(params, secret_key) | ||
78 | return md5.sumhexa(urlCode .. secret_key):lower() | 78 | return md5.sumhexa(urlCode .. secret_key):lower() |
79 | end | 79 | end |
80 | 80 | ||
81 | +-- bili android 充值 入口 | ||
82 | +function _M.biliAndroidRechargeRpc(agent, data) | ||
83 | + local role = agent.role | ||
84 | + local msg = MsgPack.unpack(data) | ||
85 | + local id = msg.id | ||
86 | + local dataSet = csvdb["shop_rechargeCsv"][id] | ||
87 | + if not dataSet then return end | ||
88 | + local roleId = role:getProperty("id") | ||
89 | + | ||
90 | + role.ignoreHeartbeat = true | ||
91 | + --创建订单号 | ||
92 | + local partnerOrderId = makeOrder(roleId, id) | ||
93 | + -- 签名 | ||
94 | + local secret_key = "8920e9dcf0cb4ebca87393ce48021ead" | ||
95 | + local need = { | ||
96 | + out_trade_no = partnerOrderId, | ||
97 | + money = dataSet.rmb * 100, | ||
98 | + game_money = dataSet.diamond, | ||
99 | + notify_url = msg.notifyUrl | ||
100 | + } | ||
101 | + local sign = signPms(need, secret_key) | ||
102 | + | ||
103 | + SendPacket(actionCodes.Store_biliAndroidRechargeRpc, MsgPack.pack({ order = partnerOrderId, sign = sign})) | ||
104 | + return true | ||
105 | +end | ||
81 | 106 | ||
82 | -- google 充值 入口 | 107 | -- google 充值 入口 |
83 | function _M.googleRechargeRpc(agent, data) | 108 | function _M.googleRechargeRpc(agent, data) |