import BaseStore from '@src/stores/base';
// import * as querystring from 'querystring';

export default class OrderStore extends BaseStore {
  allCheckout() {
    return this.apiGet('/order/checkout/all');
  }

  addCheckout(productType, productId, service, param) {
    return this.apiPost('/order/checkout/add', { productType, productId, service, param });
  }

  removeCheckout(checkoutId) {
    return this.apiDelete('/order/checkout/delete', { checkoutId });
  }

  confirmPay() {
    return this.apiPost('/order/pay/confirm');
  }

  speedPay(productType, productId, service, param) {
    return this.apiPost('/order/pay/speed', { productType, productId, service, param });
  }

  wechatQr(orderId) {
    return this.apiPost('/order/wechat/qr', { orderId });
  }

  wechatJs(orderId) {
    return this.apiPost('/order/wechat/js', { orderId });
  }

  alipayQr(orderId) {
    return this.apiPost('/order/alipay/qr', { orderId });
  }
}

export const Order = new OrderStore({ key: 'order' });