|
|
@@ -2,7 +2,6 @@ local OpenPayMgr = class('OpenPayMgr')
|
|
|
function OpenPayMgr:ctor()
|
|
|
self.openID = "1oijtI"
|
|
|
self.productCode = "62071860216202428267772989490827"
|
|
|
- --62071860216202428267772989490827
|
|
|
self.openKey = "f7jMJSjCOYRX2kx7UQ4Ox5zZdAowUSe9"
|
|
|
self.userId = ""
|
|
|
self.roleName = ""
|
|
|
@@ -15,10 +14,16 @@ function OpenPayMgr:ctor()
|
|
|
self.getPayUrlWWW = nil
|
|
|
self.CurPayUrl = nil
|
|
|
self.postData = ""
|
|
|
-
|
|
|
+ --62071860216202428267772989490827
|
|
|
self:RegisterNetEvents()
|
|
|
end
|
|
|
|
|
|
+
|
|
|
+---IOS
|
|
|
+-- 25053842546594917787640743618071
|
|
|
+-- 2jqXkC
|
|
|
+-- oxlQZ8zN7QfrC6mMJ9P0pnvPjx8JutlS
|
|
|
+
|
|
|
function OpenPayMgr:Clear()
|
|
|
self.userId = ""
|
|
|
self.roleName = ""
|
|
|
@@ -37,6 +42,20 @@ function OpenPayMgr:SetOpenData(userId,roleName,roleLevel,serverName)
|
|
|
self.serverName = serverName
|
|
|
self.roleLevel = roleLevel
|
|
|
self.platform = ManagerContainer.LuaGameMgr.platform
|
|
|
+ if self.platform == "SDKHwQuick" then
|
|
|
+ self.openID = "1oijtI"
|
|
|
+ self.productCode = "62071860216202428267772989490827"
|
|
|
+ self.openKey = "f7jMJSjCOYRX2kx7UQ4Ox5zZdAowUSe9"
|
|
|
+ elseif self.platform == "SDKYOUYI_IOS" then
|
|
|
+ self.openID = "2jqXkC"
|
|
|
+ self.productCode = "25053842546594917787640743618071"
|
|
|
+ self.openKey = "oxlQZ8zN7QfrC6mMJ9P0pnvPjx8JutlS"
|
|
|
+ else
|
|
|
+ -- self.openID = "2jqXkC"
|
|
|
+ -- self.productCode = "25053842546594917787640743618071"
|
|
|
+ -- self.openKey = "oxlQZ8zN7QfrC6mMJ9P0pnvPjx8JutlS"
|
|
|
+ end
|
|
|
+
|
|
|
--LogError("---------OpenPayMgr -------------uid = "..userId.." roleName = "..roleName.." roleLevel = "..roleLevel.." serverName = "..serverName)
|
|
|
end
|
|
|
--ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UISimpleWeb, "https://www.baidu.com", nil, nil, nil, Enum.UISibling[Enum.UIType.Top] - 2)
|
|
|
@@ -76,10 +95,13 @@ end
|
|
|
function OpenPayMgr:Pay(goodsId, goodsName, goodsDesc, count, amount, cpOrderId, cbUrl, extrasParams)
|
|
|
local goodsNameNew = amount.."_商品"
|
|
|
local goodsIdNew = ""
|
|
|
- if self.platform == "SDKHwQuick" or self.platform == "PC" then
|
|
|
+ if self.platform == "SDKHwQuick" then
|
|
|
goodsIdNew = "product_"..amount.."_ro"
|
|
|
- else
|
|
|
+ elseif self.platform == "SDKYOUYI_IOS" then
|
|
|
goodsIdNew = "intention"..amount
|
|
|
+ else
|
|
|
+ --goodsIdNew = "intention"..amount
|
|
|
+ goodsIdNew = "product_"..amount.."_ro"
|
|
|
end
|
|
|
|
|
|
|
|
|
@@ -151,10 +173,12 @@ function OpenPayMgr:GetOpenPayUrl(goodsId, goodsName, goodsDesc, count, amount,
|
|
|
-- callbackUrl string 选传订单回调地址,就是通知cp服务器发货的通知地址
|
|
|
url = url .. "&callbackUrl=" .. cbUrl
|
|
|
params['callbackUrl'] = cbUrl
|
|
|
- -- payTypestring 选传 支付方式ID,ID获取请参照SDK后台“平台管理”>“支付对照表”。支持多种支付方式,多个支付方式以“|”隔开,比如:12|13|23注意:支付方式ID需满足后台勾选已经支持的第三方支付方式,否则无法显示指定支付方式渠道
|
|
|
-
|
|
|
+ -- payType string 选传 支付方式ID,ID获取请参照SDK后台“平台管理”>“支付对照表”。支持多种支付方式,多个支付方式以“|”隔开,比如:12|13|23注意:支付方式ID需满足后台勾选已经支持的第三方支付方式,否则无法显示指定支付方式渠道
|
|
|
+ --url = url .. "&payType=" .. "14"
|
|
|
+ --params['payType'] = "14"
|
|
|
-- countryCode string 选传 国家代码,如CHN。获取请参照SDK后台“平台管理”>“地区管理”注意:国家代码需满足后台勾选已经支持的第三方支付方式,否则无法显示指定国家的支付
|
|
|
-
|
|
|
+ url = url .. "&countryCode=" .. "TWN"--"en-US"
|
|
|
+ params['countryCode'] = "TWN"--"en-US"
|
|
|
-- clientLang string 必传 支付中心语言包,填写地区语言代码,如en-US。默认为中文繁体
|
|
|
url = url .. "&clientLang=" .. "zh-cn"--"en-US"
|
|
|
params['clientLang'] = "zh-cn"--"en-US"
|
|
|
@@ -164,7 +188,8 @@ function OpenPayMgr:GetOpenPayUrl(goodsId, goodsName, goodsDesc, count, amount,
|
|
|
url = url .. "&amount=" .. amount
|
|
|
params['amount'] = amount
|
|
|
-- currency string 选传 选传 订单支付的币种代码。如果payVersion的值为2,则必传currency字段注意:支付币种代码必须为SDK后台货币管理里面所支持的货币代码
|
|
|
-
|
|
|
+ url = url .. "¤cy=" .. "USD"
|
|
|
+ params['currency'] = "USD"
|
|
|
-- sign string 必传 签名串,算法详见第三章签名算法描述
|
|
|
url = url .. "&sign="
|
|
|
return url,params
|