mercadopago
Version:
Mercadopago SDK for Node.js
58 lines (57 loc) • 2.36 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PaymentRefund = void 0;
const get_1 = __importDefault(require("./get"));
const create_1 = __importDefault(require("./create"));
const list_1 = __importDefault(require("./list"));
const total_1 = __importDefault(require("./total"));
/**
* Mercado Pago Refund.
*
* @see {@link https://www.mercadopago.com/developers/en/reference Documentation }.
*/
class PaymentRefund {
constructor(mercadoPagoConfig) {
this.config = mercadoPagoConfig;
}
/**
* Mercado Pago Get Refund.
*
* @see {@link https://github.com/mercadopago/sdk-nodejs/blob/master/src/examples/paymentRefund/get.ts Usage Example }.
*/
get({ payment_id, refund_id, requestOptions }) {
this.config.options = Object.assign(Object.assign({}, this.config.options), requestOptions);
return (0, get_1.default)({ payment_id, refund_id, config: this.config });
}
/**
* Mercado Pago Create Refund.
*
* @see {@link https://github.com/mercadopago/sdk-nodejs/blob/master/src/examples/paymentRefund/create.ts Usage Example }.
*/
create({ payment_id, body, requestOptions }) {
this.config.options = Object.assign(Object.assign({}, this.config.options), requestOptions);
return (0, create_1.default)({ payment_id, body, config: this.config });
}
/**
* Mercado Pago Create Refund.
*
* @see {@link https://github.com/mercadopago/sdk-nodejs/blob/master/src/examples/paymentRefund/create.ts Usage Example }.
*/
total({ payment_id, requestOptions }) {
this.config.options = Object.assign(Object.assign({}, this.config.options), requestOptions);
return (0, total_1.default)({ payment_id, config: this.config });
}
/**
* Mercado Pago Get Refund List.
*
* @see {@link https://github.com/mercadopago/sdk-nodejs/blob/master/src/examples/paymentRefund/list.ts Usage Example }.
*/
list({ payment_id, requestOptions }) {
this.config.options = Object.assign(Object.assign({}, this.config.options), requestOptions);
return (0, list_1.default)({ payment_id, config: this.config });
}
}
exports.PaymentRefund = PaymentRefund;