Business/CyberSource/Rule/ExpiredCard.pm

filter: Statementstmt 80.0% 16 / 20 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 48.8% 21 / 43 CC 6 SCAR 32.4
CC
6
Cov
48%
run
42.0
BEGIN
1.0
BEGIN
1.0
CRAP 25.6
« Business/CyberSource/Client.pm ↑ Summary Business/CyberSource/Rule/RequestIDisZero.pm »
1 package Business::CyberSource::Rule::ExpiredCard;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '0.010007'; # VERSION
7  
8 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 extends 'Business::CyberSource::Rule';
10  
11 sub run {
12 0 ▶ my ( $self, $request ) = @_;
Subroutine run: not called CC=6 SCAR=37.4
Pod documented
13  
14 # if the request can card it's required so no need to check has
15 0 ▶ return unless $request->can('card')
Branch: 1 branch
BranchTrueFalseTotal
unless $request->can("card") and builtin::blessed($request->card) and $request->card->can("is_expired") and $request->card->is_expired 0 0 0
Condition0%0/9
$request->can("card") and builtin::blessed($request->card) and $request->card->can("is_expired") and $request->card->is_expired
!ll&&!rl&&r
000
$request->can("card") and builtin::blessed($request->card) and $request->card->can("is_expired")
!ll&&!rl&&r
000
$request->can("card") and builtin::blessed($request->card)
!ll&&!rl&&r
000
MC/DC0%0/4
$request->can("card") and builtin::blessed($request->card) and $request->card->can("is_expired") and $request->card->is_expired
$request->can("card") builtin::blessed($request->card) $request->card->can("is_expired") $request->card->is_expired
Truth table0%0/5
A and B and C and D
A= $request->can("card")B= builtin::blessed($request->card)C= $request->card->can("is_expired")D= $request->card->is_expired
ABCDresult
0XXX0
10XX0
110X0
11100
11111
16 && blessed $request->card
17 && $request->card->can('is_expired')
18 && $request->card->is_expired
19 ;
20  
21 0 ▶ $self->debug if $self->client->debug;
Branch: 1 branch
BranchTrueFalseTotal
if $self->client->debug 0 0 0
22  
23 return {
24 0 merchantReferenceCode => $request->reference_code,
25 decision => 'REJECT',
26 reasonCode => '202',
27 requestID => 0,
28 requestToken => 0,
29 };
30 }
31  
32 1 __PACKAGE__->meta->make_immutable;
33 1 1;
34 # ABSTRACT: Expired Card
35  
36 __END__
37  
38 =pod
39  
40 =encoding UTF-8
41  
42 =head1 NAME
43  
44 Business::CyberSource::Rule::ExpiredCard - Expired Card
45  
46 =head1 VERSION
47  
48 version 0.010007
49  
50 =head1 METHODS
51  
52 =head2 run
53  
54 returns a REJECT 202 if card is expired.
55  
56 =head1 BUGS
57  
58 Please report any bugs or feature requests on the bugtracker website
59 https://github.com/xenoterracide/business-cybersource/issues
60  
61 When submitting a bug or request, please include a test-file or a
62 patch to an existing test-file that illustrates the bug or desired
63 feature.
64  
65 =head1 AUTHOR
66  
67 Caleb Cushing <xenoterracide@gmail.com>
68  
69 =head1 COPYRIGHT AND LICENSE
70  
71 This software is Copyright (c) 2016 by Caleb Cushing <xenoterracide@gmail.com>.
72  
73 This is free software, licensed under:
74  
75 The Artistic License 2.0 (GPL Compatible)
76  
77 =cut
« Business/CyberSource/Client.pm ↑ Summary Business/CyberSource/Rule/RequestIDisZero.pm »