mercadopago
Version:
Mercadopago SDK for Node.js
24 lines (23 loc) • 884 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = remove;
const path_1 = require("../../../utils/path");
/**
* Implementation of the customer card removal operation.
*
* Sends a DELETE request to `/v1/customers/:id/cards/:card_id` to
* remove a saved payment card from a customer's wallet.
*
* @module clients/customerCard/remove
*/
const restClient_1 = require("../../../utils/restClient");
/**
* Remove a saved card from a customer's wallet.
*
* @returns The card record that was deleted.
*/
function remove({ customerId, cardId, config }) {
return restClient_1.RestClient.fetch(`/v1/customers/${(0, path_1.encodePathParam)(customerId)}/cards/${(0, path_1.encodePathParam)(cardId)}`, Object.assign({ headers: {
'Authorization': `Bearer ${config.accessToken}`
}, method: 'DELETE' }, config.options));
}