Files
cozsweet-frontend-nextjs/src/data/repositories/interfaces/ipayment_repository.ts
T

41 lines
1.2 KiB
TypeScript

/**
* IPaymentRepository 接口
*/
import type {
CreatePaymentOrderResponse,
GiftProductsResponse,
PayChannel,
PaymentOrderStatusResponse,
PaymentPlansResponse,
TipMessageResponse,
} from "@/data/schemas/payment";
import type { Result } from "@/utils/result";
export interface IPaymentRepository {
/** 获取套餐列表。 */
getPlans(): Promise<Result<PaymentPlansResponse>>;
/** 获取本地缓存套餐列表。 */
getCachedPlans(): Promise<Result<PaymentPlansResponse | null>>;
/** 获取当前角色的完整礼物目录。 */
getGiftProducts(characterId: string): Promise<Result<GiftProductsResponse>>;
/** 清除本地缓存套餐列表。 */
clearCachedPlans(): Promise<Result<void>>;
/** 创建支付订单。 */
createOrder(
planId: string,
payChannel: PayChannel,
autoRenew: boolean,
recipientCharacterId?: string,
): Promise<Result<CreatePaymentOrderResponse>>;
/** 查询支付订单状态。 */
getOrderStatus(orderId: string): Promise<Result<PaymentOrderStatusResponse>>;
/** 获取已支付礼物订单的角色感谢文案。 */
getTipMessage(orderId: string): Promise<Result<TipMessageResponse>>;
}