Mollie::Micropayment - Perl API for Mollie's Micropayment service
# Basic setup. Example included that fully handles payment use Mollie::Micropayment; my $mollie = new Mollie::Micropayment; $mollie->partnerid(10000); # Set your account ID $mollie->amount(0.50); # Set the amount to pay (EUR 0.50) $mollie->country(31); # Set the country code (Netherlands) # Handle payment $mollie->checkpayment() if ($mollie->is_payed() eq "true") { print 'User payed succesfully!'; } else { print 'payment is not (fully) done, send the user back to the payment-screen'; } # Show payment screen if ($mollie->is_payed() eq "false" && $mollie->payinfo()) { # print information about how to pay and put a submit button here. Look at included example } else { print 'Unable to fetch payment info'; }
Mollie::Micropayment is an API to handle micropayments from Mollie.nl. It's design and usage is based on the PHP class.
Mollie::Micropayment
new creates a new Mollie::Micropayment object.
new
Set and/or get your Mollie account ID.
Set and/or get the amount of money you want for the payment. Value can be a integer or float. Do not set a value under 0.41. This is because Mollie returns a error when using a value that's too low.
Set your country code. Default is 31, which is for the Netherlands. If a wrong country code has been set the script will give a error.
Country Country code Netherlands 31 Belgium 32 Germany 49 England 44 France 33 Italy 39 Switserland 41 Austria 43
Set and/or get the telephone number that the user has to call.
Set and/or get the paycode. This is the code that the user has to enter through the phone.
Requests new payment info from Mollie.nl.
Checks the status of the current payment.
Returns 'true' if the payment is completed. 'false' If the payment is still in progress or not yet finished.
The currency in which the user has to pay. Currently the next currencies can be returned by Mollie.nl:
eur dollar gbp
Returns the amount of money the user has to pay for a call.
Returns the amount of money the user has to pay per minute.
Returns the estimated time in seconds the user has to stay on the phone
Returns the type of phonecall. Mollie chooses the best solution for the given amount. These are:
cpc cost per call ppm pay per minute
None by default.
More info about Mollie.nl micropayments can be fount at http://www.mollie.nl/informatie/micropayments/
You need an account at Mollie.nl to view the technical documentation. Please read it before you use this module.
A online example can be viewed and downloaded at the following adress: http://perl.pcc-online.net/Mollie-Micropayment/. The example has also been included in this release. It's located in the directory /scripts.
C. Kras, <c.kras@cpan.org>
Copyright (C) 2010 by C. Kras
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.8 or, at your option, any later version of Perl 5 you may have available.
To install Mollie::Micropayment, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mollie::Micropayment
CPAN shell
perl -MCPAN -e shell install Mollie::Micropayment
For more information on module installation, please visit the detailed CPAN module installation guide.