feat(payment): connect payment service flow

This commit is contained in:
2026-06-18 15:40:59 +08:00
parent 35c30ac31e
commit a347b39001
34 changed files with 759 additions and 889 deletions
+37
View File
@@ -0,0 +1,37 @@
/**
* Payment 状态机:State 形状 + 初始值
*/
import type {
PayChannel,
PaymentOrderStatus,
PaymentPlan,
PaymentVipStatusResponse,
} from "@/data/dto/payment";
export interface PaymentState {
plans: PaymentPlan[];
selectedPlanId: string;
payChannel: PayChannel;
autoRenew: boolean;
agreed: boolean;
currentOrderId: string | null;
payParams: Record<string, unknown> | null;
orderStatus: PaymentOrderStatus | null;
vipStatus: PaymentVipStatusResponse | null;
errorMessage: string | null;
launchNonce: number;
}
export const initialState: PaymentState = {
plans: [],
selectedPlanId: "",
payChannel: "stripe",
autoRenew: true,
agreed: false,
currentOrderId: null,
payParams: null,
orderStatus: null,
vipStatus: null,
errorMessage: null,
launchNonce: 0,
};