UNPKG

mercadopago

Version:
17 lines (16 loc) 612 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = cancel; /** * Cancel advanced-payment operation. * * Sends a `PUT /v1/advanced_payments/:id` with `{ status: "cancelled" }`. * * @module advancedPayment/cancel */ const restClient_1 = require("../../../utils/restClient"); function cancel({ id, config }) { return restClient_1.RestClient.fetch(`/v1/advanced_payments/${id}`, Object.assign({ method: 'PUT', headers: { 'Authorization': `Bearer ${config.accessToken}`, }, body: JSON.stringify({ status: 'cancelled' }) }, config.options)); }