shivella/ideal-bundle

This package is abandoned and no longer maintained. The author suggests using the ruudk/payment-mollie-bundle package instead.

Symfony iDeal Bundle

Installs: 2 412

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 1

Open Issues: 0

Type:symfony-bundle

1.0.6 2018-09-18 09:14 UTC

This package is not auto-updated.

Last update: 2020-01-26 01:14:51 UTC


README

Please consider using: https://github.com/ruudk/PaymentMollieBundle

Mollie iDeal bundle

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

Latest Stable Version License Total Downloads Coverage Status Scrutinizer Code Quality

Installation

Installation is a quick 3 step process:

  1. Download ideal-bundle using composer
  2. Enable the Bundle in AppKernel.php
  3. Configure your Mollie credentials

Step 1: Download ideal-bundle using composer

Add UsoftIDealBundle by running the command:

$ composer require shivella/ideal-bundle

Step 2: Enable the Bundle in AppKernel.php

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Usoft\IDealBundle\UsoftIDealBundle(),
    );
}

Step 3: Configure Mollie credentials

# app/config/config.yml

# ideal Mollie
usoft_i_deal:
    mollie:
        key: secret_mollie_key
        description: "Mollie payment"

Usage in Controller

<?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...
    }
}