UNPKG

mercadopago

Version:
24 lines (23 loc) 990 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = updateTransaction; const path_1 = require("../../../../utils/path"); /** * Update transaction operation -- sends `PUT /v1/orders/{id}/transactions/{transactionId}`. * * @module clients/order/transaction/update */ const restClient_1 = require("../../../../utils/restClient"); /** * Update an existing payment transaction within an order. * * Replaces the transaction's payment data (amount, payment method) * with the values provided in the request body. * * @returns The updated payment method details. */ function updateTransaction({ id, transactionId, body, config }) { return restClient_1.RestClient.fetch(`/v1/orders/${(0, path_1.encodePathParam)(id)}/transactions/${(0, path_1.encodePathParam)(transactionId)}`, Object.assign({ method: 'PUT', headers: { 'Authorization': `Bearer ${config.accessToken}` }, body: JSON.stringify(body) }, config.options)); }