Menno Blom


Business::iDEAL::Mollie - Backend for iDEAL payments through


  use strict;
  use Business::iDEAL::Mollie;

  my $mollie = new Business::iDEAL::Mollie;
  # First you will have to grab the bank list (the list might
  # change, so make sure you do this).

  my $banks = $mollie->banklist;

  # Then, you probably want to feed your user the URL of
  # the right bank.

  my $resp = $mollie->fetch({
               partnerid  => 'your partner id',
               amount     => '1250',
               bank_id    => $banks->[2]{'bank_id'},
               description=> 'Acme Labs: order# foo-bar-123'
               reporturl  => '',
               returnurl  => ''
  if($resp) {
     # ... probably some Database activity here 
     # with $resp->{'transaction_id'} and some redirection
     # headers with $resp->{'URL'}
  } else {
     # Do something with $mollie->error, which contains the 
     # status_line of LWP::UserAgent

Meanwhile, in a nearby piece of code (mollie.cgi in this example)

  # The easy way ...

  if($q->param('transaction_id')) {
           partnerid      => 'your partner id',
           transaction_id => $q->param('transaction_id'),
        })) {
        # Do something with the verified transaction_id
     } else {
        # Not payed, or checked more than once...

  # The more complicated way

  if($q->param('transaction_id')) {
     my $resp = $mollie->check({
                  partnerid      => 'your partner id',
                  transaction_id => $q->param('transaction_id'),
     if($resp->{'payed'} eq 'true') {
        # Do something with $resp->{'amount'}, $resp->{'currency'}, etc.
     } else {
        # Log, cry, do anything here with the failed check.


Business::iDEAL::Mollie provides a backend to process iDEAL payments through


The following methods can be used


new creates a new Business::iDEAL::Mollie object.



Defaults to, but could be set to a different URL for testing (e.g.


Configure your own LWP UserAgent.


First of all, you need to fetch a list of bank_ids and bank_names. This list is subject to change, and recommends checking this list for each transaction. Returns an arrayref of hashes with bank_id and bank_name.


After you've retrieved the banklist, your users may choose the preferred bank. Now you can feed that 'bank_id', together with 'partnerid', 'amount', 'description', 'reporturl' and 'returnurl'.

This method returns the transaction_id that you should store for later reference, aswell as URL of the bank's iDEAL page that the user should be directed to.


See for more information on how to get a partnerid.


The amount in cents. So 10 euro should be written as 1000. This module removes periods and columns by default, but don't count on this to go perfect!


The bank_id as retrieved by the "banklist" method. Include leading zeros where needed. The bank id should contain 4 digits.


A description of the payment in 29 characters or less (more chars will be stripped by This description will be used by the actual banks, so make sure it's clear for your users.


The URL of your script handling the query by when a transaction is completed. This script should perform the "check" method.


The URL of where to redirect your users to after the payment process is done.


After the user went through the payment process, will fire off a GET request on your "reporturl". This GET request will include the "transaction_id" that you stored during "fetch" method.

This method requires the "partnerid" aswell as the "transaction_id" you just received, and returns the status of the order.


Simple wrapper around the "check" method. Returns a true value when the order is payed for, and a false value when this is not the case.


The error method will return any errors encountered (mainly, or solely LWP::UserAgent based). Note that all methods also return a message from, explaining the answers a little.



Please report any bugs to


M. Blom, <>,


Copyright (C) 2006 by M. Blom

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.