新增支付流程 LuffaPayFlow

This commit is contained in:
chen wei bo
2025-09-28 14:16:37 +08:00
parent 66ba9dbc67
commit 303003b550
6 changed files with 78 additions and 12 deletions
@@ -16,6 +16,7 @@ import { NavigationManager } from "../../manager/NavigationManager";
import { Web3PopPanel } from "./Web3PopPanel";
import { TipsPanel } from "./TipsPanel";
import { logger } from "db://assets/Scripts/Main/Common/Logger";
import { PaymentMethod } from 'db://assets/Scripts/chat18x/payment/types';
const { ccclass, property } = _decorator;
@@ -194,7 +195,7 @@ export class PurchasePanel extends li_BaseView {
const isRechargeId = shopData.isRechargeId(id);
if (isRechargeId) {
// 需要外部支付进行购买
this.startPayment(id, this.currentPayType, networkType);
this.startPayment(id, this.currentPayType, networkType, PaymentMethod.CashPay);
}
//测试用
// Utils.sendInnerMsg(InnerMsgCode.PayOrderCreateSucc, {
@@ -287,14 +288,14 @@ export class PurchasePanel extends li_BaseView {
}
// 创建订单
async startPayment(goodId: number, payType: number, network: number) {
async startPayment(goodId: number, payType: number, network: number, payMethod: PaymentMethod) {
// 请求数据
const reqData = {
goodId,
payType,
network,
};
let res = await PaymentService.I.startPayment(reqData);
let res = await PaymentService.I.startPayment(payMethod, reqData);
logger.log("支付完成的响应数据:", res);
if (res) {
let status = res.status;
@@ -13,6 +13,7 @@ import { SDKManager } from "../../../Main/Channel/SDKManager";
import LanguageUtils from "../../../Main/Common/LanguageUtils";
import { logger } from "db://assets/Scripts/Main/Common/Logger";
import { PersonalPanel } from "./PersonalPanel";
import { PaymentMethod } from 'db://assets/Scripts/chat18x/payment/types';
const { ccclass, property } = _decorator;
@@ -223,7 +224,8 @@ export class Web3PopPanel extends li_BaseView {
this.payPanel.startPayment(
this.goodId,
proto.cs.EnmPayType.EPT_WEB3_USD,
type
type,
PaymentMethod.Web3
);
this.selection.scale = new Vec3(1, 0, 1);