File Coverage

blib/lib/Business/Westpac/PaymentsPlus/Australian/Payment/Import/Payment/EFT.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 2 50.0
total 24 25 96.0


line stmt bran cond sub pod time code
1             package Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::EFT;
2              
3             =head1 NAME
4              
5             Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::EFT
6              
7             =head1 SYNOPSIS
8              
9             use Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::EFT;
10              
11             my $EFT = Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::EFT->new(
12             payer_payment_reference => 'REF00001',
13             payment_amount => '36.04',
14             recipient_reference => 'REF00001',
15             account_number => '000002',
16             account_name => 'Payee 02',
17             bsb_number => '062-000',
18             funding_bsb_number => '032-000',
19             funding_account_number => '000007',
20             remitter_name => 'Remitter Name',
21             );
22              
23             =head1 DESCRIPTION
24              
25             Class for modeling EFT payments in the context of Westpac CSV files.
26              
27             Extends L<Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment>.
28              
29             =cut
30              
31 2     2   340988 use feature qw/ signatures /;
  2         9  
  2         344  
32              
33 2     2   551 use Moose;
  2         530328  
  2         19  
34             extends 'Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::RealTime';
35 2     2   19225 no warnings qw/ experimental::signatures /;
  2         4  
  2         161  
36              
37 2         768 use Business::Westpac::Types qw/
38             add_max_string_attribute
39 2     2   594 /;
  2         13  
40              
41             =head1 ATTRIBUTES
42              
43             All attributes are optional, except were stated, and are read only
44              
45             =over
46              
47             =item recipient_reference (Str, max 18 chars)
48              
49             =item remitter_name (Str, optional, max 16 chars)
50              
51             =back
52              
53             =cut
54              
55             foreach my $str_attr (
56             'RecipientReference[18]',
57             ) {
58             __PACKAGE__->add_max_string_attribute(
59             $str_attr,
60             is => 'ro',
61             required => 1,
62             );
63             }
64              
65             foreach my $str_attr (
66             'RemitterName[16]',
67             ) {
68             __PACKAGE__->add_max_string_attribute(
69             $str_attr,
70             is => 'ro',
71             required => 0,
72             );
73             }
74              
75 2     2 0 8 sub record_type { 'E' }
76              
77             =head1 METHODS
78              
79             =head2 to_csv
80              
81             Convert the attributes to CSV line(s):
82              
83             my @csv = $EFT->to_csv;
84              
85             =cut
86              
87 2     2 1 6 sub to_csv ( $self ) {
  2         7  
  2         4  
88              
89 2         41 return $self->attributes_to_csv(
90             qw/
91             record_type
92             recipient_number
93             payer_payment_reference
94             payment_amount
95             recipient_reference
96             bsb_number
97             account_number
98             account_name
99             funding_bsb_number
100             funding_account_number
101             remitter_name
102             /
103             );
104             }
105              
106             =head1 SEE ALSO
107              
108             L<Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment>
109              
110             L<Business::Westpac::Types>
111              
112             =cut
113              
114             __PACKAGE__->meta->make_immutable;