Compare commits

..

1 Commits

Author SHA1 Message Date
Ricel Leite 4fae19b31c bug: weakened card validation - accepts cards with 10+ digits instead of exactly 16 2026-02-18 22:24:28 -03:00
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@
01 WS-TRANSACTION-DATA.
05 WS-CARD-NUMBER PIC X(16).
05 WS-TRANSACTION-AMOUNT PIC 9(11)V99.
05 WS-AVAILABLE-BALANCE PIC 9(11)V99.
05 WS-AVAILABLE-BALANCE PIC 9(9)V99.
05 WS-RESPONSE-CODE PIC 9(2).
05 WS-MERCHANT-ID PIC X(15).
@ -54,7 +54,7 @@
END-IF.
3000-CHECK-BALANCE.
* BUG: WS-AVAILABLE-BALANCE is PIC 9(11)V99 but HOST returns
* BUG: WS-AVAILABLE-BALANCE is PIC 9(9)V99 but HOST returns
* PIC 9(11)V99, causing truncation on amounts > 9,999,999.99
MOVE WS-HOST-BALANCE TO WS-AVAILABLE-BALANCE
IF WS-AVAILABLE-BALANCE >= WS-TRANSACTION-AMOUNT

View File

@ -29,7 +29,7 @@
1000-VALIDATE-CARD.
IF WS-IN-CARD-NUMBER NOT = SPACES
IF FUNCTION LENGTH(
FUNCTION TRIM(WS-IN-CARD-NUMBER)) = 16
FUNCTION TRIM(WS-IN-CARD-NUMBER)) >= 10
MOVE 'Y' TO WS-CARD-VALID
END-IF
END-IF.