GoCardless/MandateImport.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond 60.0% 6 / 10 MC/DCmcdc 20.0% 1 / 5 Subroutinesub 100% 10 / 10 Podpod 28.5% 2 / 7 totaltotal 74.5% 38 / 51 CC 6 SCAR 5.6
CC
6
Cov
86%
submitted
2.1
cancelled
2.1
processing
2.1
CRAP 1.7
« GoCardless/OutboundPayment.pm ↑ Summary GoCardless/MandateImportEntry.pm »
1 package Business::GoCardless::MandateImport;
2  
3 =head1 NAME
4  
5 Business::GoCardless::MandateImport
6  
7 =head1 DESCRIPTION
8  
9 A class for a gocardless mandate import, extends L<Business::GoCardless::Resource>
10  
11 =cut
12  
13 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 5 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 5 extends 'Business::GoCardless::Resource';
18  
19 =head1 ATTRIBUTES
20  
21 created_at
22 id
23 links
24 scheme
25 status
26  
27 =cut
28  
29 5 has [ qw/
30 created_at
31 id
32 links
33 scheme
34 status
35 / ] => (
36 is => 'rw',
37 );
38  
39 =head1 Operations on a mandate import
40  
41 =head2 submit
42  
43 Submit the mandate import, after which no more entries can be added:
44  
45 $Import->submit;
46  
47 =head2 cancel
48  
49 Cancel the mandate import (if not yet submitted):
50  
51 $Import->cancel;
52  
53 =cut
54  
55 2 ▶sub submit { shift->_action( 'submit',@_ ); }
Subroutine submit: called CC=1 SCAR=0.0
Pod documented
56 2 ▶sub cancel { shift->_action( 'cancel',@_ ); }
Subroutine cancel: called CC=1 SCAR=0.0
Pod documented
57  
58 =head1 Status checks on a mandate import
59  
60 created
61 submitted
62 cancelled
63 processing
64 processed
65  
66 if ( $MandateImport->created ) {
67 ...
68 }
69  
70 =cut
71  
72 6 ▶sub created { return ( shift->status // '' ) eq 'created' }
Subroutine created: called CC=2 SCAR=6.9
Pod undocumented
Condition100%2/2
(shift())->status // ""
l!l
51
MC/DC100%1/1
(shift())->status // ""
(shift())->status
Truth table100%2/2
A
A= (shift())->status
Aresult
11
00
73 5 ▶sub submitted { return ( shift->status // '' ) eq 'submitted' }
Subroutine submitted: called CC=2 SCAR=7.6
Pod undocumented
Condition50%1/2
(shift())->status // ""
l!l
50
MC/DC0%0/1
(shift())->status // ""
(shift())->status
Truth table50%1/2
A
A= (shift())->status
Aresult
11
00
74 5 ▶sub cancelled { return ( shift->status // '' ) eq 'cancelled' }
Subroutine cancelled: called CC=2 SCAR=7.6
Pod undocumented
Condition50%1/2
(shift())->status // ""
l!l
50
MC/DC0%0/1
(shift())->status // ""
(shift())->status
Truth table50%1/2
A
A= (shift())->status
Aresult
11
00
75 5 ▶sub processing { return ( shift->status // '' ) eq 'processing' }
Subroutine processing: called CC=2 SCAR=7.6
Pod undocumented
Condition50%1/2
(shift())->status // ""
l!l
50
MC/DC0%0/1
(shift())->status // ""
(shift())->status
Truth table50%1/2
A
A= (shift())->status
Aresult
11
00
76 5 ▶sub processed { return ( shift->status // '' ) eq 'processed' }
Subroutine processed: called CC=2 SCAR=7.6
Pod undocumented
Condition50%1/2
(shift())->status // ""
l!l
50
MC/DC0%0/1
(shift())->status // ""
(shift())->status
Truth table50%1/2
A
A= (shift())->status
Aresult
11
00
77  
78 =head1 AUTHOR
79  
80 Lee Johnson - C<lee@payprop.com>
81  
82 This library is free software; you can redistribute it and/or modify it under
83 the same terms as Perl itself. If you would like to contribute documentation,
84 features, bug fixes, or anything else then please raise an issue / pull request:
85  
86 https://github.com/payprop/business-gocardless
87  
88 =cut
89  
90 5 1;
91  
92 # vim: ts=4:sw=4:et
« GoCardless/OutboundPayment.pm ↑ Summary GoCardless/MandateImportEntry.pm »