NAME

Finance::AMEX::Transaction::GRRCN - Parse AMEX Global Reconciliation (GRRCN)

VERSION

version 0.005

SYNOPSIS

use Finance::AMEX::Transaction;

my $grrcn = Finance::AMEX::Transaction->new(file_type => 'GRRCN');
open my $fh, '<', '/path to GRRCN file' or die "cannot open GRRCN file: $!";

while (my $record = $grrcn->getline($fh)) {

  if ($record->type eq 'TRAILER') {
    print $record->FILE_CREATION_DATE . "\n";
  }
}

DESCRIPTION

This module parses AMEX Global Reconciliation (GRRCN) files and returns an object which is appropriate for the line that it was asked to parse.

You would not normally be calling this module directly, it is merely a router to the correct object type that is returned to Finance::AMEX::Transaction's getline method.

Object returned are one of:

Finance::AMEX::Transaction::GRRCN::Header

Header Rows

print $record->type; # HEADER
Finance::AMEX::Transaction::GRRCN::Summary

Summary Rows

print $record->type; # SUMMARY
Finance::AMEX::Transaction::GRRCN::TaxRecord

TaxRecord Rows

print $record->type; # TAXRECORD
Finance::AMEX::Transaction::GRRCN::Submission

Submission or summary of charge (SOC) Rows

print $record->type; # SUBMISSION
Finance::AMEX::Transaction::GRRCN::Transaction

Transaction or summary of charge (SOC) Rows

print $record->type; # TRANSACTION
Finance::AMEX::Transaction::GRRCN::TxnPricing

transaction or ROC pricing Rows

print $record->type; # TXNPRICING
Finance::AMEX::Transaction::GRRCN::Chargeback

Chargeback Rows

print $record->type; # CHARGEBACK
Finance::AMEX::Transaction::GRRCN::Adjustment

Adjustment Rows

print $record->type; # ADJUSTMENT
Finance::AMEX::Transaction::GRRCN::FeeRevenue

Fees and Revenues Record

print $record->type; # FEEREVENUE
Finance::AMEX::Transaction::GRRCN::Trailer

Trailer Rows

print $record->type; # TRAILER
Finance::AMEX::Transaction::GRRCN::Unknown

Unknown lines.

print $record->type; # UNKNOWN

METHODS

new

Returns a Finance::AMEX::Transaction::GRRCN object.

my $grrcn = Finance::AMEX::Transaction::GRRCN->new;

parse_line

Returns one of the Finance::AMEX::Transaction::GRRCN::Header, Finance::AMEX::Transaction::GRRCN::Summary, Finance::AMEX::Transaction::GRRCN::TaxRecord, Finance::AMEX::Transaction::GRRCN::Submission, Finance::AMEX::Transaction::GRRCN::Transaction, Finance::AMEX::Transaction::GRRCN::TxnPricing, Finance::AMEX::Transaction::GRRCN::Chargeback, Finance::AMEX::Transaction::GRRCN::Adjustment, Finance::AMEX::Transaction::GRRCN::FeeRevenue, Finance::AMEX::Transaction::GRRCN::Trailer, or Finance::AMEX::Transaction::GRRCN::Unknown records depending on the contents of the line.

my $record = $grrcn->parse_line('line from a grrcn file');

detect_file_format

Returns one of CSV, TSV, or FIXED depending on how the line is formatted. You wouldn't normally need to call this.

my $file_format = $grrcn->detect_file_format('line from a grrcn file');

detect_line_type

Returns one of the line types for the GRRCN format. You wouldn't normally need to call this.

my $line_type = $grrcn->detect_line_type('line from a grrcn file');

file_format

Returns the previously detected file format.

my $file_format = $grrcn->file_format;

file_version

Returns the detected file version that is parsed from the header.

my $file_format = $grrcn->file_version;

NAME

Finance::AMEX::Transaction::GRRCN - Parse AMEX Chargeback Notification Files (GRRCN)

AUTHOR

Tom Heady <cpan@punch.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2022 by ZipRecruiter/Tom Heady.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.