The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

VERSION

version 0.004

SYNOPSIS

 use Finance::AMEX::Transaction;

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

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

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

 # to parse a single line

 my $record = $epraw->parse_line('line from an GRRCN  file');
 if ($record->type eq 'SUMMARY') {
   ...
 }

DESCRIPTION

You would not normally be calling this module directly, it is one of the possible return objects from a call to Finance::AMEX::Transaction's getline method.

METHODS

new

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

 my $record = Finance::AMEX::Transaction::GRRCN::Summary->new(line => $line);

type

This will always return the string SUMMARY.

 print $record->type; # SUMMARY

line

Returns the full line that is represented by this object.

 print $record->line;

RECORD_TYPE

This field contains the Record identifier, which will always be “SUMMARY” for the Summary Record.

PAYEE_MERCHANT_ID

This field contains the American Express-assigned Service Establishment (SE) Number of the Merchant receiving the payment/settlement.

SETTLEMENT_ACCOUNT_TYPE_CODE

This field contains the Settlement Account Type.

Valid values include the following:

002 = Primary
001 = Discount
004 = All Chargebacks

If unused, this field will be space filled (fixed format) or blank (delimited formats).

AMERICAN_EXPRESS_PAYMENT_NUMBER

This field contains the American Express-assigned Payment/Settlement Number. This reference number may be used by the American Express Payee for reconciliation purposes.

PAYMENT_DATE

This field contains the Payment Date scheduled in American Express systems. The date that funds are actually available to the payee's depository institution may differ from the date reported in this field.

The format is: YYYYMMDD

YYYY = Year
MM = Month
DD = Day

PAYMENT_CURRENCY

This field contains the Alphanumeric ISO Code for the Payment (Settlement) currency.

UNIQUE_PAYMENT_REFERENCE_NUMBER

This field contains a Unique Payment Reference (UPR) reserved for use by specific Merchants. If unused, this field will be character space filled (fixed format) or blank (delimited formats).

PAYMENT_NET_AMOUNT

This field contains the actual Payment or Net Amount, expressed in the Payment (Settlement) currency. This is an amount credited to the payee's account for the activities listed in the detail submission records. Will be signed negative to represent a debit amount.

Calculation for Payment Net Amount = Payment Gross Amount - Payment Discount Amount - Payment Service Fee Amount - Payment Tax Amount + Payment Adjustment Amount + Opening Debit Balance Amount.

The format for all amount fields is that they are 16 bytes in length in CNNNNNNNNNNNNNNN format.

C = an alphanumeric value which indicates whether the amount is a credit or debit value. In the case of a credit amount a character space will appear in this position. In the case of a debit amount a minus (‘-’) will be in this position.
N = Numeric value right aligned with leading zeros. Assumed two decimal places but will vary according to currency.

PAYMENT_GROSS_AMOUNT

This field contains the Payment Gross Amount which is the sum of all the submission gross amounts in this payment/settlement, expressed in the Payment (Settlement) currency.

For formats of amount values, see description in PAYMENT_NET_AMOUNT.

PAYMENT_DISCOUNT_AMOUNT

This field contains the total Discount Amount for the payment/settlement, expressed in the Payment (Settlement) currency. For a normal settlement where American Express makes a credit payment to the Merchant's account, the payment discount amount will be signed positive. If the settlement results in a debit to the Merchant's account (i.e., no payment is made) then the payment discount amount will be negative.

For formats of amount values, see description in PAYMENT_NET_AMOUNT.

For U.S. and Canada Merchants using Gross Pay, this field is for information purposes only. Aggregated Discount and Service Fees to be debited will be recorded in the Fees &Revenues Record on the date of debit from the Merchant's account.

PAYMENT_SERVICE_FEE_AMOUNT

This field contains the Service Fee Amount, expressed in the Payment (Settlement) currency.

For a normal settlement where American Express makes a credit payment to the Merchant's account, any service fee amount will be signed positive. If the settlement results in a debit from the Merchant's account (i.e., no payment is made) then the payment service fee amount will be negative.

For formats of amount values, see description in PAYMENT_NET_AMOUNT.

For U.S. and Canada Merchants using Gross Pay, this field is for information purposes only. Aggregated Discount and Service Fees to be debited will be recorded in the Fees & Revenues Record on the date of debit from the Merchant's account.

PAYMENT_ADJUSTMENT_AMOUNT

This field contains the Payment Adjustment Amount, expressed in the Payment (Settlement) currency. This reflects the net amount of all adjustment and chargeback records included in this summary. This field will be signed negative to represent a debit amount.

For formats of amount values, see description in PAYMENT_NET_AMOUNT.

PAYMENT_TAX_AMOUNT

This field contains the Payment Tax Amount, expressed in the Payment (Settlement) currency, which is only applicable to the following specific markets:

 LAC            Mexico / Bahamas / Panama / Argentina
 JAPA           Australia / India / Japan
 EMEA           Germany / Austria
 Multi-Currency Mexico / Australia

If unused, this field will be space filled (fixed format) or blank (delimited formats). For a normal settlement where American Express makes a credit payment to the Merchant's account, any tax amount will be signed positive. If the settlement results in a debit from the Merchant's account (i.e., no payment is made) then the payment tax amount will be negative.

For formats of amount values, see description in PAYMENT_NET_AMOUNT.

OPENING_DEBIT_BALANCE_AMOUNT

This field contains any current Debit Balance on the SE account for information, expressed in the Payment (Settlement) currency. If present this will always be signed as a negative amount.

For formats of amount values, see description in PAYMENT_NET_AMOUNT.

This field will be space filled (fixed format) or blank (delimited) if there is no debit balance.

PAYEE_DIRECT_DEPOSIT_NUMBER

This field contains the Payee's Direct Deposit Account Number to which the payment was transferred.

This field is only used in the U.S. and Canada and will be space filled (fixed format) or blank (delimited) if not in this market or not available.

BANK_ACCOUNT_NUMBER

This field contains the ABA Bank Number to which the payment was transferred.

This field is only used in the U.S. and Canada and will be character space filled (fixed format) or blank (delimited) if not in this market or not available.

INTERNATIONAL_BANK_ACCOUNT_NUMBER

This field is only used for markets where an International Bank Account Number (IBAN) is available. Otherwise it will be character space filled (fixed format) or blank (delimited) if not in this market or not available.

BANK_IDENTIFIER_CODE

This field contains the Bank Identifier Code (BIC) of the bank/branch, also known as a “Swift Code”.

This field is only used for markets where a BIC is available. Otherwise it will be character space filled (fixed format) or blank (delimited) if not in this market or not available.

NAME

Finance::AMEX::Transaction::GRRCN::Summary - Object methods for AMEX Reconciliation file summary records.

AUTHOR

Tom Heady <cpan@punch.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by ZipRecruiter.

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