Business-NAB

 view release on metacpan or  search on metacpan

lib/Business/NAB/Acknowledgement/Issue.pm  view on Meta::CPAN

=head2 is_ready_for_auth

=head2 is_referred

=head2 is_released

=head2 is_report

=head2 is_reserved

=head2 is_uploaded

=head2 is_validated

=head2 is_warning

Boolean checks on the issue type

=cut

# type codes map to the transaction state, which is *inferred*
# from the detail in the text the Issue contains
my %type_lookup = (
    error   => 'is_error',
    warning => 'is_warning',
    2025    => 'is_uploaded',
    5013    => 'is_corrected',
    6010    => 'is_ready_for_auth',
    6014    => 'is_authorised',
    50040   => 'is_changed',
    104503  => 'is_validated',
    104506  => 'is_invalid',
    112215  => 'is_invalid',
    130000  => 'is_checked',
    130001  => 'is_reserved',
    130003  => 'is_referred',

t/lib/Business/NAB/Acknowledgement/Issue.t  view on Meta::CPAN

    subtest 'attributes' => sub {
        is( $Issue->code,   1,     '->code' );
        is( $Issue->detail, 'foo', '->detail' );
    };
};

subtest 'type code handling' => sub {

    ok( $class->new( type => 'error' )->is_error,       '->is_error' );
    ok( $class->new( type => 'warning' )->is_warning,   '->is_warning' );
    ok( $class->new( type => 2025 )->is_uploaded,       '->is_uploaded' );
    ok( $class->new( type => 5013 )->is_corrected,      '->is_corrected' );
    ok( $class->new( type => 6010 )->is_ready_for_auth, '->is_ready_for_auth' );
    ok( $class->new( type => 6014 )->is_authorised,     '->is_authorised' );
    ok( $class->new( type => 50040 )->is_changed,       '->is_changed' );
    ok( $class->new( type => 104503 )->is_validated,    '->is_validated' );
    ok( $class->new( type => 104506 )->is_invalid,      '->is_invalid' );
    ok( $class->new( type => 112215 )->is_invalid,      '->is_invalid' );
    ok( $class->new( type => 130000 )->is_checked,      '->is_checked' );
    ok( $class->new( type => 130001 )->is_reserved,     '->is_reserved' );
    ok( $class->new( type => 130003 )->is_referred,     '->is_referred' );

t/lib/Business/NAB/example_files/received_payments.ack  view on Meta::CPAN

<PaymentId>11250283</PaymentId>
<OriginalMessageId>11250282</OriginalMessageId>
<DateTime>2021/09/30</DateTime>
<CustomerId>STAGE02</CustomerId>
<CompanyName>STAGE02 SFTP test instance</CompanyName>
<UserMessage>Payment status is PROCESSED</UserMessage>
<DetailedMessage>Payment has been successfully processed.</DetailedMessage>
<OriginalFilename>SAMP01AU_DTDC_0000001.aba</OriginalFilename>
<Issues>
<Issue type="290049">Uploaded Interchange 60063804 for Customer 382097 and Payment Type DL_DIRECTCREDIT.</Issue>
<Issue type="2025">Payment 70066391 successfully uploaded from a file.</Issue>
<Issue type="2025">Payment 70066391 successfully uploaded from a file.</Issue>
<Issue type="104503">Payment successfully validated.</Issue>
<Issue type="181002">Payment has passed Account Validation.</Issue>
<Issue type="6010">Payment is ready for authorisation - 1 authorisations required.</Issue>
<Issue type="6014">Payment has been fully authorised.</Issue>
<Issue type="181253">AVCDEF GHIJKLM [1111111111] has authorised the payment.</Issue>
<Issue type="130000">Available funds check passed.</Issue>
<Issue type="130001">Funds have been reserved.</Issue>
<Issue type="181301">Payment is ready to be submitted for processing.</Issue>
<Issue type="194500">Disbursement Report for Direct Link - Direct Credit Payment: 70066391 sent to mailbox STAGE02</Issue>
</Issues>



( run in 1.171 second using v1.01-cache-2.11-cpan-b16cb0d3907 )