NAME

PagSeguro::API - UOL PagSeguro Payment Gateway API Module

SYNOPSIS

use PagSeguro::API;

# new instance
my $ps = PagSeguro::API->new(
    debug   => 1,                   # enable debug
    sandbox => 1,                   # enable sandbox
    email   => 'sandbox@bar.com', 
    token   =>'95112EE828D94278BD394E91C4388F20'
);


# load transaction by code
my $transaction = $ps->transaction
    ->load('TRANSACTION_CODE_HERE');

# api xml response to perl hash
say $transaction->{sender}->{name}; # Foo Bar

VARS

Enviroment variables that you can define to configure your access, debug mode, sandbox use, etc...

email

Configure email to access api.

my $ps = PagSeguro::API->new( email => 'joe@doe.com' );

or you can use env var

$ENV{PAGSEGURO_API_EMAIL} = 'joe@doe.com';

token

Configure token to access api.

my $ps = PagSeguro::API->new( token => '95112EE828D94278BD394E91C4388F20' );

or you can use env var

$ENV{PAGSEGURO_API_TOKEN} = '95112EE828D94278BD394E91C4388F20';

sandbox

Configure module to use sandbox mode (default is 0).

my $ps = PagSeguro::API->new( sandbox => 1 );

or you can use env var

$ENV{PAGSEGURO_API_SANDBOX} = 1;

debug

Configure module to use debug mode (default is 0).

my $ps = PagSeguro::API->new( debug => 1 );

or you can use env var

$ENV{PAGSEGURO_API_DEBUG} = 1;

ACCESSORS

Public properties and their accessors

email

This is the user registered email that you need to use PagSeguro payment API.

# get or set email property
$ps->email('foo@bar.com');
say $ps->email; 

*email is a required properties to access HTTP GET based API urls.

token

This is a key that you need to use PagSeguro payment API.

# get or set token property
$ps->token('95112EE828D94278BD394E91C4388F20');
say $ps->token;

*token is a required properties to access HTTP GET based API urls.

METHODS

new

my $ps = PagSeguro::API->new;

or pass paramethers...

my $ps = PagSeguro::API->new(
    email => 'foo@bar.com', token => '95112EE828D94278BD394E91C4388F20'
);

checkout

# getting product checkout class instance
my $c = $ps->checkout;

$ps->checkout( PagSeguro::API::Checkout->new );

transaction

# getting transaction class instance
my $t = $ps->transaction;

$ps->transaction( PagSeguro::API::Transaction->new );

PagSeguro::API::Transaction is a class that will provide access to transaction methods for API.

See more informations about at PagSeguro::API::Transaction.

notification

# getting notification class instance
my $n = $ps->notification;

$ps->notification( PagSeguro::API::Notification->new );

PagSeguro::API::Notification is a class that will provide access to notification methods for API.

See more informations about at PagSeguro::API::Notification.

BUG

Please, send bug reports to my CPAN user email at dvinci@cpan.org.

git-repository:

https://github.com/dvinciguerra/p5-pagseguro-api

AUTHOR

Daniel Vinciguerra <daniel.vinciguerra@bivee.com.br>

2013 (c) Bivee http://bivee.com.br

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Bivee.

This is a free software; you can redistribute it and/or modify it under the same terms of Perl 5 programming languagem system itself.