import { ApiResponse, Pay } from "@/types";
import flyio from "../flyio";
// @ts-ignore
import qs from 'qs';

export function getEcardPrices(params: any) {
  return flyio.get('/front/ecard/getEcardPrices', params) as Promise<ApiResponse<Pay.EcardPrice[]>>;
}

export function createOrder(params: any) {
  return flyio.post('/front/ecard/createOrder?' + qs.stringify(params)) as Promise<ApiResponse<Pay.CreateOrderResult>>;
}

export function queryOrder(orderId: string) {
  return flyio.get('/front/ecard/getOrderPayStatus', { orderId }) as Promise<ApiResponse<Pay.OrderPayStatus>>;
}