This is a Next.js project that utilizes Mollie's node JS library.
sequenceDiagram
Buyer ->> Merchant: Choose Mollie payment method
Merchant ->>+ Mollie: Create Payment
Mollie -->>- Merchant: hosted checkout URL
Merchant -->> Buyer: Redirect to Mollie hosted checkout
Buyer ->>+ Mollie: Interact on Mondu Hosted Checkout
Mollie -->> Buyer: Redirect to success page
Mollie -->> Merchant: Webhook
After cloning the project, create your own copy of the environment file:
cp .env.example .env.local
nano .env.local
MOLLIE_API_KEY
is your test API key (starts withtest_
)DOMAIN
is the domain the app is running on, including protocol (https://
orhttp://
)WEBHOOK_URL
is a URL where Mollie will send webhooks. Can be different. Recommendation for local development: https://webhook.site
You'll need your own Mollie API key from Mollie's merchant dashboard.
If no domain is set, we will simply use localhost for redirects. If no webhook URL is set, webhooks will fail.
Then, run the development server:
npm run dev
Open http://localhost:3000 with your browser and start testing payments.
✅ make payments work
✅ log webhooks
▫️ Auth/Capture
✅ Get payment methods from methods API
✅ list recent payments
✅ Use Mollie Components where it makes sense
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out the Next.js deployment documentation for more details.