ios支付
This commit is contained in:
parent
1b27a8dfae
commit
02cdb96b4b
@ -248,38 +248,23 @@ function PayManager:checkAndPay(productId, id, purchaseType, rechargeId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function PayManager:sendMsgToServer(purchaseToken, orderId, originOrderId, callback)
|
function PayManager:sendMsgToServer(purchaseToken, orderId, originOrderId, callback)
|
||||||
|
local args = {
|
||||||
|
uuid = {orderId},
|
||||||
|
channel = SDKManager:getSDKPayType(),
|
||||||
|
}
|
||||||
if Platform:isIosPlatform() then
|
if Platform:isIosPlatform() then
|
||||||
local payParams = SDKManager:getIosPayInfo(originOrderId)
|
|
||||||
if not payParams or not payParams.order then
|
|
||||||
return -- 支付错误
|
|
||||||
end
|
|
||||||
local info = string.split(payParams.order, "|")
|
|
||||||
local gift_type = tonumber(info[1])
|
|
||||||
local gift_id = tonumber(info[2])
|
|
||||||
if not gift_id or not gift_id then
|
|
||||||
return -- 解析错误
|
|
||||||
end
|
|
||||||
local purchaseTokenObj = json.decode(purchaseToken)
|
local purchaseTokenObj = json.decode(purchaseToken)
|
||||||
if purchaseTokenObj == nil then
|
if purchaseTokenObj == nil then
|
||||||
return -- 解析错误
|
return -- 解析错误
|
||||||
end
|
end
|
||||||
local args = {
|
args.pay_token = purchaseTokenObj.Payload
|
||||||
id = gift_id,
|
|
||||||
act_type = gift_type,
|
|
||||||
pay_token = purchaseTokenObj.Payload
|
|
||||||
}
|
|
||||||
self:sendMessage(ProtoMsgType.FromMsgEnum.AppStorePaidReq, args, {}, callback)
|
|
||||||
else
|
else
|
||||||
local args = {
|
args.pay_token = purchaseToken
|
||||||
uuid = {orderId},
|
|
||||||
channel = SDKManager:getSDKPayType(),
|
|
||||||
pay_token = purchaseToken
|
|
||||||
}
|
|
||||||
if EDITOR_MODE then
|
|
||||||
args.channel = SDKManager.PAY_TYPE.DEBUG
|
|
||||||
end
|
|
||||||
self:sendMessage(ProtoMsgType.FromMsgEnum.ActPaidResultReq, args, {}, callback)
|
|
||||||
end
|
end
|
||||||
|
if EDITOR_MODE then
|
||||||
|
args.channel = SDKManager.PAY_TYPE.DEBUG
|
||||||
|
end
|
||||||
|
self:sendMessage(ProtoMsgType.FromMsgEnum.ActPaidResultReq, args, {}, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
return PayManager
|
return PayManager
|
||||||
Loading…
x
Reference in New Issue
Block a user