支付协议修改

This commit is contained in:
chen wei bo
2025-09-18 17:12:20 +08:00
parent c0fc7c838a
commit 3325b28769
7 changed files with 55 additions and 2 deletions
+6
View File
@@ -33,6 +33,12 @@ export class OrderData extends BaseData {
const vo: OrderVO = {
orderId, // 订单 id
payUrl: res.payUrl || "", // 支付url
payType: res.payType, // 支付类型
network: res.network || 0, // 网络类型
wallet: res.wallet || "", // 充值钱包地址
amount: res.amount || "", // 充值金额
expire: res.Expire || 0, // 过期时间,单位: 秒
expireUnix: res.ExpireUnix || "", // 过期时间戳
status: "CREATED" as OrderStatus, // 订单状态
retCode: 0, // 失败时的原因码
createdAt: Date.now(), // 订单创建时间
@@ -9,6 +9,8 @@ import PaymentPoller from "./PaymentPoller";
import proto from 'db://assets/Scripts/proto/proto.pb.js';
import { DataManager, DataId } from "db://assets/Scripts/chat18x/data/DataManager";
import { OrderData } from "db://assets/Scripts/chat18x/data/OrderData";
import Utils from "../../Main/Common/Utils";
import { InnerMsgCode } from "../../Main/Config/InnerMsgCode";
export class PaymentService {
private static _I: PaymentService | null = null;
@@ -29,6 +31,9 @@ export class PaymentService {
const orderData = DataManager.I.getDataById<OrderData>(DataId.Order);
orderData.saveOrderData(create.data);
// 发出事件,支付订单创建成功
Utils.sendInnerMsg(InnerMsgCode.PayOrderCreateSucc, { orderId: orderId });
// 打开支付页
await PaymentOpenerFactory.create(open).open(payUrl);
+6
View File
@@ -16,6 +16,12 @@ export type OrderStatus =
export interface OrderVO {
orderId: string;
payUrl: string;
payType: number;
network: number;
wallet: string;
amount: string;
expire: number;
expireUnix: string;
status: OrderStatus;
retCode: number; // 失败时的原因码
createdAt: number;