支付协议修改
This commit is contained in:
@@ -128,7 +128,7 @@ export class PurchasePanel extends li_BaseView {
|
||||
const isRechargeId = shopData.isRechargeId(id);
|
||||
if (isRechargeId) {
|
||||
// 需要外部支付进行购买
|
||||
this.startPayment(id);
|
||||
this.startPayment(id, proto.cs.EnmPayType.EPT_Cash_INR, 0);
|
||||
} else {
|
||||
//是u币充值,打开页面
|
||||
NavigationManager.Instance.openSubPanel("Web3PopPanel", this.node);
|
||||
@@ -187,10 +187,12 @@ export class PurchasePanel extends li_BaseView {
|
||||
}
|
||||
|
||||
// 创建订单
|
||||
async startPayment(goodId: number) {
|
||||
async startPayment(goodId: number, payType: number, network: number) {
|
||||
// 请求数据
|
||||
const reqData = {
|
||||
goodId,
|
||||
payType,
|
||||
network,
|
||||
};
|
||||
let res = await PaymentService.I.startPayment(reqData);
|
||||
console.log("支付完成的响应数据:", res);
|
||||
|
||||
Vendored
+62
@@ -1660,11 +1660,31 @@ toJSON(): { [k: string]: any };
|
||||
static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
}
|
||||
|
||||
/** EnmPayType enum. */
|
||||
enum EnmPayType {
|
||||
EPT_Cash_INR = 0,
|
||||
EPT_WEB3_USD = 1
|
||||
}
|
||||
|
||||
/** EnmNetworkType enum. */
|
||||
enum EnmNetworkType {
|
||||
ENT_TRON = 0,
|
||||
ENT_TON = 1,
|
||||
ENT_ETH = 2,
|
||||
ENT_BEP = 3
|
||||
}
|
||||
|
||||
/** Properties of a CSCreateOrderReq. */
|
||||
interface ICSCreateOrderReq {
|
||||
|
||||
/** CSCreateOrderReq goodId */
|
||||
goodId?: (number|null);
|
||||
|
||||
/** CSCreateOrderReq payType */
|
||||
payType?: (number|null);
|
||||
|
||||
/** CSCreateOrderReq network */
|
||||
network?: (number|null);
|
||||
}
|
||||
|
||||
/** Represents a CSCreateOrderReq. */
|
||||
@@ -1679,6 +1699,12 @@ static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
/** CSCreateOrderReq goodId. */
|
||||
goodId: number;
|
||||
|
||||
/** CSCreateOrderReq payType. */
|
||||
payType: number;
|
||||
|
||||
/** CSCreateOrderReq network. */
|
||||
network: number;
|
||||
|
||||
/**
|
||||
* Creates a new CSCreateOrderReq instance using the specified properties.
|
||||
* @param [properties] Properties to set
|
||||
@@ -1765,6 +1791,21 @@ static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
|
||||
/** CSCreateOrderRes orderId */
|
||||
orderId?: (string|null);
|
||||
|
||||
/** CSCreateOrderRes network */
|
||||
network?: (number|null);
|
||||
|
||||
/** CSCreateOrderRes wallet */
|
||||
wallet?: (string|null);
|
||||
|
||||
/** CSCreateOrderRes amount */
|
||||
amount?: (string|null);
|
||||
|
||||
/** CSCreateOrderRes Expire */
|
||||
Expire?: (number|null);
|
||||
|
||||
/** CSCreateOrderRes ExpireUnix */
|
||||
ExpireUnix?: (number|Long|null);
|
||||
}
|
||||
|
||||
/** Represents a CSCreateOrderRes. */
|
||||
@@ -1782,6 +1823,21 @@ payUrl: string;
|
||||
/** CSCreateOrderRes orderId. */
|
||||
orderId: string;
|
||||
|
||||
/** CSCreateOrderRes network. */
|
||||
network: number;
|
||||
|
||||
/** CSCreateOrderRes wallet. */
|
||||
wallet: string;
|
||||
|
||||
/** CSCreateOrderRes amount. */
|
||||
amount: string;
|
||||
|
||||
/** CSCreateOrderRes Expire. */
|
||||
Expire: number;
|
||||
|
||||
/** CSCreateOrderRes ExpireUnix. */
|
||||
ExpireUnix: (number|Long);
|
||||
|
||||
/**
|
||||
* Creates a new CSCreateOrderRes instance using the specified properties.
|
||||
* @param [properties] Properties to set
|
||||
@@ -4129,6 +4185,9 @@ static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
|
||||
/** PurchaseConfig price */
|
||||
price?: (number|null);
|
||||
|
||||
/** PurchaseConfig usd */
|
||||
usd?: (number|null);
|
||||
}
|
||||
|
||||
/** Represents a PurchaseConfig. */
|
||||
@@ -4152,6 +4211,9 @@ count: number;
|
||||
/** PurchaseConfig price. */
|
||||
price: number;
|
||||
|
||||
/** PurchaseConfig usd. */
|
||||
usd: number;
|
||||
|
||||
/**
|
||||
* Creates a new PurchaseConfig instance using the specified properties.
|
||||
* @param [properties] Properties to set
|
||||
|
||||
@@ -3868,6 +3868,38 @@ $root.cs = (function() {
|
||||
return CSBuyGoodRes;
|
||||
})();
|
||||
|
||||
/**
|
||||
* EnmPayType enum.
|
||||
* @name cs.EnmPayType
|
||||
* @enum {number}
|
||||
* @property {number} EPT_Cash_INR=0 EPT_Cash_INR value
|
||||
* @property {number} EPT_WEB3_USD=1 EPT_WEB3_USD value
|
||||
*/
|
||||
cs.EnmPayType = (function() {
|
||||
var valuesById = {}, values = Object.create(valuesById);
|
||||
values[valuesById[0] = "EPT_Cash_INR"] = 0;
|
||||
values[valuesById[1] = "EPT_WEB3_USD"] = 1;
|
||||
return values;
|
||||
})();
|
||||
|
||||
/**
|
||||
* EnmNetworkType enum.
|
||||
* @name cs.EnmNetworkType
|
||||
* @enum {number}
|
||||
* @property {number} ENT_TRON=0 ENT_TRON value
|
||||
* @property {number} ENT_TON=1 ENT_TON value
|
||||
* @property {number} ENT_ETH=2 ENT_ETH value
|
||||
* @property {number} ENT_BEP=3 ENT_BEP value
|
||||
*/
|
||||
cs.EnmNetworkType = (function() {
|
||||
var valuesById = {}, values = Object.create(valuesById);
|
||||
values[valuesById[0] = "ENT_TRON"] = 0;
|
||||
values[valuesById[1] = "ENT_TON"] = 1;
|
||||
values[valuesById[2] = "ENT_ETH"] = 2;
|
||||
values[valuesById[3] = "ENT_BEP"] = 3;
|
||||
return values;
|
||||
})();
|
||||
|
||||
cs.CSCreateOrderReq = (function() {
|
||||
|
||||
/**
|
||||
@@ -3875,6 +3907,8 @@ $root.cs = (function() {
|
||||
* @memberof cs
|
||||
* @interface ICSCreateOrderReq
|
||||
* @property {number|null} [goodId] CSCreateOrderReq goodId
|
||||
* @property {number|null} [payType] CSCreateOrderReq payType
|
||||
* @property {number|null} [network] CSCreateOrderReq network
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -3900,6 +3934,22 @@ $root.cs = (function() {
|
||||
*/
|
||||
CSCreateOrderReq.prototype.goodId = 0;
|
||||
|
||||
/**
|
||||
* CSCreateOrderReq payType.
|
||||
* @member {number} payType
|
||||
* @memberof cs.CSCreateOrderReq
|
||||
* @instance
|
||||
*/
|
||||
CSCreateOrderReq.prototype.payType = 0;
|
||||
|
||||
/**
|
||||
* CSCreateOrderReq network.
|
||||
* @member {number} network
|
||||
* @memberof cs.CSCreateOrderReq
|
||||
* @instance
|
||||
*/
|
||||
CSCreateOrderReq.prototype.network = 0;
|
||||
|
||||
/**
|
||||
* Creates a new CSCreateOrderReq instance using the specified properties.
|
||||
* @function create
|
||||
@@ -3926,6 +3976,10 @@ $root.cs = (function() {
|
||||
writer = $Writer.create();
|
||||
if (message.goodId != null && Object.hasOwnProperty.call(message, "goodId"))
|
||||
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.goodId);
|
||||
if (message.payType != null && Object.hasOwnProperty.call(message, "payType"))
|
||||
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.payType);
|
||||
if (message.network != null && Object.hasOwnProperty.call(message, "network"))
|
||||
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.network);
|
||||
return writer;
|
||||
};
|
||||
|
||||
@@ -3966,6 +4020,14 @@ $root.cs = (function() {
|
||||
message.goodId = reader.int32();
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
message.payType = reader.int32();
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
message.network = reader.int32();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
@@ -4004,6 +4066,12 @@ $root.cs = (function() {
|
||||
if (message.goodId != null && message.hasOwnProperty("goodId"))
|
||||
if (!$util.isInteger(message.goodId))
|
||||
return "goodId: integer expected";
|
||||
if (message.payType != null && message.hasOwnProperty("payType"))
|
||||
if (!$util.isInteger(message.payType))
|
||||
return "payType: integer expected";
|
||||
if (message.network != null && message.hasOwnProperty("network"))
|
||||
if (!$util.isInteger(message.network))
|
||||
return "network: integer expected";
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -4021,6 +4089,10 @@ $root.cs = (function() {
|
||||
var message = new $root.cs.CSCreateOrderReq();
|
||||
if (object.goodId != null)
|
||||
message.goodId = object.goodId | 0;
|
||||
if (object.payType != null)
|
||||
message.payType = object.payType | 0;
|
||||
if (object.network != null)
|
||||
message.network = object.network | 0;
|
||||
return message;
|
||||
};
|
||||
|
||||
@@ -4037,10 +4109,17 @@ $root.cs = (function() {
|
||||
if (!options)
|
||||
options = {};
|
||||
var object = {};
|
||||
if (options.defaults)
|
||||
if (options.defaults) {
|
||||
object.goodId = 0;
|
||||
object.payType = 0;
|
||||
object.network = 0;
|
||||
}
|
||||
if (message.goodId != null && message.hasOwnProperty("goodId"))
|
||||
object.goodId = message.goodId;
|
||||
if (message.payType != null && message.hasOwnProperty("payType"))
|
||||
object.payType = message.payType;
|
||||
if (message.network != null && message.hasOwnProperty("network"))
|
||||
object.network = message.network;
|
||||
return object;
|
||||
};
|
||||
|
||||
@@ -4081,6 +4160,11 @@ $root.cs = (function() {
|
||||
* @interface ICSCreateOrderRes
|
||||
* @property {string|null} [payUrl] CSCreateOrderRes payUrl
|
||||
* @property {string|null} [orderId] CSCreateOrderRes orderId
|
||||
* @property {number|null} [network] CSCreateOrderRes network
|
||||
* @property {string|null} [wallet] CSCreateOrderRes wallet
|
||||
* @property {string|null} [amount] CSCreateOrderRes amount
|
||||
* @property {number|null} [Expire] CSCreateOrderRes Expire
|
||||
* @property {number|Long|null} [ExpireUnix] CSCreateOrderRes ExpireUnix
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -4114,6 +4198,46 @@ $root.cs = (function() {
|
||||
*/
|
||||
CSCreateOrderRes.prototype.orderId = "";
|
||||
|
||||
/**
|
||||
* CSCreateOrderRes network.
|
||||
* @member {number} network
|
||||
* @memberof cs.CSCreateOrderRes
|
||||
* @instance
|
||||
*/
|
||||
CSCreateOrderRes.prototype.network = 0;
|
||||
|
||||
/**
|
||||
* CSCreateOrderRes wallet.
|
||||
* @member {string} wallet
|
||||
* @memberof cs.CSCreateOrderRes
|
||||
* @instance
|
||||
*/
|
||||
CSCreateOrderRes.prototype.wallet = "";
|
||||
|
||||
/**
|
||||
* CSCreateOrderRes amount.
|
||||
* @member {string} amount
|
||||
* @memberof cs.CSCreateOrderRes
|
||||
* @instance
|
||||
*/
|
||||
CSCreateOrderRes.prototype.amount = "";
|
||||
|
||||
/**
|
||||
* CSCreateOrderRes Expire.
|
||||
* @member {number} Expire
|
||||
* @memberof cs.CSCreateOrderRes
|
||||
* @instance
|
||||
*/
|
||||
CSCreateOrderRes.prototype.Expire = 0;
|
||||
|
||||
/**
|
||||
* CSCreateOrderRes ExpireUnix.
|
||||
* @member {number|Long} ExpireUnix
|
||||
* @memberof cs.CSCreateOrderRes
|
||||
* @instance
|
||||
*/
|
||||
CSCreateOrderRes.prototype.ExpireUnix = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
||||
|
||||
/**
|
||||
* Creates a new CSCreateOrderRes instance using the specified properties.
|
||||
* @function create
|
||||
@@ -4142,6 +4266,16 @@ $root.cs = (function() {
|
||||
writer.uint32(/* id 1, wireType 2 =*/10).string(message.payUrl);
|
||||
if (message.orderId != null && Object.hasOwnProperty.call(message, "orderId"))
|
||||
writer.uint32(/* id 2, wireType 2 =*/18).string(message.orderId);
|
||||
if (message.network != null && Object.hasOwnProperty.call(message, "network"))
|
||||
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.network);
|
||||
if (message.wallet != null && Object.hasOwnProperty.call(message, "wallet"))
|
||||
writer.uint32(/* id 4, wireType 2 =*/34).string(message.wallet);
|
||||
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
||||
writer.uint32(/* id 5, wireType 2 =*/42).string(message.amount);
|
||||
if (message.Expire != null && Object.hasOwnProperty.call(message, "Expire"))
|
||||
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.Expire);
|
||||
if (message.ExpireUnix != null && Object.hasOwnProperty.call(message, "ExpireUnix"))
|
||||
writer.uint32(/* id 7, wireType 0 =*/56).int64(message.ExpireUnix);
|
||||
return writer;
|
||||
};
|
||||
|
||||
@@ -4186,6 +4320,26 @@ $root.cs = (function() {
|
||||
message.orderId = reader.string();
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
message.network = reader.int32();
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
message.wallet = reader.string();
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
message.amount = reader.string();
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
message.Expire = reader.int32();
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
message.ExpireUnix = reader.int64();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
@@ -4227,6 +4381,21 @@ $root.cs = (function() {
|
||||
if (message.orderId != null && message.hasOwnProperty("orderId"))
|
||||
if (!$util.isString(message.orderId))
|
||||
return "orderId: string expected";
|
||||
if (message.network != null && message.hasOwnProperty("network"))
|
||||
if (!$util.isInteger(message.network))
|
||||
return "network: integer expected";
|
||||
if (message.wallet != null && message.hasOwnProperty("wallet"))
|
||||
if (!$util.isString(message.wallet))
|
||||
return "wallet: string expected";
|
||||
if (message.amount != null && message.hasOwnProperty("amount"))
|
||||
if (!$util.isString(message.amount))
|
||||
return "amount: string expected";
|
||||
if (message.Expire != null && message.hasOwnProperty("Expire"))
|
||||
if (!$util.isInteger(message.Expire))
|
||||
return "Expire: integer expected";
|
||||
if (message.ExpireUnix != null && message.hasOwnProperty("ExpireUnix"))
|
||||
if (!$util.isInteger(message.ExpireUnix) && !(message.ExpireUnix && $util.isInteger(message.ExpireUnix.low) && $util.isInteger(message.ExpireUnix.high)))
|
||||
return "ExpireUnix: integer|Long expected";
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -4246,6 +4415,23 @@ $root.cs = (function() {
|
||||
message.payUrl = String(object.payUrl);
|
||||
if (object.orderId != null)
|
||||
message.orderId = String(object.orderId);
|
||||
if (object.network != null)
|
||||
message.network = object.network | 0;
|
||||
if (object.wallet != null)
|
||||
message.wallet = String(object.wallet);
|
||||
if (object.amount != null)
|
||||
message.amount = String(object.amount);
|
||||
if (object.Expire != null)
|
||||
message.Expire = object.Expire | 0;
|
||||
if (object.ExpireUnix != null)
|
||||
if ($util.Long)
|
||||
(message.ExpireUnix = $util.Long.fromValue(object.ExpireUnix)).unsigned = false;
|
||||
else if (typeof object.ExpireUnix === "string")
|
||||
message.ExpireUnix = parseInt(object.ExpireUnix, 10);
|
||||
else if (typeof object.ExpireUnix === "number")
|
||||
message.ExpireUnix = object.ExpireUnix;
|
||||
else if (typeof object.ExpireUnix === "object")
|
||||
message.ExpireUnix = new $util.LongBits(object.ExpireUnix.low >>> 0, object.ExpireUnix.high >>> 0).toNumber();
|
||||
return message;
|
||||
};
|
||||
|
||||
@@ -4265,11 +4451,33 @@ $root.cs = (function() {
|
||||
if (options.defaults) {
|
||||
object.payUrl = "";
|
||||
object.orderId = "";
|
||||
object.network = 0;
|
||||
object.wallet = "";
|
||||
object.amount = "";
|
||||
object.Expire = 0;
|
||||
if ($util.Long) {
|
||||
var long = new $util.Long(0, 0, false);
|
||||
object.ExpireUnix = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
||||
} else
|
||||
object.ExpireUnix = options.longs === String ? "0" : 0;
|
||||
}
|
||||
if (message.payUrl != null && message.hasOwnProperty("payUrl"))
|
||||
object.payUrl = message.payUrl;
|
||||
if (message.orderId != null && message.hasOwnProperty("orderId"))
|
||||
object.orderId = message.orderId;
|
||||
if (message.network != null && message.hasOwnProperty("network"))
|
||||
object.network = message.network;
|
||||
if (message.wallet != null && message.hasOwnProperty("wallet"))
|
||||
object.wallet = message.wallet;
|
||||
if (message.amount != null && message.hasOwnProperty("amount"))
|
||||
object.amount = message.amount;
|
||||
if (message.Expire != null && message.hasOwnProperty("Expire"))
|
||||
object.Expire = message.Expire;
|
||||
if (message.ExpireUnix != null && message.hasOwnProperty("ExpireUnix"))
|
||||
if (typeof message.ExpireUnix === "number")
|
||||
object.ExpireUnix = options.longs === String ? String(message.ExpireUnix) : message.ExpireUnix;
|
||||
else
|
||||
object.ExpireUnix = options.longs === String ? $util.Long.prototype.toString.call(message.ExpireUnix) : options.longs === Number ? new $util.LongBits(message.ExpireUnix.low >>> 0, message.ExpireUnix.high >>> 0).toNumber() : message.ExpireUnix;
|
||||
return object;
|
||||
};
|
||||
|
||||
@@ -9823,6 +10031,7 @@ $root.cs = (function() {
|
||||
* @property {string|null} [name] PurchaseConfig name
|
||||
* @property {number|null} [count] PurchaseConfig count
|
||||
* @property {number|null} [price] PurchaseConfig price
|
||||
* @property {number|null} [usd] PurchaseConfig usd
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -9872,6 +10081,14 @@ $root.cs = (function() {
|
||||
*/
|
||||
PurchaseConfig.prototype.price = 0;
|
||||
|
||||
/**
|
||||
* PurchaseConfig usd.
|
||||
* @member {number} usd
|
||||
* @memberof cs.PurchaseConfig
|
||||
* @instance
|
||||
*/
|
||||
PurchaseConfig.prototype.usd = 0;
|
||||
|
||||
/**
|
||||
* Creates a new PurchaseConfig instance using the specified properties.
|
||||
* @function create
|
||||
@@ -9904,6 +10121,8 @@ $root.cs = (function() {
|
||||
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.count);
|
||||
if (message.price != null && Object.hasOwnProperty.call(message, "price"))
|
||||
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.price);
|
||||
if (message.usd != null && Object.hasOwnProperty.call(message, "usd"))
|
||||
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.usd);
|
||||
return writer;
|
||||
};
|
||||
|
||||
@@ -9956,6 +10175,10 @@ $root.cs = (function() {
|
||||
message.price = reader.int32();
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
message.usd = reader.int32();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
@@ -10003,6 +10226,9 @@ $root.cs = (function() {
|
||||
if (message.price != null && message.hasOwnProperty("price"))
|
||||
if (!$util.isInteger(message.price))
|
||||
return "price: integer expected";
|
||||
if (message.usd != null && message.hasOwnProperty("usd"))
|
||||
if (!$util.isInteger(message.usd))
|
||||
return "usd: integer expected";
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -10026,6 +10252,8 @@ $root.cs = (function() {
|
||||
message.count = object.count | 0;
|
||||
if (object.price != null)
|
||||
message.price = object.price | 0;
|
||||
if (object.usd != null)
|
||||
message.usd = object.usd | 0;
|
||||
return message;
|
||||
};
|
||||
|
||||
@@ -10047,6 +10275,7 @@ $root.cs = (function() {
|
||||
object.name = "";
|
||||
object.count = 0;
|
||||
object.price = 0;
|
||||
object.usd = 0;
|
||||
}
|
||||
if (message.id != null && message.hasOwnProperty("id"))
|
||||
object.id = message.id;
|
||||
@@ -10056,6 +10285,8 @@ $root.cs = (function() {
|
||||
object.count = message.count;
|
||||
if (message.price != null && message.hasOwnProperty("price"))
|
||||
object.price = message.price;
|
||||
if (message.usd != null && message.hasOwnProperty("usd"))
|
||||
object.usd = message.usd;
|
||||
return object;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user