financial.iso8583
ballerinax/financial.iso8583 Ballerina library
ISO 8583 Parser Module
Sample Usage
01. Parse to ISO 8583 base resource model
In this approach user just need to provide only the ISO 8583 message payload. Based on the MTI(Message Type Identifier), parser will parse it to it's MTI model.
import ballerina/log; import ballerinax/financial.iso8583.parser; public function main() { string isoMessage = "0200B2384081080080100000000000000100201345000000500000011152218212348945566612348888120610000912a456789123012006abc123021ABCDEFGHIJ 1234567890"; anydata|ISOError parsedISO8583Msg = parser:parse(isoMessage); if parsedISO8583Msg is anydata { map<anydata> parsedISO8583Map = <map<anydata>>parsedISO8583Msg; if parsedISO8583Map["MTI"] == "0200" { MTI_0200|error cloneWithType = parsedISO8583Msg.cloneWithType(MTI_0200); if cloneWithType is MTI_0200 { // validate 8583 MTI message MTI_0200|error validatedMsg = constraint:validate(cloneWithType); if validatedMsg is error { log:printError("Error while validating: " + validatedMsg.message()); } else { log:printInfo("Validated ISO 8583 record : " + validatedMsg.toBalString()); } } else { log:printError("Error while cloning: " + cloneWithType.message()); } } } else { log:printError("Error while 8583 message parsing" + parsedISO8583Msg.toBalString()); } }
Note: parse
function returns anydata
type when success, and it needs to be cast to the relevant ISO 8583 MTI Resource type.
Functions
createISOError
Create ISO Error.
Return Type
- ISOError - return isoError
encode
Generate iso 8583 string from json record.
Parameters
- isoRecord json - parameter description
initialize
Initialize the iso 8583 parser with the configuration file.
Parameters
- packagerFilePath string - iso 8583 jpos packager xml file path
- elementNameFilePath string - iso 8583 data element name csv file path
Return Type
- error? - error if initialization fails
parse
Parse iso 8583 message and transform to a iso 8583 reecord.
Parameters
- isoMessage string - iso 8583 message
Return Type
- anydata|ISOError - iso 8583 record as anydata
Records
financial.iso8583: ISOError
ISO Error model.
Fields
- message string - error message
- errorCode string?(default ()) - error code
financial.iso8583: MTI_022X
MTI 22X - Financial Presentment Advice.
The MTI_22X
record represents a financial presentment advice in the ISO 8583 standard.
This can be used to represent message types 220 and 221
Fields
- MTI string(default "220") - The message type indicator (MTI) of the transaction.
- PrimaryAccountNumber? string - The primary account number (PAN) of the cardholder.
- ProcessingCode string - A code indicating the type of transaction being performed.
- AmountTransaction string - The amount of the transaction.
- DateAndTimeTransmission? string - The date and time when the transaction was initiated.
- ConversionRateCardholderBilling? string - The conversion rate for cardholder billing.
- SystemsTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- DateAndTimeLocalTransaction string - The local date and time at the point of transaction.
- DateEffective? string - The effective date of the transaction.
- DateExpiration? string - The expiration date of the transaction.
- DateCapture? string - The date when the transaction was captured.
- TransactionLifeCycleIdentificationData? string - The transaction life cycle identification data.
- POSDataCode string - The point of service (POS) data code.
- CardSequenceNumber? string - The sequence number of the card.
- FunctionCode string - The function code of the transaction.
- MessageReasonCode string - The reason code of the message.
- MerchantCategoryCode? string - The category code of the merchant.
- AmountsOriginal? string - The original amount of the transaction.
- AcquiringInstitutionIdentificationCode? string - The identification code of the acquiring institution.
- ForwardingInstitutionIdentificationCode? string - The identification code of the forwarding institution.
- Track2Data? string - The track 2 data of the card.
- Track3Data? string - The track 3 data of the card.
- ApprovalCode? string - The approval code of the transaction.
- ActionCode string - The action code of the transaction.
- ServiceCode? string - The service code of the transaction.
- CardAcceptorTerminalIdentification? string - The identification code of the terminal where the card was accepted.
- CardAcceptorIdentificationCode? string - The identification code of the card accepter.
- CardAcceptorNameLocation string - The name and location of the card accepter.
- Track1Data? string - The track 1 data of the card.
- AmountsFees? string - The amount of the transaction fees.
- AuthorizingAgentInstitutionIdentificationCode? string - The identification code of the authorizing agent.
- ReceivingInstitutionIdentificationCode? string - The identification code of the receiving institution.
financial.iso8583: MTI_0240
MTI 240 - Financial Presentment Notification Request.
The MTI_240
record represents a financial presentment notification in the ISO 8583 standard.
Fields
- MTI string(default "240") - The message type indicator (MTI) of the transaction.
- PrimaryAccountNumber? string - The primary account number (PAN) of the cardholder.
- ProcessingCode string - A code indicating the type of transaction being performed.
- AmountTransaction string - The amount of the transaction.
- AmountReconciliation? string - The amount of the reconciliation.
- DateAndTimeTransmission? string - The date and time when the transaction was initiated.
- ConversionRateReconciliation? string - The conversion rate for reconciliation.
- ConversionRateCardholderBilling? string - The conversion rate for cardholder billing.
- SystemsTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- DateAndTimeLocalTransaction string - The local date and time at the point of transaction.
- DateEffective? string - The effective date of the transaction.
- DateExpiration? string - The expiration date of the transaction.
- DateConversion? string - The date of the conversion.
- DateCapture? string - The date when the transaction was captured.
- TransactionLifeCycleIdentificationData? string - The transaction life cycle identification data.
- POSDataCode? string - The point of service (POS) data code.
- CardSequenceNumber? string - The sequence number of the card.
- FunctionCode string - The function code of the transaction.
- MessageReasonCode string - The reason code of the message.
- MerchantCategoryCode? string - The category code of the merchant.
- DateReconciliation? string - The date of the reconciliation.
- ReconciliationIndicator? string - The reconciliation indicator of the transaction.
- AmountsOriginal? string - The original amount of the transaction.
- AcquiringInstitutionIdentificationCode string - The identification code of the acquiring institution.
- ForwardingInstitutionIdentificationCode? string - The identification code of the forwarding institution.
- Track2Data? string - The track 2 data of the card.
- Track3Data? string - The track 3 data of the card.
- ApprovalCode? string - The approval code of the transaction.
- ActionCode string - The action code of the transaction.
- ServiceCode? string - The service code of the transaction.
- CardAcceptorTerminalIdentification? string - The identification code of the terminal where the card was accepted.
- CardAcceptorIdentificationCode? string - The identification code of the card accepter.
- CardAcceptorNameLocation? string - The name and location of the card accepter.
- Track1Data? string - The track 1 data of the card.
- AmountsFees? string - The amount of the transaction fees.
- AuthorizingAgentInstitutionIdentificationCode? string - The identification code of the authorizing agent.
- FileTransferMessageControl? string - The file transfer message control.
- ReceivingInstitutionIdentificationCode? string - The identification code of the receiving institution.
financial.iso8583: MTI_0250
MTI 250 - Financial Presentment Notification Acknowledgement Request.
The MTI_250
record represents a financial presentment notification acknowledgement in the ISO 8583 standard.
Fields
- MTI string(default "250") - The message type indicator (MTI) of the transaction.
- SystemsTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- TransactionLifeCycleIdentificationData? string - The transaction life cycle identification data.
- FileTransferMessageControl? string - The file transfer message control.
financial.iso8583: MTI_0450
MTI 450 - Reversal Notification Acknowledgement Request.
The MTI_450
record represents a reversal notification acknowledgement in the ISO 8583 standard.
Fields
- MTI string(default "450") - The message type indicator (MTI) of the transaction.
- SystemsTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- TransactionLifeCycleIdentificationData? string - The transaction life cycle identification data.
- FileTransferMessageControl? string - The file transfer message control.
financial.iso8583: MTI_0800
MTI 0800 - Network Management Request
The MTI_0800
record represents a network management request in the ISO 8583 standard.
Fields
- MTI string(default "0800") - The message type indicator (MTI) of the transaction.
- TransmissionDateTime string - The date and time when the transaction was initiated.
- SystemTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- SettlementDate? string - The date when the transaction is settled.
- AcquiringInstitutionIdentificationCode? string - The identification code of the acquiring institution.
- AdditionalDataPrivate? string - Additional data (private).
- NetworkManagementInformationCode string - The network management information code.
- NetworkManagementInformationChannelType? string - The network management information channel type.
financial.iso8583: MTI_0810
MTI 0810 - Network Management Response
The MTI_0810
record represents a network management response in the ISO 8583 standard.
Fields
- MTI string(default "0810") - The message type indicator (MTI) of the transaction.
- TransmissionDateTime string - The date and time when the transaction was initiated.
- SystemTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- SettlementDate? string - The date when the transaction is settled.
- AcquiringInstitutionIdentificationCode? string - The identification code of the acquiring institution.
- AdditionalDataPrivate? string - Additional data (private).
- NetworkManagementInformationCode string - The network management information code.
- NetworkManagementInformationChannelType? string - The network management information channel type.
- ResponseCode string - A code indicating the result of the authorization request.
financial.iso8583: MTI_20X
MTI 20X - Financial Request.
The MTI_20X
record represents a financial presentment request in the ISO 8583 standard.
This can be used to represent message types 200 and 201
Fields
- MTI string(default "200") - The message type indicator (MTI) of the transaction.
- PrimaryAccountNumber? string - The primary account number (PAN) of the cardholder.
- ProcessingCode string - A code indicating the type of transaction being performed.
- AmountTransaction string - The amount of the transaction.
- DateAndTimeTransmission? string - The date and time when the transaction was initiated.
- ConversionRateCardholderBilling? string - The conversion rate for cardholder billing.
- SystemsTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- DateAndTimeLocalTransaction string - The local date and time at the point of transaction.
- DateEffective? string - The effective date of the transaction.
- DateExpiration? string - The expiration date of the transaction.
- TransactionLifeCycleIdentificationData? string - The transaction life cycle identification data.
- POSDataCode string - The point of service (POS) data code.
- CardSequenceNumber? string - The sequence number of the card.
- FunctionCode string - The function code of the transaction.
- MerchantCategoryCode string - The category code of the merchant.
- POSCapability? string - The point of service (POS) capability.
- AmountsOriginal? string - The original amount of the transaction.
- AcquiringInstitutionIdentificationCode string - The identification code of the acquiring institution.
- ForwardingInstitutionIdentificationCode? string - The identification code of the forwarding institution.
- Track2Data? string - The track 2 data of the card.
- Track3Data? string - The track 3 data of the card.
- ServiceCode? string - The service code of the transaction.
- CardAcceptorTerminalIdentification? string - The identification code of the terminal where the card was accepted.
- CardAcceptorIdentificationCode? string - The identification code of the card accepter.
- CardAcceptorNameLocation string - The name and location of the card accepter.
- Track1Data? string - The track 1 data of the card.
- AmountsFees? string - The amount of the transaction fees.
- ReceivingInstitutionIdentificationCode? string - The identification code of the receiving institution.
financial.iso8583: MTI_210
MTI 210 - Financial Request.
The MTI_210
record represents a financial presentment request response in the ISO 8583 standard.
Fields
- MTI string(default "210") - The message type indicator (MTI) of the transaction.
- PrimaryAccountNumber? string - The primary account number (PAN) of the cardholder.
- ProcessingCode? string - A code indicating the type of transaction being performed.
- AmountTransaction string - The amount of the transaction.
- AmountReconciliation? string - The amount of the reconciliation.
- DateAndTimeTransmission? string - The date and time when the transaction was initiated.
- ConversionRateReconciliation? string - The conversion rate for reconciliation.
- ConversionRateCardholderBilling? string - The conversion rate for cardholder billing.
- SystemsTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- DateAndTimeLocalTransaction string - The local date and time at the point of transaction.
- DateConversion? string - The date of the conversion.
- MessageErrorIndicator? string - The message error indicator of the transaction.
- TransactionLifeCycleIdentificationData? string - The transaction life cycle identification data.
- DateReconciliation? string - The date of the reconciliation.
- ReconciliationIndicator? string - The reconciliation indicator of the transaction.
- AmountsOriginal? string - The original amount of the transaction.
- AcquiringInstitutionIdentificationCode string - The identification code of the acquiring institution.
- ForwardingInstitutionIdentificationCode? string - The identification code of the forwarding institution.
- ApprovalCode? string - The approval code of the transaction.
- ActionCode string - The action code of the transaction.
- CardAcceptorTerminalIdentification? string - The identification code of the terminal where the card was accepted.
- CardAcceptorIdentificationCode? string - The identification code of the card accepter.
- AmountsFees? string - The amount of the transaction fees.
- AuthorizingAgentInstitutionIdentificationCode? string - The identification code of the authorizing agent.
- TransportData? string - The transport data of the transaction.
- ReceivingInstitutionIdentificationCode? string - The identification code of the receiving institution.
financial.iso8583: MTI_230
MTI 230 - Financial Presentment Advice Response.
The MTI_230
record represents a financial presentment advice response in the ISO 8583 standard.
Fields
- MTI string(default "230") - The message type indicator (MTI) of the transaction.
- PrimaryAccountNumber? string - The primary account number (PAN) of the cardholder.
- ProcessingCode string - A code indicating the type of transaction being performed.
- AmountTransaction string - The amount of the transaction.
- AmountReconciliation? string - The amount of the reconciliation.
- DateAndTimeTransmission? string - The date and time when the transaction was initiated.
- ConversionRateReconciliation? string - The conversion rate for reconciliation.
- ConversionRateCardholderBilling? string - The conversion rate for cardholder billing.
- SystemsTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- DateAndTimeLocalTransaction string - The local date and time at the point of transaction.
- DateConversion? string - The date of the conversion.
- MessageErrorIndicator? string - The message error indicator of the transaction.
- TransactionLifeCycleIdentificationData? string - The transaction life cycle identification data.
- DateReconciliation? string - The date of the reconciliation.
- ReconciliationIndicator? string - The reconciliation indicator of the transaction.
- AcquiringInstitutionIdentificationCode? string - The identification code of the acquiring institution.
- ForwardingInstitutionIdentificationCode? string - The identification code of the forwarding institution.
- RetrievalReferenceNumber? string -
- ApprovalCode? string - The approval code of the transaction.
- ActionCode string - The action code of the transaction.
- CardAcceptorTerminalIdentification? string - The identification code of the terminal where the card was accepted.
- CardAcceptorIdentificationCode? string - The identification code of the card accepter.
- AmountsFees? string - The amount of the transaction fees.
- TransportData? string - The transport data of the transaction.
- ReceivingInstitutionIdentificationCode? string - The identification code of the receiving institution.
financial.iso8583: MTI_42X
MTI 42X - Reversal Advice.
The MTI_42X
record represents a reversal advice in the ISO 8583 standard.
This can be used to represent message types 420 and 421
Fields
- MTI string(default "420") - The message type indicator (MTI) of the transaction.
- PrimaryAccountNumber? string - The primary account number (PAN) of the cardholder.
- ProcessingCode? string - A code indicating the type of transaction being performed.
- AmountTransaction string - The amount of the transaction.
- DateAndTimeTransmission? string - The date and time when the transaction was initiated.
- ConversionRateCardholderBilling? string - The conversion rate for cardholder billing.
- SystemsTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- DateAndTimeLocalTransaction string - The local date and time at the point of transaction.
- TransactionLifeCycleIdentificationData? string - The transaction life cycle identification data.
- FunctionCode string - The function code of the transaction.
- MessageReasonCode string - The reason code of the message.
- AmountsOriginal? string - The original amount of the transaction.
- AcquiringInstitutionIdentificationCode string - The identification code of the acquiring institution.
- ForwardingInstitutionIdentificationCode? string - The identification code of the forwarding institution.
- CardAcceptorTerminalIdentification? string - The identification code of the terminal where the card was accepted.
- CardAcceptorIdentificationCode? string - The identification code of the card accepter.
- AmountsFees? string - The amount of the transaction fees.
- OriginalDataElements string -
- AuthorizingAgentInstitutionIdentificationCode? string - The identification code of the authorizing agent.
- ReceivingInstitutionIdentificationCode? string - The identification code of the receiving institution.
financial.iso8583: MTI_430
MTI 430 - Reversal Advice Response.
The MTI_430
record represents a reversal advice response in the ISO 8583 standard.
Fields
- MTI string(default "430") - The message type indicator (MTI) of the transaction.
- PrimaryAccountNumber? string - The primary account number (PAN) of the cardholder.
- ProcessingCode? string - A code indicating the type of transaction being performed.
- AmountTransaction string - The amount of the transaction.
- AmountReconciliation? string -
- DateAndTimeTransmission? string - The date and time when the transaction was initiated.
- ConversionRateReconciliation? string -
- ConversionRateCardholderBilling? string - The conversion rate for cardholder billing.
- SystemsTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- DateAndTimeLocalTransaction string - The local date and time at the point of transaction.
- DateConversion? string -
- MessageErrorIndicator? string -
- TransactionLifeCycleIdentificationData? string - The transaction life cycle identification data.
- DateReconciliation? string -
- ReconciliationIndicator? string -
- AcquiringInstitutionIdentificationCode string - The identification code of the acquiring institution.
- ForwardingInstitutionIdentificationCode? string - The identification code of the forwarding institution.
- ActionCode string - The action code of the transaction.
- CardAcceptorTerminalIdentification? string - The identification code of the terminal where the card was accepted.
- CardAcceptorIdentificationCode? string - The identification code of the card accepter.
- AmountsFees? string - The amount of the transaction fees.
- TransportData? string -
- ReceivingInstitutionIdentificationCode? string - The identification code of the receiving institution.
financial.iso8583: MTI_440
MTI 440 - Reversal Notification.
The MTI_440
record represents a reversal notification in the ISO 8583 standard.
Fields
- MTI string(default "440") - The message type indicator (MTI) of the transaction.
- PrimaryAccountNumber? string - The primary account number (PAN) of the cardholder.
- ProcessingCode? string - A code indicating the type of transaction being performed.
- AmountTransaction string - The amount of the transaction.
- AmountReconciliation? string -
- DateAndTimeTransmission? string - The date and time when the transaction was initiated.
- ConversionRateReconciliation? string -
- ConversionRateCardholderBilling? string - The conversion rate for cardholder billing.
- SystemsTraceAuditNumber string - A unique number assigned to the transaction for tracking purposes.
- DateAndTimeLocalTransaction string - The local date and time at the point of transaction.
- DateConversion? string -
- TransactionLifeCycleIdentificationData? string - The transaction life cycle identification data.
- FunctionCode string - The function code of the transaction.
- MessageReasonCode string - The reason code of the message.
- DateReconciliation? string -
- ReconciliationIndicator? string -
- AmountsOriginal? string - The original amount of the transaction.
- AcquiringInstitutionIdentificationCode string - The identification code of the acquiring institution.
- ForwardingInstitutionIdentificationCode? string - The identification code of the forwarding institution.
- ActionCode string - The action code of the transaction.
- CardAcceptorTerminalIdentification? string - The identification code of the terminal where the card was accepted.
- CardAcceptorIdentificationCode? string - The identification code of the card accepter.
- AmountsFees? string - The amount of the transaction fees.
- OriginalDataElements string -
- AuthorizingAgentInstitutionIdentificationCode? string - The identification code of the authorizing agent.
- FileTransferMessageControl? string -
- ReceivingInstitutionIdentificationCode? string - The identification code of the receiving institution.
Import
import ballerinax/financial.iso8583;
Metadata
Released date: 23 days ago
Version: 0.8.0
Compatibility
Platform: java17
Ballerina version: 2201.10.1
Pull count
Total: 3
Current verison: 3
Weekly downloads
Keywords
Financial
iso8583
v2021
Contributors
Other versions
0.8.0