mercadopago
Version:
Mercadopago SDK for Node.js
24 lines (23 loc) • 882 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = update;
const path_1 = require("../../../utils/path");
/**
* Implementation of the "update preference" operation.
*
* Sends a PUT to `/checkout/preferences/{id}` with the modified fields
* and returns the updated preference resource.
*
* @module clients/preference/update
*/
const restClient_1 = require("../../../utils/restClient");
/**
* Update an existing Checkout Pro preference.
*
* @returns The updated preference resource.
*/
function update({ id, updatePreferenceRequest, config }) {
return restClient_1.RestClient.fetch(`/checkout/preferences/${(0, path_1.encodePathParam)(id)}`, Object.assign({ method: 'PUT', headers: {
'Authorization': `Bearer ${config.accessToken}`,
}, body: JSON.stringify(updatePreferenceRequest) }, config.options));
}