The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Finance::AMEX::Transaction::GRRCN::TxnPricing - Parse AMEX Global Reconciliation (GRRCN) Transaction or ROC pricing Rows

VERSION

version 0.005

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 'TXNPRICING') {
    print $record->PAYMENT_DATE . "\n";
  }
 }

 # to parse a single line

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

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::TxnPricing object.

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

type

This will always return the string TXNPRICING.

 print $record->type; # TXNPRICING

line

Returns the full line that is represented by this object.

 print $record->line;

field_map

Returns an arrayref of hashrefs where the name is the record name and the value is an arrayref of the start position and length of that field.

 # print the start position of the PAYMENT_DATE field
 print $record->field_map->[4]->{PAYMENT_DATE}->[0]; # 39

RECORD_TYPE

This field contains the Record identifier, which will always be “TXNPRICING” for the Transaction Pricing 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.

SUBMISSION_MERCHANT_ID

This field contains the Service Establishment (SE) Number of the Merchant being reconciled.

MERCHANT_LOCATION_ID

This field contains the Merchant-assigned SE Unit Number (usually an internal, store identifier code) that corresponds to a specific store or location.

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

INVOICE_REFERENCE_NUMBER

This field contains the Invoice/Reference Number assigned by the Merchant or Partner to this transaction at the time the sale was executed.

This is a transaction-level identifier used by the Merchant for identification and reconciliation purposes.

SELLER_ID

This field contains the Seller ID, 20-byte code that uniquely identifies a Payment Aggregator or OptBlue Participant's specific seller or vendor.

When no value is assigned this field will be character space filled (fixed format) or blank (delimited formats).

CARDMEMBER_ACCOUNT_NUMBER

This field contains the Cardmember Account Number that corresponds to this transaction.

Note: if Card number masking is enabled this field is required to accept alphanumeric characters).

JCB card transactions may appear in the reconciliation file. JCB transactions can be distinguished using the Issuer Identification Number (IIN), previously known as bank identification number (BIN), as represented by the first six digits of the credit card number. JCB card numbers begin with ‘35’ and will be 16 digits in length, whereas American Express card numbers begin with ‘37’ and will be 15 digits in length.

TRANSACTION_AMOUNT

This field contains the Transaction or Record of Charge (ROC) Amount for a single transaction.

This value is expressed in the Submission currency.

For formats of amount values, see description in Summary Record, PAYMENT_NET_AMOUNT.

TRANSACTION_DATE

This field contains the Transaction Date, which is the date the transaction took place as specified by Merchant in the submission file.

The format is: YYYYMMDD

YYYY = Year
MM = Month
DD = Day

FEE_CODE

This field contains a Fee Code that corresponds to the preceding ROC Detail Record. Refer to the Appendix for a list of Fee Codes and their associated descriptions.

Please refrain from hard coding the Fee Codes into your application as American Express reserves the right to make changes. Hard-Coding to this field may result in file failures.

This field is applicable to the U.S. and Canada only.

FEE_AMOUNT

This field contains the Fee Amount charged by American Express for this transaction to six decimal places.

This value is expressed in the Submission currency.

For a typical debit ROC/transaction, the fee amount is signed positive.

The format of this field is:

Position 1 (1) is a signed field and will be either a space for a credit amount or a '-' sign for a debit amount.

Positions 2-16 (15) are whole numbers.

Positions 17-22 (6) are decimal places.

For example: ‘000000000000056789000’ represents a positive amount of 56.789. ‘-000000000000056789000’ represents a negative amount of 56.789.

DISCOUNT_RATE

This field contains the Discount Rate (decimal place value) used to calculate the amount American Express charges for services and corresponds to the preceding Transaction or ROC Detail Record. It acts as a proportion of the transaction amount.

Though a signed field, discount rate is always expressed as a positive value.

It is also possible in certain countries which have local goods and services tax, such as Australia and Mexico, that this field will contain the tax rate as a proportion of the discount amount.

For an explanation of rate syntax, see Submission Record, SUBMISSION_DISCOUNT_RATE.

DISCOUNT_AMOUNT

This field contains the Discount Amount charged by American Express for this transaction to six decimal places.

It is also possible that in some markets with local goods and services taxes, such as Australia and Mexico, that this field will contain a tax amount applicable to the transaction.

This value is expressed in the Submission currency.

For a typical debit transaction/ROC, the discount amount is signed positive.

The format of this field is:

Position 1 (1) is a signed field and will be either a space for a credit amount or a '-' sign for a debit amount.

Positions 2-16 (15) are whole numbers.

Positions 17-22 (6) are decimal places.

For example: ‘000000000000056789000’ represents a positive amount of 56.789, while ‘-000000000000056789000’ represents a negative amount of 56.789.

ROUNDED_FEE_AMOUNT

This field will only be available in v3.01 of the GRRCN format. If you call this method on previous versions it will return undef.

This field contains the Fee Amount charged by American Express for this transaction to two (2) decimal places. If the applied fee is a Fixed Fee, then the Fixed Fee Amount will be displayed in this field. This value is expressed in the Submission currency. For a typical debit ROC/transaction, the fee amount is signed positive.

This field is only applicable in the U.S. and Canada. Where not relevant this field will be zero (0) filled.

ROUNDED_DISCOUNT_AMOUNT

This field will only be available in v3.01 of the GRRCN format. If you call this method on previous versions it will return undef.

This field contains the Discount Amount charged by American Express for this transaction to two (2) decimal places.

If the applied fee is calculated as a percentage (%) of the transaction amount then the calculated fee amount will be displayed in this field (e.g., Rate = 2%, Transaction Amount = $100.00, Calculated Fee Amount = $2.00) - $2.00 will be populated in this field.

Note: It is also possible that in certain markets which have local goods and services taxes (e.g., India, Australia, Mexico) that this field will contain a Tax Amount applicable to the transaction. This value is expressed in the Submission currency. For a typical debit transaction/ROC, the discount amount is signed positive.

This field is only applicable in the U.S. and Canada. Where not relevant this field will be zero (0) filled.

FEE_AMOUNT_SETTLEMENT_CURRENCY

This field will only be available in v3.01 of the GRRCN format. If you call this method on previous versions it will return undef.

This field contains the Fee Amount charged by American Express for this transaction to six (6) decimal places.

If the applied fee is a Fixed Fee, then the Fixed Fee Amount will be displayed in this field.

If this field is populated then Field 18, Discount Rate, Field 19 Discount Amount and Field 23, Discount Amount (Settlement Currency) will not be populated.

This value is expressed in the Settlement currency.

For a typical debit ROC/transaction, the fee amount is signed positive.

The format of this field is: Position 1 (1) is a signed field and will be either a space for a credit amount or a ‘-’ sign for a debit amount.

Positions 2-16 (15) are whole numbers.

Positions 17-22 (6) are decimal places.

For example: ' 000000000000056789000' represents a positive amount of 56.789, while '-000000000000056789000' represents a negative amount of 56.789.

DISCOUNT_AMOUNT_SETTLEMENT_CURRENCY

This field will only be available in v3.01 of the GRRCN format. If you call this method on previous versions it will return undef.

This field contains the Discount Amount charged by American Express for this transaction to six (6) decimal places.

Note: It is also possible that in certain markets which have local goods and services taxes (e.g., India, Australia, Mexico) that this field will contain a Tax Amount applicable to the transaction. This value is expressed in the Settlement currency. If the applied fee is calculated as a percentage (%) of the transaction amount then the calculated fee amount will be displayed in this field (e.g., Rate = 2%, Transaction Amount = $100.00, Calculated Fee Amount = $2.00) - $2.00 will be populated in this field. If this field is populated then Field 17, Fee Amount and Field 22, Fee Amount (Settlement Currency) will not be populated.

For a typical debit transaction/ROC, the discount amount is signed positive. The format of this field is: Position 1 (1) is a signed field and will be either a space for a credit amount or a ‘-’ sign for a debit amount. Positions 2-16 (15) are whole numbers. Positions 17-22 (6) are decimal places.

For example:’ 000000000000056789000’ represents a positive amount of 56.789, while ‘-0000000000000567 represents a negative amount of 56.789.

TRANSACTION_AMOUNT_SETTLEMENT_CURRENCY

This field will only be available in v3.01 of the GRRCN format. If you call this method on previous versions it will return undef.

This field contains the Transaction or Record of Charge (ROC) Amount for a single transaction.

This value is expressed in the Settlement currency.

NAME

Finance::AMEX::Transaction::GRRCN::TxnPricing - Object methods for AMEX Global Reconciliation (GRRCN) transaction or ROC pricing records.

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.