File Coverage

blib/lib/WebService/Braintree/PayPalAccount.pm
Criterion Covered Total %
statement 3 10 30.0
branch n/a
condition n/a
subroutine 1 5 20.0
pod 2 4 50.0
total 6 19 31.5


line stmt bran cond sub pod time code
1             package WebService::Braintree::PayPalAccount;
2             $WebService::Braintree::PayPalAccount::VERSION = '0.93';
3             =head1 NAME
4              
5             WebService::Braintree::PayPalAccount
6              
7             =head1 PURPOSE
8              
9             This class finds and updates PayPal accounts.
10              
11             =cut
12              
13 1     1   7 use Moose;
  1         2  
  1         10  
14             extends 'WebService::Braintree::PaymentMethod';
15              
16             =head1 CLASS METHODS
17              
18             =head2 find()
19              
20             This takes a token and returns the PayPal account (if it exists).
21              
22             =cut
23              
24             sub find {
25 0     0 1   my ($class, $token) = @_;
26 0           $class->gateway->paypal_account->find($token);
27             }
28              
29             =head2 update()
30              
31             This takes a token and a hashref of parameters. It will update the
32             corresponding PayPal account (if found) and returns the updated PayPal account.
33              
34             =cut
35              
36             sub update {
37 0     0 1   my ($class, $token, $params) = @_;
38 0           $class->gateway->paypal_account->update($token, $params);
39             }
40              
41             sub gateway {
42 0     0 0   WebService::Braintree->configuration->gateway;
43             }
44              
45             =head1 OBJECT METHODS
46              
47             In addition to the methods provided by the keys returned from Braintree, this
48             class provides the following methods:
49              
50             =head2 email()
51              
52             =cut
53              
54             has email => ( is => 'rw' );
55              
56             sub BUILD {
57 0     0 0   my ($self, $attributes) = @_;
58 0           $self->set_attributes_from_hash($self, $attributes);
59             }
60              
61             __PACKAGE__->meta->make_immutable;
62              
63             1;
64             __END__
65              
66             =head1 NOTES
67              
68             Most of the classes normally used in WebService::Braintree inherit from
69             L<WebService::Braintree::ResultObject/>. This class, however, inherits from
70             L<WebService::Braintree::PaymentMethod/>. The primary benefit of this is that
71             these objects have a C<< token() >> attribute.
72              
73             =head1 TODO
74              
75             =over 4
76              
77             =item Need to document the keys and values that are returned
78              
79             =item Need to document the required and optional input parameters
80              
81             =item Need to document the possible errors/exceptions
82              
83             =back
84              
85             =cut