fix(payment): consume first recharge offer after payment

This commit is contained in:
2026-07-03 10:54:46 +08:00
parent bb6ebbae7e
commit 489554cd78
13 changed files with 137 additions and 27 deletions
@@ -20,6 +20,9 @@ export interface IPaymentRepository {
/** 获取本地缓存套餐列表。 */
getCachedPlans(): Promise<Result<PaymentPlansResponse | null>>;
/** 清除本地缓存套餐列表。 */
clearCachedPlans(): Promise<Result<void>>;
/** 获取会员套餐列表。 */
getVipPlans(): Promise<Result<PaymentPlan[]>>;
@@ -41,6 +41,14 @@ export class PaymentRepository implements IPaymentRepository {
});
}
/** 清除本地缓存套餐列表。 */
async clearCachedPlans(): Promise<Result<void>> {
return Result.wrap(async () => {
const result = await PaymentPlansStorage.clearPlans();
if (Result.isErr(result)) throw result.error;
});
}
/** 获取会员套餐列表。 */
async getVipPlans(): Promise<Result<PaymentPlan[]>> {
return Result.wrap(async () => {