UNPKG

moip-sdk-node-ts

Version:
22 lines (21 loc) 1.06 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, '/customers', _id); const getAll = (opts) => api_1.default.get(opts, '/customers'); const query = (opts, _query) => api_1.default.get(opts, '/customers', null, null, utils_1.getQuerystring(_query)); const create = (opts, customer) => api_1.default.post(opts, '/customers', customer); const createCreditCard = (opts, _id, creditCard) => api_1.default.post(opts, `/customers/${_id}/fundinginstruments`, creditCard); const removeCreditCard = (opts, _id) => api_1.default.remove(opts, `/fundinginstruments/${_id}`); exports.default = { getOne: getOne, getAll: getAll, create: create, query: query, createCreditCard: createCreditCard, removeCreditCard: removeCreditCard, };