NAME

Business::NAB::BPAY::Remittance::File

SYNOPSIS

use Business::NAB::BPAY::Remittance::File;

my $File = Business::NAB::BPAY::Remittance::File->new_from_file(
    "/path/to/bpay/payments/batch/file-brf.txt",
);

# parse
my $Header = $File->header_record->[0];

foreach my $File ( $File->detail_record->@* ) {
    ...
}

my $Trailer = $File->trailer_record->[0];

# create
$File->to_file(
    "/path/to/bpay/remittance/file_output.brf",
    $separator, # defaults to "\r\n"
);

DESCRIPTION

Class for parsing / creating a NAB BPAY remittance/reporting file

ATTRIBUTES

All attributes are ArrayRef[Obj] where Obj are of the Business::NAB::BPAY* namespace:

HeaderRecord
DetailRecord
TrailerRecord

Convenience methods are available for trivial addition of new elements to the arrays:

$File->add_header_record( $HeaderRecord );
$File->add_detail_record( $DetailRecord );
$File->add_trailer_record( $TrailerRecord );
header_record (ArrayRef[Obj])
detail_record (ArrayRef[Obj])
trailer_record (ArrayRef[Obj])

METHODS

new_from_file

Returns a new instance of the class with attributes populated from the result of parsing the passed file

my $File = Business::NAB::BPAY::Remittance::File
    ->new_from_file( $file_path );

to_file

Writes the file content to the passed file path:

$File->to_file(
    $file_path,
    $separator, # defaults to "\r\n"
);

SEE ALSO

Business::NAB::Types

Business::NAB::BPAY::Remittance::File::HeaderRecord

Business::NAB::BPAY::Remittance::File::DetailRecord

Business::NAB::BPAY::Remittance::File::TrailerRecord