Commit 4c1d0c2e2c24a71f95503168531e0983bb02fe90
Merge branch 'tr/bugfix-qa' into tr/publish/qa-out
* tr/bugfix-qa: 充值mycard
Showing
3 changed files
with
48 additions
and
1 deletions
Show diff stats
src/actions/GmAction.lua
@@ -559,6 +559,12 @@ function _M.ayncPurchase(role, params) | @@ -559,6 +559,12 @@ function _M.ayncPurchase(role, params) | ||
559 | return role:handlePurchase(params) or "" | 559 | return role:handlePurchase(params) or "" |
560 | end | 560 | end |
561 | 561 | ||
562 | +-- 获取订单号 | ||
563 | +function _M.getPurchaseOrder(role, params) | ||
564 | + return role:getPurchaseOrderByPlatform(params) or "" | ||
565 | +end | ||
566 | + | ||
567 | + | ||
562 | function _M.cz(role, pms) | 568 | function _M.cz(role, pms) |
563 | local id = tonum(pms.pm1) | 569 | local id = tonum(pms.pm1) |
564 | local csvData = csvdb["shop_rechargeCsv"][id] | 570 | local csvData = csvdb["shop_rechargeCsv"][id] |
src/actions/HttpAction.lua
@@ -147,6 +147,15 @@ function _M.gm_action(query) | @@ -147,6 +147,15 @@ function _M.gm_action(query) | ||
147 | return status | 147 | return status |
148 | end | 148 | end |
149 | 149 | ||
150 | +function _M.query_role(query) | ||
151 | + if not query.uid then return "not found" end | ||
152 | + local user = redisproxy:get(string.format("uid:%s", query.uid)) | ||
153 | + if not user then return "not found" end | ||
154 | + local roleId = redisproxy:get(string_format("user:%s", string.upper(user))) | ||
155 | + if not roleId then return "not found" end | ||
156 | + return json.encode({roleId, user}) | ||
157 | +end | ||
158 | + | ||
150 | function _M.broadcast(query) | 159 | function _M.broadcast(query) |
151 | local msg = {} | 160 | local msg = {} |
152 | local handle = { | 161 | local handle = { |
src/models/RolePlugin.lua
@@ -1667,8 +1667,34 @@ function RolePlugin.bind(Role) | @@ -1667,8 +1667,34 @@ function RolePlugin.bind(Role) | ||
1667 | self:updateProperty({field = "redp", value = redp}) | 1667 | self:updateProperty({field = "redp", value = redp}) |
1668 | end | 1668 | end |
1669 | 1669 | ||
1670 | + -- 网页支付获取订单号 | ||
1671 | + function Role:getPurchaseOrderByPlatform(params) | ||
1672 | + local checkPlatform = { | ||
1673 | + ["mycard"] = "mycard_product_id", | ||
1674 | + } | ||
1675 | + local pidField = checkPlatform[params.payMode or ""] | ||
1676 | + if not pidField or not params.product_id or params.product_id == "" then | ||
1677 | + return "no product" | ||
1678 | + end | ||
1679 | + | ||
1680 | + for k , v in pairs(csvdb["shop_rechargeCsv"]) do | ||
1681 | + if not v[pidField] then return "no product" end | ||
1682 | + if v[pidField] == params.product_id then | ||
1683 | + if v.rmb ~= params.money then | ||
1684 | + return "error money" | ||
1685 | + end | ||
1686 | + -- 发现需要的id | ||
1687 | + local partnerOrderId = self:getPurchaseOrder(k, params.transactionId) | ||
1688 | + if partnerOrderId == "" then | ||
1689 | + return "no product" | ||
1690 | + end | ||
1691 | + return json.encode({order = partnerOrderId}) | ||
1692 | + end | ||
1693 | + end | ||
1694 | + end | ||
1695 | + | ||
1670 | -- 获取充值订单号 | 1696 | -- 获取充值订单号 |
1671 | - function Role:getPurchaseOrder(rechargeId) | 1697 | + function Role:getPurchaseOrder(rechargeId, transactionId) |
1672 | local roleId = self:getProperty("id") | 1698 | local roleId = self:getProperty("id") |
1673 | local rechargeData = csvdb["shop_rechargeCsv"][rechargeId] | 1699 | local rechargeData = csvdb["shop_rechargeCsv"][rechargeId] |
1674 | if not rechargeData then | 1700 | if not rechargeData then |
@@ -1705,6 +1731,7 @@ function RolePlugin.bind(Role) | @@ -1705,6 +1731,7 @@ function RolePlugin.bind(Role) | ||
1705 | order = partnerOrderId, | 1731 | order = partnerOrderId, |
1706 | rechargeId = rechargeId, | 1732 | rechargeId = rechargeId, |
1707 | createTime = skynet.timex(), | 1733 | createTime = skynet.timex(), |
1734 | + transactionId = transactionId, | ||
1708 | }) | 1735 | }) |
1709 | order:create() | 1736 | order:create() |
1710 | -- 正在进行中的订单 缓存 | 1737 | -- 正在进行中的订单 缓存 |
@@ -1783,6 +1810,7 @@ function RolePlugin.bind(Role) | @@ -1783,6 +1810,7 @@ function RolePlugin.bind(Role) | ||
1783 | request.product_id = data.product_id | 1810 | request.product_id = data.product_id |
1784 | request.pay_time = data.pay_time | 1811 | request.pay_time = data.pay_time |
1785 | request.transactionId = data.order_no | 1812 | request.transactionId = data.order_no |
1813 | + request.extension_info = data.extension_info | ||
1786 | ]] | 1814 | ]] |
1787 | function Role:handlePurchase(params) | 1815 | function Role:handlePurchase(params) |
1788 | local roleId = self:getProperty("id") | 1816 | local roleId = self:getProperty("id") |
@@ -1813,6 +1841,10 @@ function RolePlugin.bind(Role) | @@ -1813,6 +1841,10 @@ function RolePlugin.bind(Role) | ||
1813 | }) | 1841 | }) |
1814 | 1842 | ||
1815 | if not status then | 1843 | if not status then |
1844 | + if params.extension_info == "mycard_web" then | ||
1845 | + -- todo 发邮件 | ||
1846 | + skynet.error("mycard_web " .. params.order) | ||
1847 | + end | ||
1816 | SendPacket(actionCodes.Store_ayncPurchaseRpc, MsgPack.pack({ order = partnerOrderStr, | 1848 | SendPacket(actionCodes.Store_ayncPurchaseRpc, MsgPack.pack({ order = partnerOrderStr, |
1817 | result = "success", reward = reward})) | 1849 | result = "success", reward = reward})) |
1818 | end | 1850 | end |