Christiaan Kras > Mollie-Micropayment-0.04-withoutworldwriteables > Mollie::Micropayment

Download:
Mollie-Micropayment-0.04-withoutworldwriteables.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  

NAME ^

Mollie::Micropayment - Perl API for Mollie's Micropayment service

SYNOPSIS ^

  # 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';
  }

DESCRIPTION ^

Mollie::Micropayment is an API to handle micropayments from Mollie.nl. It's design and usage is based on the PHP class.

METHODS The following methods can be used

new

new creates a new Mollie::Micropayment object.

partnerid

Set and/or get your Mollie account ID.

amount

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.

country

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

servicenumber

Set and/or get the telephone number that the user has to call.

paycode

Set and/or get the paycode. This is the code that the user has to enter through the phone.

payinfo

Requests new payment info from Mollie.nl.

checkpayment

Checks the status of the current payment.

is_payed

Returns 'true' if the payment is completed. 'false' If the payment is still in progress or not yet finished.

currency

The currency in which the user has to pay. Currently the next currencies can be returned by Mollie.nl:

        eur
        dollar
        gbp

costpercall

Returns the amount of money the user has to pay for a call.

costperminute

Returns the amount of money the user has to pay per minute.

duration

Returns the estimated time in seconds the user has to stay on the phone

mode

Returns the type of phonecall. Mollie chooses the best solution for the given amount. These are:

        cpc     cost per call
        ppm     pay per minute

EXPORT

None by default.

SEE ALSO ^

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.

AUTHOR ^

C. Kras, <c.kras@cpan.org>

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: