Braintree/CreditCard.pm

filter: Statementstmt 61.0% 36 / 59 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 11 / 22 Podpod 0.0% 0 / 11 totaltotal 50.0% 47 / 94 CC 2 SCAR 6.3
CC
2
Cov
59%
BUILD
6.0
create
2.0
delete
2.0
CRAP 1.9
« Braintree/Address.pm ↑ Summary Braintree/PaymentMethod.pm »
1 package Net::Braintree::CreditCard;
2 1 ▶use Net::Braintree::CreditCard::CardType;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Net::Braintree::CreditCard::Location;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Net::Braintree::CreditCard::Prepaid;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Net::Braintree::CreditCard::Debit;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Net::Braintree::CreditCard::Payroll;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Net::Braintree::CreditCard::Healthcare;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Net::Braintree::CreditCard::DurbinRegulated;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Net::Braintree::CreditCard::Commercial;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Net::Braintree::CreditCard::CountryOfIssuance;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Net::Braintree::CreditCard::IssuingBank;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 extends 'Net::Braintree::PaymentMethod';
15  
16 1 my $meta = __PACKAGE__->meta;
17  
18 sub BUILD {
19 0 ▶ my ($self, $attributes) = @_;
Subroutine BUILD: not called CC=2 SCAR=17.9
Pod undocumented
20 0 $meta->add_attribute('billing_address', is => 'rw');
21 0 ▶ $self->billing_address(Net::Braintree::Address->new($attributes->{billing_address})) if ref($attributes->{billing_address}) eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
if ref $attributes->{"billing_address"} eq "HASH" 0 0 0
22 0 delete($attributes->{billing_address});
23 0 $self->set_attributes_from_hash($self, $attributes);
24 }
25  
26 sub create {
27 0 ▶ my ($class, $params) = @_;
Subroutine create: not called CC=1 SCAR=6.9
Pod undocumented
28 0 $class->gateway->credit_card->create($params);
29 }
30  
31 sub delete {
32 0 ▶ my ($class, $token) = @_;
Subroutine delete: not called CC=1 SCAR=6.9
Pod undocumented
33 0 $class->gateway->credit_card->delete($token);
34 }
35  
36 sub update {
37 0 ▶ my($class, $token, $params) = @_;
Subroutine update: not called CC=1 SCAR=6.9
Pod undocumented
38 0 $class->gateway->credit_card->update($token, $params);
39 }
40  
41 sub find {
42 0 ▶ my ($class, $token) = @_;
Subroutine find: not called CC=1 SCAR=6.9
Pod undocumented
43 0 $class->gateway->credit_card->find($token);
44 }
45  
46 sub from_nonce {
47 0 ▶ my ($class, $nonce) = @_;
Subroutine from_nonce: not called CC=1 SCAR=6.9
Pod undocumented
48 0 $class->gateway->credit_card->from_nonce($nonce);
49 }
50  
51 sub gateway {
52 0 ▶ Net::Braintree->configuration->gateway;
Subroutine gateway: not called CC=1 SCAR=6.9
Pod undocumented
53 }
54  
55 sub masked_number {
56 0 ▶ my $self = shift;
Subroutine masked_number: not called CC=1 SCAR=6.9
Pod undocumented
57 0 return $self->bin . "******" . $self->last_4;
58 }
59  
60 sub expiration_date {
61 0 ▶ my $self = shift;
Subroutine expiration_date: not called CC=1 SCAR=6.9
Pod undocumented
62 0 return $self->expiration_month . "/" . $self->expiration_year;
63 }
64  
65 sub is_default {
66 0 ▶ return shift->default;
Subroutine is_default: not called CC=1 SCAR=6.9
Pod undocumented
67 }
68  
69 sub is_venmo_sdk {
70 0 ▶ my $self = shift;
Subroutine is_venmo_sdk: not called CC=1 SCAR=6.9
Pod undocumented
71 0 return $self->venmo_sdk;
72 }
73  
74 1 1;
« Braintree/Address.pm ↑ Summary Braintree/PaymentMethod.pm »