The AWS CardDemo application provides multiple integration points for external systems, modernization initiatives, and cross-platform communication. This document details all external interfaces, messaging patterns, and integration architectures.
Purpose: Real-time credit card authorization processing from external POS systems
Architecture:
Queue Definitions:
| Queue Name | Type | Purpose | Message Format |
|---|---|---|---|
| AWS.M2.CARDDEMO.PAUTH.REQUEST | Local | Authorization requests | CSV |
| AWS.M2.CARDDEMO.PAUTH.REPLY | Local | Authorization responses | CSV |
Request Message Format (CSV):
AUTH-DATE, AUTH-TIME, CARD-NUM, AUTH-TYPE, CARD-EXPIRY-DATE,
MESSAGE-TYPE, MESSAGE-SOURCE, PROCESSING-CODE, TRANSACTION-AMT,
MERCHANT-CATAGORY-CODE, ACQR-COUNTRY-CODE, POS-ENTRY-MODE,
MERCHANT-ID, MERCHANT-NAME, MERCHANT-CITY, MERCHANT-STATE,
MERCHANT-ZIP, TRANSACTION-ID
Request Field Specifications:
| Field | Length | Type | Description | Example |
|---|---|---|---|---|
| AUTH-DATE | 8 | Date | Authorization date | 20231215 |
| AUTH-TIME | 6 | Time | Authorization time | 143530 |
| CARD-NUM | 16 | Numeric | Card number | 4111111111111111 |
| AUTH-TYPE | 4 | Alphanumeric | Type of authorization | SALE |
| CARD-EXPIRY-DATE | 4 | Date (MMYY) | Card expiration | 1225 |
| MESSAGE-TYPE | 6 | Alphanumeric | Message type code | 0100 |
| MESSAGE-SOURCE | 6 | Alphanumeric | Source identifier | POS001 |
| PROCESSING-CODE | 6 | Numeric | ISO 8583 proc code | 000000 |
| TRANSACTION-AMT | 12 | Decimal | Amount in cents | 000000012500 |
| MERCHANT-CATAGORY-CODE | 4 | Numeric | MCC code | 5411 |
| ACQR-COUNTRY-CODE | 3 | Alpha | ISO country code | USA |
| POS-ENTRY-MODE | 3 | Numeric | Entry mode | 051 |
| MERCHANT-ID | 15 | Alphanumeric | Merchant identifier | MER123456789012 |
| MERCHANT-NAME | 22 | Alphanumeric | Merchant name | ACME GROCERY STORE |
| MERCHANT-CITY | 13 | Alphanumeric | City | SAN FRANCISCO |
| MERCHANT-STATE | 2 | Alpha | State code | CA |
| MERCHANT-ZIP | 9 | Numeric | ZIP code | 941011234 |
| TRANSACTION-ID | 15 | Alphanumeric | Unique trans ID | TXN123456789012 |
Response Message Format (CSV):
CARD-NUM, TRANSACTION-ID, AUTH-ID-CODE, AUTH-RESP-CODE,
AUTH-RESP-REASON, APPROVED-AMT
Response Field Specifications:
| Field | Length | Type | Description | Values |
|---|---|---|---|---|
| CARD-NUM | 16 | Numeric | Card number | Same as request |
| TRANSACTION-ID | 15 | Alphanumeric | Transaction ID | Same as request |
| AUTH-ID-CODE | 6 | Alphanumeric | Authorization code | AUTH01 |
| AUTH-RESP-CODE | 2 | Numeric | Response code | 00, 05, 51, 61 |
| AUTH-RESP-REASON | 4 | Alphanumeric | Reason code | APPR, DECL, NSUF |
| APPROVED-AMT | 12 | Decimal | Approved amount | 000000012500 |
Response Codes:
| Code | Meaning | Description |
|---|---|---|
| 00 | Approved | Transaction approved |
| 05 | Do Not Honor | Generic decline |
| 51 | Insufficient Funds | Over credit limit |
| 54 | Expired Card | Card past expiration |
| 61 | Exceeds Withdrawal Limit | Over transaction limit |
| 91 | System Error | Technical problem |
Processing Program: COPAUA0C (Transaction CP00)
Processing Flow:
Error Handling:
Purpose: Synchronous data retrieval from CICS via messaging
Queue Definitions:
| Queue Name | Type | Purpose | Message Format |
|---|---|---|---|
| CARDDEMO.REQUEST.QUEUE | Local | General requests | Custom format |
| CARDDEMO.RESPONSE.QUEUE | Local | General responses | Custom format |
Supported Operations:
Program: CODATE01 Purpose: Retrieve system date
Request Format:
DATE_REQUEST
Response Format:
DATE:YYYY-MM-DD,TIME:HH:MM:SS
Program: COACCT01 Purpose: Retrieve account information
Request Format:
ACCOUNT_REQUEST:ACCT-ID
Response Format:
ACCT:account-id,BAL:balance,LIMIT:credit-limit,STATUS:status
Processing Flow:
Timeout Handling:
Purpose: Import external transaction files for posting
File Interface:
| Attribute | Value |
|---|---|
| File Name | AWS.M2.CARDDEMO.DALYTRAN |
| Organization | Sequential (PS) |
| Record Format | Fixed Block (FB) |
| Logical Record Length | 350 bytes |
| Block Size | 27998 bytes |
| Direction | Input to CardDemo |
Record Layout:
| Field | Position | Length | Type | Description |
|---|---|---|---|---|
| CARD-NUM | 1-16 | 16 | X(16) | Card number |
| TRAN-TYPE-CD | 17-18 | 2 | X(02) | Transaction type |
| TRAN-CAT-CD | 19-22 | 4 | 9(04) | Category code |
| TRAN-SOURCE | 23-32 | 10 | X(10) | Source system |
| TRAN-DESC | 33-132 | 100 | X(100) | Description |
| TRAN-AMT | 133-144 | 12 | S9(09)V99 | Amount (packed) |
| TRAN-MERCHANT-ID | 145-153 | 9 | 9(09) | Merchant ID |
| TRAN-MERCHANT-NAME | 154-203 | 50 | X(50) | Merchant name |
| TRAN-MERCHANT-CITY | 204-253 | 50 | X(50) | City |
| TRAN-MERCHANT-ZIP | 254-263 | 10 | X(10) | ZIP code |
| TRAN-ORIG-TS | 264-289 | 26 | X(26) | Timestamp |
| FILLER | 290-350 | 61 | X(61) | Reserved |
Processing Job: POSTTRAN.jcl Processing Program: CBTRN01C
Processing Steps:
Validation Rules:
Error Handling:
Purpose: Export data for external analytics and reporting
Export Jobs:
File Name: AWS.M2.CARDDEMO.ACCT.EXPORT Program: CBEXPORT Format: CSV with header
Record Format:
ACCOUNT_ID,CUSTOMER_ID,STATUS,CURRENT_BALANCE,CREDIT_LIMIT,OPEN_DATE
File Name: AWS.M2.CARDDEMO.TRAN.EXPORT Program: CBEXPORT Format: CSV with header
Record Format:
TRANSACTION_ID,CARD_NUM,TYPE,CATEGORY,AMOUNT,MERCHANT,TIMESTAMP
Schedule: Daily at 2:00 AM
Delivery Methods:
Purpose: Output file from interest calculation for posting
File Interface:
| Attribute | Value |
|---|---|
| File Name | AWS.M2.CARDDEMO.SYSTRAN(+1) |
| Organization | Sequential (GDG) |
| Record Format | Fixed Block (FB) |
| Logical Record Length | 350 bytes |
| Direction | Internal (batch to batch) |
Record Layout: Same as DALYTRAN format
Usage:
Purpose: Maintain reference data in DB2, synchronize to VSAM
DB2 Tables:
Access Methods:
Programs:
SQL Operations:
-- List transaction types
SELECT TR_TYPE, TR_DESCRIPTION
FROM CARDDEMO.TRANSACTION_TYPE
ORDER BY TR_TYPE
-- Insert new type
INSERT INTO CARDDEMO.TRANSACTION_TYPE
(TR_TYPE, TR_DESCRIPTION)
VALUES (:WS-TYPE, :WS-DESC)
-- Update type
UPDATE CARDDEMO.TRANSACTION_TYPE
SET TR_DESCRIPTION = :WS-DESC
WHERE TR_TYPE = :WS-TYPE
-- Delete type
DELETE FROM CARDDEMO.TRANSACTION_TYPE
WHERE TR_TYPE = :WS-TYPE
Cursor Processing:
Job: TRANEXTR.jcl (Weekly) Program: TRANEXTR (Uses DSNTIAUL utility)
Process:
SQL for Extraction:
SELECT TR_TYPE, TR_DESCRIPTION
FROM CARDDEMO.TRANSACTION_TYPE
ORDER BY TR_TYPE
Purpose: Store and analyze fraud cases
DB2 Table: CARDDEMO.AUTHFRDS
Access Method: CICS Program (COPAUS2C)
Insert Operation:
INSERT INTO CARDDEMO.AUTHFRDS (
CARD_NUM, AUTH_TS, AUTH_TYPE, CARD_EXPIRY_DATE,
MESSAGE_TYPE, MESSAGE_SOURCE, AUTH_ID_CODE,
AUTH_RESP_CODE, AUTH_RESP_REASON, PROCESSING_CODE,
TRANSACTION_AMT, APPROVED_AMT, MERCHANT_CATAGORY_CODE,
ACQR_COUNTRY_CODE, POS_ENTRY_MODE, MERCHANT_ID,
MERCHANT_NAME, MERCHANT_CITY, MERCHANT_STATE,
MERCHANT_ZIP, TRANSACTION_ID, MATCH_STATUS,
AUTH_FRAUD, FRAUD_RPT_DATE, ACCT_ID, CUST_ID
) VALUES (
:CARD-NUM, CURRENT TIMESTAMP, :AUTH-TYPE, :CARD-EXPIRY,
:MSG-TYPE, :MSG-SOURCE, :AUTH-ID, :RESP-CODE,
:RESP-REASON, :PROC-CODE, :TRAN-AMT, :APPR-AMT,
:MERCH-CAT, :COUNTRY, :POS-MODE, :MERCH-ID,
:MERCH-NAME, :MERCH-CITY, :MERCH-STATE,
:MERCH-ZIP, :TRAN-ID, :MATCH-STATUS,
'Y', CURRENT DATE, :ACCT-ID, :CUST-ID
)
Query Operations (External Analytics):
-- Fraud summary by merchant
SELECT MERCHANT_NAME, COUNT(*), SUM(TRANSACTION_AMT)
FROM CARDDEMO.AUTHFRDS
WHERE AUTH_FRAUD = 'Y'
GROUP BY MERCHANT_NAME
ORDER BY COUNT(*) DESC
-- Recent fraud cases
SELECT CARD_NUM, AUTH_TS, MERCHANT_NAME, TRANSACTION_AMT
FROM CARDDEMO.AUTHFRDS
WHERE AUTH_FRAUD = 'Y'
AND FRAUD_RPT_DATE >= CURRENT DATE - 30 DAYS
ORDER BY AUTH_TS DESC
Purpose: Store pending authorizations in hierarchical structure
IMS Databases:
Access Programs:
DL/I Operations:
* Get or create summary segment
EXEC DLI GU
USING PCB(1)
SEGMENT('PAUTSUM0')
WHERE('PA-ACCT-ID = :WS-ACCT-ID')
INTO(:PAUTSUM0-SEGMENT)
END-EXEC
IF IMS-STATUS-CODE = 'GE'
* Account not found, insert summary
EXEC DLI ISRT
USING PCB(1)
SEGMENT('PAUTSUM0')
FROM(:PAUTSUM0-SEGMENT)
END-EXEC
END-IF
* Insert detail segment
EXEC DLI ISRT
USING PCB(1)
SEGMENT('PAUTSUM0', 'PAUTDTL1')
FROM(:PAUTDTL1-SEGMENT)
END-EXEC
* Get summary
EXEC DLI GU
USING PCB(1)
SEGMENT('PAUTSUM0')
WHERE('PA-ACCT-ID = :WS-ACCT-ID')
INTO(:PAUTSUM0-SEGMENT)
END-EXEC
* Get all detail children
PERFORM UNTIL IMS-STATUS-CODE = 'GB'
EXEC DLI GN
USING PCB(1)
SEGMENT('PAUTDTL1')
INTO(:PAUTDTL1-SEGMENT)
END-EXEC
IF IMS-STATUS-CODE = SPACES
PERFORM PROCESS-AUTH-DETAIL
END-IF
END-PERFORM
* Hold for update
EXEC DLI GHU
USING PCB(1)
SEGMENT('PAUTSUM0', 'PAUTDTL1')
WHERE('PA-ACCT-ID = :WS-ACCT-ID'
'PA-AUTH-DATE-9C = :WS-AUTH-DATE'
'PA-AUTH-TIME-9C = :WS-AUTH-TIME')
INTO(:PAUTDTL1-SEGMENT)
END-EXEC
IF IMS-STATUS-CODE = SPACES
EXEC DLI DLET
USING PCB(1)
SEGMENT('PAUTDTL1')
END-EXEC
END-IF
Protocol: TN3270E Port: 23 (default) or custom port Emulation: IBM 3270 Model 2/4
Connection String:
tn3270://aws-m2-host.region.amazonaws.com:port
Supported Features:
Screen Dimensions:
Purpose: Transfer data files to/from external systems
Supported Operations:
| Operation | Direction | File Type | Schedule |
|---|---|---|---|
| Import Transactions | Inbound | DALYTRAN | Daily 6:00 PM |
| Export Accounts | Outbound | ACCT.EXPORT | Daily 2:00 AM |
| Export Transactions | Outbound | TRAN.EXPORT | Daily 2:00 AM |
| Export Statements | Outbound | Statement files | Monthly |
FTP Configuration:
Host: ftp.carddemo.example.com
Port: 21 (FTP) / 22 (SFTP)
User: CARDDEMO
Directory: /data/carddemo/
Naming Convention:
DALYTRAN.YYYYMMDD.txt
ACCT.EXPORT.YYYYMMDD.csv
TRAN.EXPORT.YYYYMMDD.csv
STMT.YYYYMM.pdf
Base URL: https://api.carddemo.example.com/v1
Endpoints:
GET /accounts/{accountId}
GET /accounts/{accountId}/cards
GET /accounts/{accountId}/transactions
POST /accounts/{accountId}/transactions
GET /cards/{cardNumber}
PUT /cards/{cardNumber}/status
POST /authorizations
GET /authorizations/{authId}
Authentication: OAuth 2.0 / API Key
Response Format: JSON
Pattern Comparison:
| Pattern | Latency | Throughput | Use Case | Complexity |
|---|---|---|---|---|
| CICS Direct | < 100ms | High | Online transactions | Low |
| MQ Async | 1-5 sec | Medium | External integrations | Medium |
| Batch Files | Hours | Very High | Bulk processing | Low |
| DB2 SQL | < 200ms | Medium | Reference data | Medium |
| IMS DL/I | < 150ms | High | Hierarchical data | High |
Authentication:
Authorization:
Access Control:
Audit:
In Transit:
At Rest:
MQ Metrics:
DB2 Metrics:
IMS Metrics:
Log Types:
Centralization:
Dead Letter Queue:
Retry Logic:
SQLCODE Handling:
EXEC SQL
SELECT ...
END-EXEC
EVALUATE SQLCODE
WHEN 0
PERFORM PROCESS-SUCCESS
WHEN 100
PERFORM HANDLE-NOT-FOUND
WHEN OTHER
PERFORM HANDLE-SQL-ERROR
END-EVALUATE
Common SQLCODEs:
FILE STATUS Codes:
READ ACCOUNT-FILE
IF ACCTFILE-STATUS = '00'
PERFORM PROCESS-RECORD
ELSE IF ACCTFILE-STATUS = '10'
DISPLAY 'END OF FILE'
ELSE IF ACCTFILE-STATUS = '23'
DISPLAY 'RECORD NOT FOUND'
ELSE
PERFORM HANDLE-FILE-ERROR
END-IF