ios支付
This commit is contained in:
parent
1b27a8dfae
commit
02cdb96b4b
@ -248,38 +248,23 @@ function PayManager:checkAndPay(productId, id, purchaseType, rechargeId)
|
||||
end
|
||||
|
||||
function PayManager:sendMsgToServer(purchaseToken, orderId, originOrderId, callback)
|
||||
local args = {
|
||||
uuid = {orderId},
|
||||
channel = SDKManager:getSDKPayType(),
|
||||
}
|
||||
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)
|
||||
if purchaseTokenObj == nil then
|
||||
return -- 解析错误
|
||||
end
|
||||
local args = {
|
||||
id = gift_id,
|
||||
act_type = gift_type,
|
||||
pay_token = purchaseTokenObj.Payload
|
||||
}
|
||||
self:sendMessage(ProtoMsgType.FromMsgEnum.AppStorePaidReq, args, {}, callback)
|
||||
args.pay_token = purchaseTokenObj.Payload
|
||||
else
|
||||
local args = {
|
||||
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)
|
||||
args.pay_token = purchaseToken
|
||||
end
|
||||
if EDITOR_MODE then
|
||||
args.channel = SDKManager.PAY_TYPE.DEBUG
|
||||
end
|
||||
self:sendMessage(ProtoMsgType.FromMsgEnum.ActPaidResultReq, args, {}, callback)
|
||||
end
|
||||
|
||||
return PayManager
|
||||
Loading…
x
Reference in New Issue
Block a user