File Coverage

lib/WebService/Braintree/PayPalAccount.pm
Criterion Covered Total %
statement 8 15 53.3
branch n/a
condition n/a
subroutine 3 7 42.8
pod 2 4 50.0
total 13 26 50.0


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