mercadopago
Version:
Mercadopago SDK for Node.js
23 lines (22 loc) • 801 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = capture;
const path_1 = require("../../../utils/path");
/**
* Capture order operation -- sends `POST /v1/orders/{id}/capture`.
*
* @module clients/order/capture
*/
const restClient_1 = require("../../../utils/restClient");
/**
* Capture an authorized order, confirming the payment settlement.
*
* Only applicable to orders created with `capture_mode: "manual"`.
*
* @returns The updated order with captured payment status.
*/
function capture({ id, config }) {
return restClient_1.RestClient.fetch(`/v1/orders/${(0, path_1.encodePathParam)(id)}/capture`, Object.assign({ method: 'POST', headers: {
'Authorization': `Bearer ${config.accessToken}`,
} }, config.options));
}