53 lines
1.4 KiB
TypeScript
Vendored
53 lines
1.4 KiB
TypeScript
Vendored
import { get, post } from './client'
|
|
|
|
export interface TopUpInfo {
|
|
epay_enabled: boolean
|
|
stripe_enabled: boolean
|
|
creem_enabled: boolean
|
|
waffo_enabled: boolean
|
|
checkin_enabled: boolean
|
|
min_amount: number
|
|
discount: number
|
|
discount_msg: string
|
|
}
|
|
|
|
export function getTopUpInfo() {
|
|
return get<TopUpInfo>('/user/topup/info')
|
|
}
|
|
|
|
export function redeemCode(code: string) {
|
|
return post<{ success: boolean; message: string }>('/user/topup', { key: code })
|
|
}
|
|
|
|
export function epayPay(amount: number, method: string) {
|
|
return post<{ url: string }>('/user/topup/epay', { amount, method })
|
|
}
|
|
|
|
export function stripePay(amount: number) {
|
|
return post<{ url: string }>('/user/topup/stripe', { amount })
|
|
}
|
|
|
|
export function creemPay(amount: number) {
|
|
return post<{ url: string }>('/user/topup/creem', { amount })
|
|
}
|
|
|
|
export function waffoPay(amount: number) {
|
|
return post<{ url: string }>('/user/topup/waffo', { amount })
|
|
}
|
|
|
|
export function waffoPancakePay(amount: number) {
|
|
return post<{ url: string }>('/user/topup/waffo-pancake', { amount })
|
|
}
|
|
|
|
export function checkIn() {
|
|
return post<{ success: boolean; message: string; quota: number }>('/user/checkin')
|
|
}
|
|
|
|
export function getCheckInStatus() {
|
|
return get<{ checked_in: boolean; quota: number }>('/user/checkin/status')
|
|
}
|
|
|
|
export function transferAffQuota(quota: number) {
|
|
return post<{ success: boolean; message: string }>('/user/aff_quota', { quota })
|
|
}
|