mercadopago
Version:
Mercadopago SDK for Node.js
26 lines (25 loc) • 898 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = update;
/**
* Update-payment operation.
*
* Sends a `PUT /v1/payments/:id` request with an arbitrary body to
* update fields on an existing payment resource.
*
* @module clients/payment/update
*/
const restClient_1 = require("../../../utils/restClient");
/**
* Update a payment by its identifier.
*
* @param id - Identifier of the payment to update.
* @param body - Fields to update on the payment resource.
* @param config - SDK configuration including the access token.
* @returns The updated payment resource.
*/
function update({ id, body, config }) {
return restClient_1.RestClient.fetch(`/v1/payments/${id}`, Object.assign({ method: 'PUT', headers: {
'Authorization': `Bearer ${config.accessToken}`,
}, body: JSON.stringify(body) }, config.options));
}