feat(payment): implement coffee tip plans and update payment flow
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
CreatePaymentOrderResponse,
|
||||
PaymentOrderStatusResponse,
|
||||
PaymentPlansResponse,
|
||||
TipPaymentPlansResponse,
|
||||
} from "@/data/dto/payment";
|
||||
|
||||
import { ApiPath } from "./api_path";
|
||||
@@ -25,6 +26,16 @@ export class PaymentApi {
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取咖啡打赏套餐列表。 */
|
||||
async getTipPlans(): Promise<TipPaymentPlansResponse> {
|
||||
const env = await httpClient<ApiEnvelope<unknown>>(
|
||||
ApiPath.paymentTipPlans,
|
||||
);
|
||||
return TipPaymentPlansResponse.fromJson(
|
||||
unwrap(env) as Record<string, unknown>,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建支付订单
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user