mercadopago
Version:
Mercadopago SDK for Node.js
38 lines (37 loc) • 1.31 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Chargeback = void 0;
/**
* Chargeback client for the MercadoPago API.
*
* Provides read-only access to chargeback dispute records initiated by
* cardholders through their issuing bank.
*
* @module chargeback
*/
const get_1 = __importDefault(require("./get"));
const search_1 = __importDefault(require("./search"));
class Chargeback {
constructor(mercadoPagoConfig) {
this.config = mercadoPagoConfig;
}
/**
* Retrieve a single chargeback by its ID.
*/
get({ id, requestOptions }) {
this.config.options = Object.assign(Object.assign({}, this.config.options), requestOptions);
return (0, get_1.default)({ id, config: this.config });
}
/**
* Search chargebacks with optional filters.
*/
search(chargebackSearchOptions = {}) {
const { options, requestOptions } = chargebackSearchOptions;
this.config.options = Object.assign(Object.assign({}, this.config.options), requestOptions);
return (0, search_1.default)({ options, config: this.config });
}
}
exports.Chargeback = Chargeback;