UNPKG

mercadopago

Version:
18 lines (17 loc) 667 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = capture; /** * Capture advanced-payment operation. * * Sends a `PUT /v1/advanced_payments/:id` with `{ capture: true }` to * finalise a two-step (authorise → capture) payment flow. * * @module advancedPayment/capture */ const restClient_1 = require("../../../utils/restClient"); function capture({ id, config }) { return restClient_1.RestClient.fetch(`/v1/advanced_payments/${id}`, Object.assign({ method: 'PUT', headers: { 'Authorization': `Bearer ${config.accessToken}`, }, body: JSON.stringify({ capture: true }) }, config.options)); }