NAME

Business::NAB::Acknowledgement

SYNOPSIS

my $Ack = $class->new_from_xml(
    $path_to_xml_file, # or an XML string
);

my $dom = $Ack->dom; # access to XML::LibXML::Document
my $DateTime = $Ack->date;

if ( $Ack->is_accepted ) {
    ...
}

DESCRIPTION

Class for parsing NAB file acknowledgements, which are XML files using some long-forgotten schema from Oracle from the late 1990s. There is no XSD or DTD...

The various elements are described in section 4 of the NAB "Australian Direct Entry Payments and Dishonour Report".

ATTRIBUTES

dom (XML::LibXML::Document)

The resulting object from parsing the XML, should you want to do anything more bespoke with it

date (NAB::Type::Date, required)

DateTime the acknowledgement was generated

result (Str, required)

Inferred from the document's root element, usually the type attribute, which the documentation lists as:

* info - "Standard Acknowledgement"
* warn - File not processed, requires intervention (approval)
* error - File not processed, requires review and resubmission
status (Str, required)

The acknowledgement status, inferred from the user_message element or the root element:

* accepted
* processed
* rejected
* pending
* declined
customer_id (Str, required)

NAB Direct Link Mailbox ID

company_name (Str, required)

Registered NAB Direct Link customer name

original_message_id (Str, required)
original_filename (Str, required)

Original file name

data_type (Str, optional)
data_type_description (Str, optional)
user_message (Str, optional)

Short description of the current status of the file

detailed_message (Str, optional)

Long description of the current status of the file

issue (ArrayRef[Business::NAB::Acknowledgement::Issue], optional)

An arrayref of objects that describe the payment processing

METHODS

new_from_xml

Parses the given XML file (or string) and returns a new instance of the class with the necessary attributes populates:

my $Ack = Business::NAB::Acknowledgement->new_from_xml( $xml );

is_accepted

is_processed

is_pending

is_rejected

is_declined

is_received

is_held

Boolean checks on the acknowledgement:

if ( $Ack->is_accepted ) {
    ...
}

SEE ALSO

Business::NAB::Types

Business::NAB::Acknowledgement::Issue