0.0.2 • Published 3 years ago

sezam-group-manager-client v0.0.2

Weekly downloads
3
License
ISC
Repository
-
Last release
3 years ago

Sezam Group Manager Client

Using npm:

$ npm install sezam-group-manager-client

Guide

Dependencies

Importing

CommonJS usage

const SezamGroupManagerClient = require('sezam-group-manager-client');

ES6 usage

import SezamGroupManagerClient from 'sezam-group-manager-client';

Module init

const token = 'get token there https://idontknowsezamdomain.zyx'
const commerceGroupManager = new SezamGroupManagerClient(token);

You should register your products to provide products ID in our system.

createOrder(customerId: number | string, productId: number | string): Promise

commerceGroupManager.createOrder(customerId, productId)
  .then(order => {
    // do something there
  })
  .catch(error => {
    // handle error
  }); 

cancelOrder(orderId: number | string): Promise

commerceGroupManager.cancelOrder(orderId)
  .then(orderStatus => {
    // do something there
  })
  .catch(error => {
    // handle error
  }); 

getOrderInfo(orderId: number | string): Promise

commerceGroupManager.getOrderInfo(customerId, productId)
  .then(orderInfo => {
    // do something with order
  })
  .catch(error => {
    // handle error
  });