The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

PagSeguro::API::Transaction - Transaction Class for PagSeguro::API module

SYNOPSIS

    use PagSeguro::API;

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


    # transaction obj
    my $t = $ps->transaction;

    # load transaction by code
    my $transaction = $t->load('766B9C-AD4B044B04DA-77742F5FA653-E1AB24');
    
    # search transaction by date range
    my $list = $t->search(
        initial => '2013-10-01T00:00',
        final   => '2013-10-30T00:00',
        page    => 1,
        max     => 1000,
    );

    # search abandoned transaction by date range
    my $list = $t->abandoned(
        initial => '2013-10-01T00:00',
        final   => '2013-10-30T00:00',
        page    => 1,
        max     => 1000,
    );

    # transaction returns perl hash
    say $transaction->{code}; # 00000000-0000-0000-0000-000000000000

DESCRIPTION

PagSeguro::API::Transaction is a class that provide access to transaction api search methods.

ACCESSORS

Public properties and their accessors

resource

    my $t = $ps->transaction;
    say $t->resource('BASE_URI');

PagSeguro::API::Resource is a container that store all connectoin url parts and some other things;

METHODS

new

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

load

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

    # load transaction by code
    my $transaction = $t->load('00000000-0000-0000-0000-000000000000');

    say $transaction->{code};

This method will load a transaction by code and returns a perl hash as success result or undef as error or not found;

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

    # load transaction by date range
    my $list = $t->search(
        initial => '2013-10-01T00:00', 
        final   => '2013-10-30T00:00', 
        page    => 1, 
        max     => 10000
    );

This method will get a list of transactions by date range and returns a perl hash as success result or undef as error or not found;

abandoned

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

    # load abandoned transaction by date range
    my $list = $t->abandoned(
        initial => '2013-10-01T00:00', 
        final   => '2013-10-30T00:00', 
        page    => 1, 
        max     => 10000
    );

This method will get a list of abandoned transactions by date range and returns a perl hash as success result or undef as error or not found;

AUTHOR

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

Daniel Vinciguerra <daniel.vinciguerra@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.