Paymill::REST - A wrapper around PAYMILL's payment API
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",
}
);
Paymill::REST is a wrapper around PAYMILL's payment API.
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.
Not all operations are available to every item factory (currently only
delete
is not available to Paymill::REST::Item::Refund).
-
Creating new items
-
Delete existing items
-
Find a single item
-
List all or a subset of items
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 toSTDOUT
.
Note: every other option you'll find in the code is only meant for development of this module and shouldn't be changed!
Matthias Dietrich perl@rainboxx.de
Copyright 2013 - Matthias Dietrich
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
-
PAYMILL:
-
Item factories:
Paymill::REST::Clients, Paymill::REST::Offers, Paymill::REST::Payments, Paymill::REST::Preauthorizations, Paymill::REST::Refunds, Paymill::REST::Subscriptions, Paymill::REST::Transactions, Paymill::REST::Webhooks
-
Item modules:
Paymill::REST::Item::Client, Paymill::REST::Item::Offer, Paymill::REST::Item::Payment, Paymill::REST::Item::Preauthorization, Paymill::REST::Item::Refund, Paymill::REST::Item::Subscription, Paymill::REST::Item::Transaction, Paymill::REST::Item::Webhook
- Add ability to save changes to item objects
- Add convenience operations (eg.
refund
for transactions) where possible