Commit 7a3a7fff2399348ff9863d2c674e315f68b27277
1 parent
f7b71a6b
支付协议号
Showing
2 changed files
with
59 additions
and
5 deletions
Show diff stats
src/ProtocolCode.lua
| @@ -202,7 +202,9 @@ actionCodes = { | @@ -202,7 +202,9 @@ actionCodes = { | ||
| 202 | Store_getGrowFundRewardRpc = 561, --成长助力奖励 | 202 | Store_getGrowFundRewardRpc = 561, --成长助力奖励 |
| 203 | Store_getBattlePassRewardRpc = 562, --赛季卡奖励 | 203 | Store_getBattlePassRewardRpc = 562, --赛季卡奖励 |
| 204 | Store_getExploreCommandRewardRpc = 563, --探索指令 | 204 | Store_getExploreCommandRewardRpc = 563, --探索指令 |
| 205 | - | 205 | + Store_biliAndroidRechargeRpc = 564, |
| 206 | + Store_biliCpsRechargeRpc = 565, | ||
| 207 | + Store_biliUoRechargeRpc = 566, | ||
| 206 | 208 | ||
| 207 | Email_listRpc = 600, | 209 | Email_listRpc = 600, |
| 208 | Email_drawAllAttachRpc = 601, | 210 | Email_drawAllAttachRpc = 601, |
src/actions/StoreAction.lua
| @@ -60,7 +60,7 @@ function _M.biliAndroidRechargeRpc(agent, data) | @@ -60,7 +60,7 @@ function _M.biliAndroidRechargeRpc(agent, data) | ||
| 60 | 60 | ||
| 61 | role.ignoreHeartbeat = true | 61 | role.ignoreHeartbeat = true |
| 62 | --创建订单号 | 62 | --创建订单号 |
| 63 | - local partnerOrderId = makeOrder(roleId, id) | 63 | + local partnerOrderId = role:getPurchaseOrder(id) |
| 64 | -- 签名 | 64 | -- 签名 |
| 65 | local secret_key = "8920e9dcf0cb4ebca87393ce48021ead" | 65 | local secret_key = "8920e9dcf0cb4ebca87393ce48021ead" |
| 66 | local need = { | 66 | local need = { |
| @@ -75,6 +75,58 @@ function _M.biliAndroidRechargeRpc(agent, data) | @@ -75,6 +75,58 @@ function _M.biliAndroidRechargeRpc(agent, data) | ||
| 75 | return true | 75 | return true |
| 76 | end | 76 | end |
| 77 | 77 | ||
| 78 | +-- 享游sdk充值 | ||
| 79 | +function _M.cpsRechargeRpc(agent, data) | ||
| 80 | + local role = agent.role | ||
| 81 | + local msg = MsgPack.unpack(data) | ||
| 82 | + local id = msg.id | ||
| 83 | + local dataSet = csvdb["shop_rechargeCsv"][id] | ||
| 84 | + if not dataSet then return end | ||
| 85 | + local roleId = role:getProperty("id") | ||
| 86 | + | ||
| 87 | + role.ignoreHeartbeat = true | ||
| 88 | + --创建订单号 | ||
| 89 | + local partnerOrderId = role:getPurchaseOrder(id) | ||
| 90 | + -- 签名 | ||
| 91 | + local secret_key = "d69365fe15144af990065443749f0f1b" | ||
| 92 | + local need = { | ||
| 93 | + out_trade_no = partnerOrderId, | ||
| 94 | + money = dataSet.rmb * 100, | ||
| 95 | + game_money = dataSet.diamond, | ||
| 96 | + notify_url = msg.notifyUrl | ||
| 97 | + } | ||
| 98 | + local sign = signPms(need, secret_key) | ||
| 99 | + | ||
| 100 | + SendPacket(actionCodes.Store_cpsRechargeRpc, MsgPack.pack({ order = partnerOrderId, sign = sign})) | ||
| 101 | + return true | ||
| 102 | +end | ||
| 103 | + | ||
| 104 | +-- 享游sdk充值 | ||
| 105 | +function _M.uoRechargeRpc(agent, data) | ||
| 106 | + local role = agent.role | ||
| 107 | + local msg = MsgPack.unpack(data) | ||
| 108 | + local id = msg.id | ||
| 109 | + local dataSet = csvdb["shop_rechargeCsv"][id] | ||
| 110 | + if not dataSet then return end | ||
| 111 | + local roleId = role:getProperty("id") | ||
| 112 | + | ||
| 113 | + role.ignoreHeartbeat = true | ||
| 114 | + --创建订单号 | ||
| 115 | + local partnerOrderId = role:getPurchaseOrder(id) | ||
| 116 | + -- 签名 | ||
| 117 | + local secret_key = "4243b5fb44b64175a20a53dcfb1346eb" | ||
| 118 | + local need = { | ||
| 119 | + out_trade_no = partnerOrderId, | ||
| 120 | + money = dataSet.rmb * 100, | ||
| 121 | + game_money = dataSet.diamond, | ||
| 122 | + notify_url = msg.notifyUrl | ||
| 123 | + } | ||
| 124 | + local sign = signPms(need, secret_key) | ||
| 125 | + | ||
| 126 | + SendPacket(actionCodes.Store_uoRechargeRpc, MsgPack.pack({ order = partnerOrderId, sign = sign})) | ||
| 127 | + return true | ||
| 128 | +end | ||
| 129 | + | ||
| 78 | -- google 充值 入口 | 130 | -- google 充值 入口 |
| 79 | function _M.googleRechargeRpc(agent, data) | 131 | function _M.googleRechargeRpc(agent, data) |
| 80 | local role = agent.role | 132 | local role = agent.role |
| @@ -129,7 +181,7 @@ function _M.myCardRechargeRpc(agent, data) | @@ -129,7 +181,7 @@ function _M.myCardRechargeRpc(agent, data) | ||
| 129 | return true | 181 | return true |
| 130 | end | 182 | end |
| 131 | 183 | ||
| 132 | --- mycard 充值 入口 | 184 | +-- bili ios 充值 入口 |
| 133 | function _M.iosRechargeRpc(agent, data) | 185 | function _M.iosRechargeRpc(agent, data) |
| 134 | local role = agent.role | 186 | local role = agent.role |
| 135 | local msg = MsgPack.unpack(data) | 187 | local msg = MsgPack.unpack(data) |
| @@ -142,12 +194,12 @@ function _M.iosRechargeRpc(agent, data) | @@ -142,12 +194,12 @@ function _M.iosRechargeRpc(agent, data) | ||
| 142 | --创建订单号 | 194 | --创建订单号 |
| 143 | local partnerOrderId = role:getPurchaseOrder(id) | 195 | local partnerOrderId = role:getPurchaseOrder(id) |
| 144 | -- 签名 | 196 | -- 签名 |
| 145 | - local secret_key = "9647d2efe1074c73b9ac19af4337a70e" | 197 | + local secret_key = "1916d62251dd4a8aa5e452121eefc9a1" |
| 146 | local need = { | 198 | local need = { |
| 147 | out_trade_no = partnerOrderId, | 199 | out_trade_no = partnerOrderId, |
| 148 | money = dataSet.rmb * 100, | 200 | money = dataSet.rmb * 100, |
| 149 | game_money = dataSet.diamond, | 201 | game_money = dataSet.diamond, |
| 150 | - product_id = dataSet.iap_product_id, | 202 | + -- product_id = dataSet.iap_product_id, |
| 151 | notify_url = msg.notifyUrl | 203 | notify_url = msg.notifyUrl |
| 152 | } | 204 | } |
| 153 | local sign = signPms(need, secret_key) | 205 | local sign = signPms(need, secret_key) |