NAME

Business::Westpac::PaymentsPlus::Australian::Payment::Import::File

SYNOPSIS

my $ImportFile = Business::Westpac::PaymentsPlus::Australian::Payment::Import::File->new(
    customer_code => 'TESTPAYER',
    customer_name => 'TESTPAYER',
    customer_file_reference => 'TESTFILE001',
    scheduled_date => '26082016',
);

$ImportFile->add_eft_record(
    eft => \%eft_details,
    remittance => \%remittance_details,
    invoices => [
        \%invoice_details,
        \%second_invoice_details,
    ]
);

$ImportFile->add_osko_record( ... );
$ImportFile->add_cheque_record( ... );
$ImportFile->add_bpay_record( ... );
$ImportFile->add_realtime_record( ... );
$ImportFile->add_remittance_only_record( ... );
$ImportFile->add_overseas_telegraphic_transfer_record( ... );

DESCRIPTION

This class implements the format as defined by Westpac at https://paymentsplus.westpac.com.au/docs/file-formats/australian-payment-import-csv

This class follows the structure and validation rules in the spec, and delegates most of this to the subclasses (SEE ALSO below)

METHODS

to_csv

Return an array of CSV lines for output

my @csv = $self->to_csv;

The returned lines will contain the entire file structure ready for output, including the header and trailers.

add_eft_record (E)

add_osko_record (O)

add_realtime_record (RT)

add_overseas_telegraphic_transfer_record (OTT)

add_bpay_record (B)

add_cheque_record (C)

add_remittance_only_record (RO)

Add payment records to the file, optionally adding remittance and invoice records. As per the Westpac spec some record types require remittance and others have them as an option:

Type   Remittance    Invoice

E      0..1          0..n
O      0..1          0..n
RT     0..1          0..n
OTT    0..1          0..n
B      0..1          0..n
C      1             0..n
RO     1             0..n

Each method expects a hash with the attributes to populate the objects that will be instantiated, with the key names being those used for the method name add_${key_name}_record, for example:

$ImportFile->add_eft_record(

    # refer to Business::Westpac::PaymentsPlus::Australian::Payment::Import::Payment::EFT
    eft => {
        payer_payment_reference => 'REF00001',
        payment_amount => '36.04',
        recipient_reference => 'REF00001',
        account_number => '000002',
        account_name => 'Payee 02',
        bsb_number => '062-000',
        funding_bsb_number => '032-000',
        funding_account_number => '000007',
        remitter_name => 'Remitter Name',
    },

    # optional (in most cases) remittance and invoice lines
    # refer to Business::Westpac::PaymentsPlus::Australian::Payment::Import::Invoice
    # and Business::Westpac::PaymentsPlus::Australian::Payment::Import::Remittance
    remittance => { ... },
    invoices => [ { ... },{ ... }, ... ],
);

SEE ALSO

Business::Westpac::PaymentsPlus::Australian::Payment::Import...

    ::FileHeader

    ::Invoice

    ::Payment

    ::Payment::Cheque

    ::Payment::EFT

    ::Payment::Okso

    ::Payment::OTT

    ::Payment::RealTime

    ::Remittance

    ::Remittance::Only

    Business::Westpac::Types