lib/WebService/Braintree/PayPalAccount.pm

filter: Statementstmt 52.1% 12 / 23 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 37.5% 3 / 8 Podpod 100% 5 / 5 totaltotal 51.2% 20 / 39 CC 2 SCAR 9.4
CC
2
Cov
48%
sale
6.0
find
2.0
create
2.0
CRAP 2.6
« lib/WebService/Braintree/Xml.pm ↑ Summary lib/WebService/Braintree/CreditCardVerificationGateway.pm »
1 # vim: sw=4 ts=4 ft=perl
2  
3 package WebService::Braintree::PayPalAccount;
4 22 $WebService::Braintree::PayPalAccount::VERSION = '1.7';
5 22 ▶use 5.010_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 22 ▶use strictures 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 WebService::Braintree::PayPalAccount
11  
12 =head1 PURPOSE
13  
14 This class finds, creates, updates, and deletes PayPal accounts.
15  
16 =cut
17  
18 22 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 22 with 'WebService::Braintree::Role::Interface';
21  
22 =head1 CLASS METHODS
23  
24 =head2 find()
25  
26 This takes a token and returns the PayPal account (if it exists).
27  
28 =cut
29  
30 0 ▶sub find {
Subroutine find: not called CC=1 SCAR=6.9
Pod documented
31 0 my ($class, $token) = @_;
32 0 $class->gateway->paypal_account->find($token);
33 }
34  
35 =head2 create()
36  
37 This takes a hashref of parameters. It will create a PayPal account.
38  
39 =cut
40  
41 0 ▶sub create {
Subroutine create: not called CC=1 SCAR=6.9
Pod documented
42 0 my ($class, $params) = @_;
43 0 $class->gateway->paypal_account->create($params);
44 }
45  
46 =head2 update()
47  
48 This takes a token and a hashref of parameters. It will update the
49 corresponding PayPal account (if found) and returns the updated PayPal account.
50  
51 =cut
52  
53 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
Pod documented
54 0 my ($class, $token, $params) = @_;
55 0 $class->gateway->paypal_account->update($token, $params);
56 }
57  
58 =head2 delete()
59  
60 This takes a token and deletes the corresponding PayPal account (if found).
61  
62 =cut
63  
64 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
Pod documented
65 0 my ($class, $token) = @_;
66 0 $class->gateway->paypal_account->delete($token);
67 }
68  
69 =head2 sale()
70  
71 This takes a token and a hashref of transaction parameters and creates a sale
72 with that token.
73  
74 =cut
75  
76 0 ▶sub sale {
Subroutine sale: not called CC=2 SCAR=17.9
Pod documented
77 0 my ($class, $token, $params) = @_;
78 $class->gateway->transaction->sale({
79 0 ▶ %{$params // {}},
Condition0%0/2
$params // {}
l!l
00
MC/DC0%0/1
$params // {}
$params
Truth table0%0/2
A
A= $params
Aresult
11
00
80 payment_method_token => $token,
81 });
82 }
83  
84 22 __PACKAGE__->meta->make_immutable;
85  
86 22 1;
87 __END__
« lib/WebService/Braintree/Xml.pm ↑ Summary lib/WebService/Braintree/CreditCardVerificationGateway.pm »