Skip to content

rainboxx/Paymill-REST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Paymill::REST - A wrapper around PAYMILL's payment API

SYNOPSIS

use Paymill::REST;

# only once
$Paymill::REST::PRIVATE_KEY = '<YOUR PRIVATE API KEY>';

my $trx_api             = Paymill::REST::Transactions->new;
my $created_transaction = $trx_api->create(
    {
        amount      => 4200,
        token       => '098f6bcd4621d373cade4e832627b4f6',
        currency    => 'USD',
        description => "Hitchhiker's Guide to the Galaxy",
    }
);

DESCRIPTION

Paymill::REST is a wrapper around PAYMILL's payment API.

GENERAL ARCHITECTURE

It is intended that things such creating and retrieving items is done through operations called on the respective Paymill::REST::* modules (a so called item factory), so everything related to transactions is achieved through Paymill::REST::Transactions.

Each operation of those factories is returning one or a list of the appropriate item modules, so operations called on Paymill::REST::Transactions are returning one or a list of Paymill::REST::Item::Transaction.

AVAILABLE OPERATIONS

Not all operations are available to every item factory (currently only delete is not available to Paymill::REST::Item::Refund).

CONFIGURATION

Each item factory inherits from Paymill::REST::Base, which is holding all the configuration. The following options are available, pass them to new:

  • api_key

    Defines your private API key which you get from PAYMILL. Should be set as $Paymill::REST::PRIVATE_KEY as seen in the synopsis above instead of passing it to the constructor.

  • proxy

    An URI or URI string which is passed to LWP::UserAgent's proxy method for connecting to the PAYMILL API.

  • debug

    Setting this to 1 results in debug messages printed to STDOUT.

Note: every other option you'll find in the code is only meant for development of this module and shouldn't be changed!

AUTHOR

Matthias Dietrich perl@rainboxx.de

COPYRIGHT

Copyright 2013 - Matthias Dietrich

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

TODO

  • Add ability to save changes to item objects
  • Add convenience operations (eg. refund for transactions) where possible