Please consider using: https://github.com/ruudk/PaymentMollieBundle
This Symfony3 bundle adds support for iDEAL payments by Mollie. It is using Mollie-php-api. A Mollie account is required.
For more information see Mollie
Installation is a quick 3 step process:
- Download ideal-bundle using composer
- Enable the Bundle in AppKernel.php
- Configure your Mollie credentials
Add UsoftIDealBundle by running the command:
$ composer require shivella/ideal-bundle
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Usoft\IDealBundle\UsoftIDealBundle(),
);
}
# app/config/config.yml
# ideal Mollie
usoft_i_deal:
mollie:
key: secret_mollie_key
description: "Mollie payment"
<?php
// Acme/Bundle/OrderController.php
public function paymentAction(Request $request)
{
$form = $this->createForm(IdealType::class);
$form->handleRequest($request);
if ($form->isValid()) {
$mollie = $this->get('mollie');
$bank = new Bank($form->get('bank')->getData());
$amount = (float) 120.99;
return $mollie->execute($bank, $amount, 'route_to_confirm_action');
}
return $this->render('payment.html.twig', ['form' => $form->createView()]);
}
/**
* @Route("/order/confirm", name="route_to_confirm_action")
*
* @param Request $request
*/
public function confirmAction(Request $request)
{
if ($this->get('mollie')->confirm($request)) {
// handle order....
} else {
// Something went wrong...
}
}