mollie / mollie-api-php
Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment But
Installs: 10 201 964
Dependents: 55
Suggesters: 1
Security: 0
Stars: 572
Watchers: 67
Forks: 195
Open Issues: 0
Requires
- php: ^7.4|^8.0
- ext-curl: *
- ext-json: *
- ext-openssl: *
- composer/ca-bundle: ^1.4
- nyholm/psr7: ^1.8
- psr/http-client: ^1.0
- psr/http-factory: ^1.1
- psr/http-message: ^2.0
Requires (Dev)
- brianium/paratest: ^6.11
- guzzlehttp/guzzle: ^7.6
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^9.6
- symfony/var-dumper: ^5.4|^6.4|^7.2
Suggests
- mollie/oauth2-mollie-php: Use OAuth to authenticate with the Mollie API. This is needed for some endpoints. Visit https://docs.mollie.com/ for more information.
- dev-master
- v3.x-dev
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v3.0.0-beta.11
- v3.0.0-beta.10
- v3.0.0-beta.9
- v3.0.0-beta.8
- v3.0.0-beta.7
- v3.0.0-beta.6
- v3.0.0-beta.5
- v3.0.0-beta.4
- v3.0.0-beta.3
- v3.0.0-beta.2
- v3.0.0-beta.1
- v2.x-dev
- v2.79.0
- v2.78.0
- v2.77.0
- v2.76.1
- v2.76.0
- v2.75.0
- v2.74.1
- v2.74.0
- v2.73.0
- v2.72.0
- v2.71.0
- v2.70.0
- v2.69.0
- v2.68.0
- v2.67.1
- v2.67.0
- v2.66.0
- v2.65.0
- v2.64.0
- v2.63.0
- v2.62.0
- v2.61.0
- v2.60.0
- v2.59.0
- v2.58.0
- v2.58.0-beta
- v2.57.0
- v2.56.1
- v2.56.0
- v2.55.0
- v2.54.0
- v2.53.0
- v2.52.1
- v2.52.0
- v2.51.0
- v2.50.1
- v2.50.0
- v2.49.2
- v2.49.1
- v2.49.0
- v2.48.0
- v2.47.0
- v2.46.0
- v2.45.0
- v2.44.1
- v2.44.0
- v2.43.0
- v2.42.1
- v2.42.0
- v2.41.0
- v2.40.2
- v2.40.1
- v2.40.0
- v2.39.0
- v2.38.0
- v2.37.1
- v2.37.0
- v2.36.1
- v2.36.0
- v2.35.0
- v2.34.0
- v2.33.0
- v2.32.2
- v2.32.1
- v2.32.0
- v2.31.2
- v2.31.1
- v2.31.1-alpha
- v2.31.0
- v2.31.0-alpha
- v2.30.2
- v2.30.1
- v2.30.0
- v2.29.0
- v2.28.0
- v2.27.2
- v2.27.1
- v2.27.0
- v2.26.0
- v2.25.0
- v2.24.0
- v2.23.0
- v2.22.3
- v2.22.2
- v2.22.2alpha
- v2.22.1
- v2.22.0
- v2.21.0
- v2.20.0
- v2.19.0
- v2.18.0
- 2.17.1
- v2.17.0
- v2.16.0
- v2.15.0
- v2.14.0
- v2.13.1
- v2.13.0
- v2.12.1
- v2.12.0
- v2.11.0
- v2.10.0
- v2.9.2
- v2.9.1
- v2.9.0
- v2.8.3
- v2.8.2
- v2.8.1
- v2.8.0
- v2.7.0
- v2.6.1
- v2.6.0
- v2.5.0
- v2.4.2
- v2.4.1
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- 2.1.0
- v2.1.0-beta-1
- v2.0.14
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-beta-1
- v1.19.13
- v1.9.12
- v1.9.11
- v1.9.10
- v1.9.9
- v1.9.7
- v1.9.6
- v1.9.5
- v1.9.4
- v1.9.3
- v1.9.2
- 1.9.1
- 1.9.0
- 1.8.1
- 1.8.0
- 1.7.1
- 1.7.0
- 1.6.6
- 1.6.5
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.0
- 1.5.1
- 1.5.0
- 1.4.1
- v1.4.0
- 1.3.3
- 1.3.2
- 1.3.1
- 1.2.11
- 1.2.10
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-main
- dev-feat/small-improvements
- dev-fix/save-metadata-as-array-not-json-encoded
- dev-v1-develop
This package is auto-updated.
Last update: 2025-04-23 11:39:41 UTC
README
Mollie API client for PHP
Accepting iDEAL, Apple Pay, Bancontact, SOFORT Banking, Creditcard, SEPA Bank transfer, SEPA Direct debit, PayPal, Belfius Direct Net, KBC/CBC, paysafecard, ING Home'Pay, Giropay, EPS, Przelewy24, Postepay, In3, Klarna (Pay now, Pay later, Slice it, Pay in 3), Giftcard and Voucher 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.
Requirements
To use the Mollie API client, the following things are required:
- Get yourself a free Mollie account. No sign up costs.
- Now you're ready to use the Mollie API client in test mode.
- Follow a few steps to enable payment methods in live mode, and let us handle the rest.
- PHP >= 7.4
- cUrl >= 7.19.4
- Up-to-date OpenSSL (or other SSL/TLS toolkit)
For leveraging Mollie Connect (advanced use cases only), we recommend also installing our OAuth2 client.
Installation
Using Composer
The easiest way to install the Mollie API client is by using Composer. You can require it with the following command:
composer require mollie/mollie-api-php
Usage
Initializing the Mollie API client, and setting your API key.
$mollie = new \Mollie\Api\MollieApiClient(); $mollie->setApiKey("test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM");
Find our full documentation online on docs.mollie.com.
Example usage
use Mollie\Api\Http\Data\Money; use Mollie\Api\Http\Requests\CreatePaymentRequest; /** @var Mollie\Api\Http\Response $response */ $response = $mollie->send(new CreatePaymentRequest( description: 'My first API payment', amount: new Money('EUR', '10.00'), redirectUrl: 'https://webshop.example.org/order/12345/', webhookUrl: 'https://webshop.example.org/mollie-webhook/' )); /** @var Mollie\Api\Resources\Payment $payment */ $payment = $response->toResource();
Documentation
For an in-depth understanding of our API, please explore the Mollie Developer Portal. Our API documentation is available in English.
For detailed documentation about using this PHP client, see the following guides:
- Endpoint Collections - Learn how to interact with all available API endpoints.
- HTTP Adapters - Information on customizing HTTP communication.
- Idempotency - Best practices and setup for idempotent requests.
- Payments - Comprehensive guide on handling payments.
- Requests - Overview and usage of request objects in the API client.
- Responses - Handling and understanding responses from the API.
- Testing - Guidelines for testing with the Mollie API client.
- Debugging - How to debug API requests and responses safely.
These guides provide in-depth explanations and examples for advanced usage of the client.
Recipes
The Mollie API client comes with a variety of recipes to help you understand how to implement various API features. These recipes are a great resource for learning how to integrate Mollie payments into your application.
Here are some of the key recipes included:
-
Payments: Demonstrates how to handle various payment scenarios.
-
Customers: Shows how to manage customers and their payments.
-
Subscriptions and Recurring Payments:
For a full list of recipes, please refer to the recipes directory.
These recipes are designed to help you integrate Mollie into your application. Make sure to use your test API keys when testing the integration.
Upgrading
Please see UPGRADING for details.
Contributing to Our API Client
Would you like to contribute to improving our API client? We welcome pull requests. But, if you're interested in contributing to a technology-focused organization, Mollie is actively recruiting developers and system engineers. Discover our current job openings or reach out.
License
BSD (Berkeley Software Distribution) License. Copyright (c) 2013-2018, Mollie B.V.
Support
Contact: www.mollie.com — info@mollie.com — +31 20 820 20 70