UNPKG

mercadopago

Version:
24 lines (23 loc) 810 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = list; const path_1 = require("../../../utils/path"); /** * Implementation of the customer card list operation. * * Sends a GET request to `/v1/customers/:id/cards` to retrieve all * saved payment cards for a customer. * * @module clients/customerCard/list */ const restClient_1 = require("../../../utils/restClient"); /** * List all saved payment cards for a customer. * * @returns An array of card records belonging to the customer. */ function list({ customerId, config }) { return restClient_1.RestClient.fetch(`/v1/customers/${(0, path_1.encodePathParam)(customerId)}/cards`, Object.assign({ headers: { 'Authorization': `Bearer ${config.accessToken}` } }, config.options)); }