mercadopago
Version:
Mercadopago SDK for Node.js
24 lines (23 loc) • 843 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = process;
const path_1 = require("../../../utils/path");
/**
* Process order operation -- sends `POST /v1/orders/{id}/process`.
*
* @module clients/order/process
*/
const restClient_1 = require("../../../utils/restClient");
/**
* Process an order, triggering payment execution for its transactions.
*
* The order must already contain at least one payment transaction
* before it can be processed.
*
* @returns The updated order with the resulting payment statuses.
*/
function process({ id, config }) {
return restClient_1.RestClient.fetch(`/v1/orders/${(0, path_1.encodePathParam)(id)}/process`, Object.assign({ method: 'POST', headers: {
'Authorization': `Bearer ${config.accessToken}`,
} }, config.options));
}