Business/CyberSource/Rule/RequestIDisZero.pm

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