File Coverage

blib/lib/Business/Westpac/PaymentsPlus/Australian/Payment/Import/Payment/Osko.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::Osko;
2              
3             =head1 NAME
4              
5             Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::Osko
6              
7             =head1 SYNOPSIS
8              
9             use Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::Osko;
10             my $Osko = Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::Osko->new(
11             debtor_information => 'Debtor Information 01',
12             payment_amount => '100.00',
13             end_to_end_id => 'EndToEndID01',
14             account_identifier => '062000000002',
15             account_scheme_name => 'BBAN',
16             payee_account_name => 'Payee 02',
17             funding_bsb_number => '032-000',
18             funding_account_number => '000007',
19             remittance_information_1 => 'Remittance Information 1',
20             remittance_information_2 => 'Remittance Information 2',
21             );
22              
23             my @csv = $Header->to_csv;
24              
25             =head1 DESCRIPTION
26              
27             Class for modeling Osko payments in the context of Westpac CSV files.
28              
29             Extends L<Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment>.
30              
31             =cut
32              
33 2     2   355442 use feature qw/ signatures /;
  2         5  
  2         308  
34              
35 2     2   663 use Moose;
  2         646640  
  2         14  
36             extends 'Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment';
37 2     2   15824 no warnings qw/ experimental::signatures /;
  2         6  
  2         120  
38              
39 2         580 use Business::Westpac::Types qw/
40             add_max_string_attribute
41 2     2   890 /;
  2         10  
42              
43 2     2 0 9 sub record_type { 'O' }
44              
45             =head1 ATTRIBUTES
46              
47             All attributes are optional, except were stated, and are read only
48              
49             =over
50              
51             =item debtor_information (Str, max 35 chars)
52              
53             =item end_to_end_id (Str, max 35 chars)
54              
55             =item remittance_information_1 (Str, max 140 chars)
56              
57             =item remittance_information_2 (Str, max 140 chars)
58              
59             =item account_identifier (Str, max 19 chars, required)
60              
61             =item account_scheme_name (Str, max 19 chars, required)
62              
63             =item payee_account_name (Str, max 140 chars, required)
64              
65             =back
66              
67             =cut
68              
69             foreach my $str_attr (
70             'DebtorInformation[35]',
71             'end_to_end_id[35]',
72             'RemittanceInformation_1[140]',
73             'RemittanceInformation_2[140]',
74             ) {
75             __PACKAGE__->add_max_string_attribute(
76             $str_attr,
77             is => 'ro',
78             required => 0,
79             );
80             }
81              
82             foreach my $str_attr (
83             'AccountIdentifier[19]',
84             'AccountSchemeName[19]',
85             'PayeeAccountName[140]',
86             ) {
87             __PACKAGE__->add_max_string_attribute(
88             $str_attr,
89             is => 'ro',
90             required => 1,
91             );
92             }
93              
94             =head1 METHODS
95              
96             =head2 to_csv
97              
98             Convert the attributes to CSV line(s):
99              
100             my @csv = $Osko->to_csv;
101              
102             =cut
103              
104 2     2 1 6 sub to_csv ( $self ) {
  2         5  
  2         5  
105              
106 2         41 return $self->attributes_to_csv(
107             qw/
108             record_type
109             recipient_number
110             debtor_information
111             payment_amount
112             end_to_end_id
113             account_identifier
114             account_scheme_name
115             payee_account_name
116             funding_bsb_number
117             funding_account_number
118             remittance_information_1
119             remittance_information_2
120             /
121             );
122             }
123              
124             =head1 SEE ALSO
125              
126             L<Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment>
127              
128             L<Business::Westpac::Types>
129              
130             =cut
131              
132             __PACKAGE__->meta->make_immutable;