Files
taimed-international-app/types/order.d.ts

68 lines
1.2 KiB
TypeScript

// types/order.d.ts
/**
* 订单创建参数接口
*/
export interface ICreateOrderParams {
paymentMethod: '4' | '5' // 支付方式: 4-虚拟币, 5-Google Pay
orderMoney: number | string // 订单金额
abroadBookId: number // 图书ID
orderType: 'abroadBook' // 订单类型
}
/**
* Google Pay 验证参数接口
*/
export interface IGooglePayVerifyParams {
purchaseToken: string // 购买凭证
orderSn: string // 订单号
productId: string // 产品ID
}
/**
* 订单创建响应接口
*/
export interface ICreateOrderResponse {
code: number
orderSn: string // 订单号
msg?: string
}
/**
* Google Pay SKU 信息接口
*/
export interface IGooglePaySku {
productId: string
type: string
price: string
price_amount_micros: number
price_currency_code: string
title: string
description: string
}
/**
* Google Pay 支付结果接口
*/
export interface IGooglePayResult {
code: number
data?: Array<{
original: {
purchaseToken: string
orderId: string
packageName: string
productId: string
purchaseTime: number
purchaseState: number
}
}>
}
/**
* 支付方式选项接口
*/
export interface IPaymentOption {
value: '4' | '5'
name: string
}