From 27bbc6da8b031c0b358250f30eeed27218385578 Mon Sep 17 00:00:00 2001 From: Rhames Lima Date: Thu, 23 Dec 2021 14:38:01 -0300 Subject: [PATCH] Added paymentMethods resource and listAll method (#214) * Added paymentMethods resource and listAll method * Resource case adjustment --- lib/mercadopago.js | 2 ++ lib/resources/paymentMethods.js | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 lib/resources/paymentMethods.js diff --git a/lib/mercadopago.js b/lib/mercadopago.js index 5af1bb84..e4e6715d 100644 --- a/lib/mercadopago.js +++ b/lib/mercadopago.js @@ -2,6 +2,7 @@ var configurations = require('./configurations'); var backwardSupport = require('./mercadopago-support')(); var utilsModule = require('./utils'); var paymentModule = require('./resources/payment'); +var paymentMethodsModule = require('./resources/paymentMethods'); var preferencesModule = require('./resources/preferences'); var preapprovalModule = require('./resources/preapproval'); var merchantOrdersModule = require('./resources/merchantOrders'); @@ -64,6 +65,7 @@ resources = { utils: utilsModule, configurations: configurations, payment: paymentModule, + payment_methods: paymentMethodsModule, preferences: preferencesModule, preapproval: preapprovalModule, merchant_orders: merchantOrdersModule, diff --git a/lib/resources/paymentMethods.js b/lib/resources/paymentMethods.js new file mode 100644 index 00000000..e8cd2b33 --- /dev/null +++ b/lib/resources/paymentMethods.js @@ -0,0 +1,14 @@ +var requestManager = require('../request-manager'); + +var paymentMethods = module.exports = {} + +/** + * Get payment methods + * [Click here for more infos]{@link https://www.mercadopago.com.br/developers/en/reference/payment_methods/_payment_methods/get/} + * @function listAll + * @memberof paymentMethods + */ +paymentMethods.listAll = requestManager.describe({ + path: '/v1/payment_methods', + method: 'GET' +}); \ No newline at end of file