feat(payment): connect payment service flow
This commit is contained in:
@@ -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,
|
||||
};
|
||||
Reference in New Issue
Block a user