UNPKG

react-native-razorpay-api

Version:
27 lines (26 loc) 1.29 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const convertor_1 = __importDefault(require("./convertor")); const subscriptions_1 = __importDefault(require("./subscriptions")); ; class customers extends subscriptions_1.default { constructor() { super(...arguments); this.customers = { get: (options) => { if (options === null || options === void 0 ? void 0 : options.customer_id) return this.get('/customers/' + (options === null || options === void 0 ? void 0 : options.customer_id)); else return this.get('/customers', convertor_1.default.getOptions(options)); }, details: (customer_id) => this.get('/customers/' + customer_id), create: (data) => this.post('/customers', Object.assign(Object.assign({}, data), { fail_existing: (data === null || data === void 0 ? void 0 : data.fail_existing) == false ? 0 : 1 })), update: (customer_id, data) => this.update('/customers/' + customer_id, data) }; } } ; exports.default = customers;