UNPKG

perfectpago

Version:

A Simple integration for mercadopago

23 lines (22 loc) 591 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class PaymentMethods { constructor(options) { this.accessToken = options.accessToken; this.BASE_URL = ' https://api.mercadopago.com'; } /** * * @returns {object} */ async get() { const data = await fetch(`${this.BASE_URL}/v1/payment_methods`, { method: "GET", headers: { 'Authorization': `Bearer ${this.accessToken}` } }); return await data.json(); } } exports.default = PaymentMethods;