File Coverage

blib/lib/WebService/Braintree/Disbursement.pm
Criterion Covered Total %
statement 6 14 42.8
branch n/a
condition n/a
subroutine 2 5 40.0
pod 1 2 50.0
total 9 21 42.8


line stmt bran cond sub pod time code
1             package WebService::Braintree::Disbursement;
2             $WebService::Braintree::Disbursement::VERSION = '0.93';
3             =head1 NAME
4              
5             WebService::Braintree::Disbursement
6              
7             =head1 PURPOSE
8              
9             This class represents a disbursement.
10              
11             =cut
12              
13 1     1   10 use WebService::Braintree::Transaction;
  1         4  
  1         45  
14              
15 1     1   11 use Moose;
  1         3  
  1         13  
16             extends "WebService::Braintree::ResultObject";
17              
18             =head1 CLASS METHODS
19              
20             This class is B<NOT> an interface, so it does B<NOT> have any class methods.
21              
22             =head1 OBJECT METHODS
23              
24             =cut
25              
26             sub BUILD {
27 0     0 0   my ($self, $attributes) = @_;
28              
29 0           $self->merchant_account(WebService::Braintree::MerchantAccount->new($attributes->{merchant_account}));
30 0           delete($attributes->{merchant_account});
31 0           $self->set_attributes_from_hash($self, $attributes);
32             }
33              
34             =pod
35              
36             In addition to the methods provided by B<TODO>, this class provides the
37             following methods:
38              
39             =head2 merchant_account()
40              
41             This returns the merchant account associated with this notification (if any).
42             This will be an object of type L<WebService::Braintree::MerchantAccount/>.
43              
44             =cut
45              
46             has merchant_account => (is => 'rw');
47              
48             =head2 transactions()
49              
50             This returns the transactions associated with this disbursement. This is a
51             wrapper around L<WebService::Braintree::Transaction/search()>.
52              
53             =cut
54              
55             sub transactions {
56 0     0 1   my $self = shift;
57             WebService::Braintree::Transaction->search(sub {
58 0     0     my $search = shift;
59 0           $search->ids->in($self->transaction_ids);
60 0           });
61             }
62              
63             __PACKAGE__->meta->make_immutable;
64              
65             1;
66             __END__
67              
68             =head1 TODO
69              
70             =over 4
71              
72             =item Need to document the keys and values that are returned
73              
74             =item Need to document the required and optional input parameters
75              
76             =item Need to document the possible errors/exceptions
77              
78             =back
79              
80             =cut