
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
mollie-api-node
Advanced tools
Note:
This is the README of the v2 Node client. If you are looking for the README of v1 you should look here.
Node client for Mollie's API.
Mollie builds payment products, commerce solutions and APIs that let you accept online and mobile payments, for small online stores and Fortune 500s alike. Accepting iDEAL, Bancontact/Mister Cash, SOFORT Banking, Creditcard, SEPA Bank transfer, SEPA Direct debit, Bitcoin, PayPal, Belfius Direct Net and paysafecard online payments without fixed monthly costs or any punishing registration procedures. Just use the Mollie API to receive payments directly on your website or easily refund transactions to your customers.
To use the Mollie API client, the following things are required:
Using npm:
npm install mollie-api-node --save
Or using yarn:
yarn add mollie-api-node
This will add mollie-api-node
to your project's dependencies.
You may also git checkout or download all the files, and include the Mollie API client manually.
Check the releases page to know which versions are available.
To successfully receive a payment, these steps should be implemented:
Use the client to create a payment with the requested amount
, description
, redirectUrl
and webhookUrl
and optionally, a payment method
. It is important to specify a unique redirectUrl
where the customer is supposed to return to after the payment is completed.
After the payment is completed, our platform will send a request to the provided webhookUrl
to allow the payment details to be retrieved, so you know exactly when to start processing the customer's order.
The customer returns, and should be satisfied to see that the order was paid and is now being processed.
To be able to receive data from the API, an app should authenticate with a bearer token, referred to as API keys.
We've already prepared this step by creating a test
and live
key for you in your Dashboard.
Import the client and set your API key
const mollie = require('mollie-api-node')({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' });
mollie.payments.create({
amount: 10.00,
description: 'My first API payment',
redirectUrl: 'https://yourwebshop.example.org/order/123456',
webhookUrl: 'https://yourwebshop.example.org/webhook'
})
.then((payment) => {
// Forward the customer to the payment.getPaymentUrl()
})
.catch((err) => {
// Handle the error
});
mollie.payments.get(payment.id)
.then((payment) => {
// E.g. check if the payment.isPaid()
})
.catch((err) => {
// Handle the error
});
That's it!
To help you get the most out of this client, we've prepared reference documentation, tutorials and other examples that will help you learn and understand how to use this library.
For a deep dive in how our systems function we refer to our excellent guides. These guides provide a complete overview of the Mollie API and cover specific topics dealing with a number of important aspects of the API.
This library is a wrapper around our Mollie API. Some more specific details such as query parameters and pagination are better explained in our API reference, and you can also get a better understanding of how the requests look under the hood.
The API client v2.0 was a major rewrite, with some breaking changes. While the basic functionality stayed the same and the method names did not change, some function signatures have changed.
See the migration guide for more information.
Want to help us make our API client even better? We take pull requests.
Mollie is always looking for new talent to join our teams. We’re looking for inquisitive minds with good ideas and strong opinions, and, most importantly, who know how to ship great products. Want to join the future of payments? Check out our vacancies.
New BSD (Berkeley Software Distribution) License. Copyright 2013-2017, Mollie B.V.
FAQs
Official Mollie API client for Node (by Mollie B.V.)
The npm package mollie-api-node receives a total of 442 weekly downloads. As such, mollie-api-node popularity was classified as not popular.
We found that mollie-api-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.