Business::CPI - Common Payment Interface
version 0.912
# the objects are created with the same keys my $paypal = Business::CPI->new( gateway => "PayPal", receiver_id => "test@example.com", ... ); my $pagseguro = Business::CPI->new( gateway => "PagSeguro", receiver_id => "test@example.com", ... ); # the method names and arguments are similar my $pag_transactions = $pagseguro->query_transactions({ start_date => DateTime->now->subtract({ days => 5 }), end_date => DateTime->now, }); my $pay_transactions = $paypal->query_transactions({ start_date => DateTime->now->subtract({ days => 5 }), end_date => DateTime->now, });
Business::CPI intends to create a common interface between different payment gateways interfaces. There are on CPAN a few modules which provide interfaces for payment API's like PayPal (Business::PayPal::*), PagSeguro (PagSeguro::Status), and so forth. But each of these are completely different.
Business::CPI provides a common interface, making it really easy to support several payment gateways in a single application.
Loads and instantiates the gateway. Requires the key 'gateway', and returns the instance of Business::CPI::Gateway::$gateway. All the other arguments are passed to the gateway constructor.
Example:
my $test1 = Business::CPI->new(gateway => 'Test', %data); my $test2 = Business::CPI::Gateway::Test->new(%data); # exactly the same as above
Aware - http://www.aware.com.br
This is alpha software. The interface is unstable, and may change without notice.
André Walker <andre@andrewalker.net>
This software is copyright (c) 2014 by André Walker.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Business::CPI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::CPI
CPAN shell
perl -MCPAN -e shell install Business::CPI
For more information on module installation, please visit the detailed CPAN module installation guide.