UNPKG

moip-sdk-node-ts

Version:
24 lines (23 loc) 1 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const api_1 = __importDefault(require("../client/api")); const utils_1 = require("../utils"); const getOne = (opts, _id) => api_1.default.get(opts, '/orders', _id); const getAll = (opts) => api_1.default.get(opts, '/orders'); const query = (opts, _query) => api_1.default.get(opts, '/orders', null, null, utils_1.getQuerystring(_query)); const create = (opts, order) => api_1.default.post(opts, '/orders', order); const refund = (opts, _id, method) => api_1.default.post(opts, `/orders/${_id}/refunds`, method || null); const getRefunds = (opts, _id) => api_1.default.get(opts, `/orders/${_id}/refunds`); exports.default = { getOne: getOne, getAll: getAll, create: create, query: query, refunds: { refund: refund, getRefunds: getRefunds, }, };