Mollie driver for the Omnipay PHP payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP. This package implements Mollie support for Omnipay.
Omnipay is installed via Composer. To install, simply require league/omnipay
and omnipay/mollie
with Composer:
composer require league/omnipay omnipay/mollie
The following gateways are provided by this package:
- Mollie
For general usage instructions, please see the main Omnipay repository.
$gateway = \Omnipay\Omnipay::create('Mollie');
$gateway->setApiKey('test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM');
$response = $gateway->purchase(
[
"amount" => "10.00",
"currency" => "EUR",
"description" => "My first Payment",
"returnUrl" => "https://webshop.example.org/mollie-return.php"
]
)->send();
// Process response
if ($response->isSuccessful()) {
// Payment was successful
print_r($response);
} elseif ($response->isRedirect()) {
// Redirect to offsite payment gateway
$response->redirect();
} else {
// Payment failed
echo $response->getMessage();
}
If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.
If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.