Braintree/PaymentMethodGateway.pm

filter: Statementstmt 36.3% 8 / 22 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 28.5% 2 / 7 Podpod 0.0% 0 / 4 totaltotal 25.0% 10 / 40 CC 3 SCAR 16.3
CC
3
Cov
30%
find
12.0
create
2.0
update
2.0
CRAP 5.1
« Braintree/AdvancedSearch.pm ↑ Summary Braintree/Transaction.pm »
1 package Net::Braintree::PaymentMethodGateway;
2 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Carp qw(confess);
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 has 'gateway' => (is => 'ro');
6  
7 0 ▶sub create {
Subroutine create: not called CC=1 SCAR=6.9
Pod undocumented
8 0 my ($self, $params) = @_;
9 0 $self->_make_request("/payment_methods", 'post', {payment_method => $params});
10 }
11  
12 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
Pod undocumented
13 0 my ($self, $token, $params) = @_;
14 0 $self->_make_request("/payment_methods/any/" . $token, "put", {payment_method => $params});
15 }
16  
17 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
Pod undocumented
18 0 my ($self, $token) = @_;
19 0 $self->_make_request("/payment_methods/any/" . $token, 'delete');
20 }
21  
22 0 ▶sub find {
Subroutine find: not called CC=3 SCAR=24.8
Pod undocumented
23 0 my ($self, $token) = @_;
24 0 ▶ if (!defined($token) || Net::Braintree::Util::trim($token) eq "") {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $token or Net::Braintree::Util::trim($token) eq "") 0 0 0
Condition0%0/3
not defined $token or Net::Braintree::Util::trim($token) eq ""
l!l&&r!l&&!r
000
MC/DC0%0/2
not defined $token or Net::Braintree::Util::trim($token) eq ""
not defined $token Net::Braintree::Util::trim($token) eq ""
Truth table0%0/3
not(A) or B
A= not defined $tokenB= Net::Braintree::Util::trim($token) eq ""
ABresult
1X1
011
000
25 0 confess "NotFoundError";
26 }
27  
28 0 my $response = $self->_make_request("/payment_methods/any/" . $token, 'get');
29 0 return $response->payment_method;
30 }
31  
32 0 ▶sub _make_request {
Subroutine _make_request: not called CC=1 SCAR=6.9
33 0 my ($self, $path, $verb, $params) = @_;
34 0 my $response = $self->gateway->http->$verb($path, $params);
35  
36 0 return Net::Braintree::Result->new(response => $response);
37 }
38  
39 1 1;
« Braintree/AdvancedSearch.pm ↑ Summary Braintree/Transaction.pm »