File Coverage

blib/lib/Business/Westpac/PaymentsPlus/Australian/Payment/Import/Payment/BPAY.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::BPAY;
2              
3             =head1 NAME
4              
5             Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::BPAY
6              
7             =head1 SYNOPSIS
8              
9             use Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::BPAY;
10              
11             my $Bpay = Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::BPAY->new(
12             payer_payment_reference => 'REF00003',
13             payment_amount => '191.57',
14             recipient_reference => '1234500012',
15             bsb_number => '062-000',
16             bpay_biller_number => '401234',
17             funding_bsb_number => '032-000',
18             funding_account_number => '000007',
19             );
20              
21             =head1 DESCRIPTION
22              
23             Class for modeling BPAY payments in the context of Westpac CSV files.
24              
25             Extends L<Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment>.
26              
27             =cut
28              
29 2     2   467850 use feature qw/ signatures /;
  2         6  
  2         371  
30              
31 2     2   696 use Moose;
  2         577623  
  2         18  
32             extends 'Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment';
33 2     2   20010 no warnings qw/ experimental::signatures /;
  2         5  
  2         128  
34              
35 2         657 use Business::Westpac::Types qw/
36             add_max_string_attribute
37 2     2   808 /;
  2         10  
38              
39 3     3 0 10 sub record_type { 'B' }
40              
41             =head1 ATTRIBUTES
42              
43             All attributes are required, except were stated, and are read only
44              
45             =over
46              
47             =item bpay_biller_number (Str, max 10 chars)
48              
49             =item recipient_reference (Str, max 20 chars)
50              
51             =back
52              
53             =cut
54              
55             foreach my $str_attr (
56             'BpayBillerNumber[10]',
57             'RecipientReference[20]',
58             ) {
59             __PACKAGE__->add_max_string_attribute(
60             $str_attr,
61             is => 'ro',
62             required => 1,
63             );
64             }
65              
66             =head2 to_csv
67              
68             Convert the attributes to CSV line(s):
69              
70             my @csv = $Bpay->to_csv;
71              
72             =cut
73              
74 3     3 1 23 sub to_csv ( $self ) {
  3         7  
  3         7  
75              
76 3         26 return $self->attributes_to_csv(
77             qw/
78             record_type
79             recipient_number
80             payer_payment_reference
81             payment_amount
82             bpay_biller_number
83             recipient_reference
84             funding_bsb_number
85             funding_account_number
86             /
87             );
88             }
89              
90             =head1 SEE ALSO
91              
92             L<Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment>
93              
94             L<Business::Westpac::Types>
95              
96             =cut
97              
98             __PACKAGE__->meta->make_immutable;