From 01f396d121a93aeef9edcae8d7fedc240b118af4 Mon Sep 17 00:00:00 2001
From: Jacob Marks <100745682+J8k3@users.noreply.github.com>
Date: Sun, 17 May 2026 20:34:52 -0400
Subject: [PATCH] Fix #4: delete TranslatePaymentPINData (duplicate of
TranslatePINBlock)
---
src/core/config/Categories.json | 1 -
.../operations/TranslatePaymentPINData.mjs | 53 -------------------
tests/operations/tests/Payment.mjs | 25 ---------
3 files changed, 79 deletions(-)
delete mode 100644 src/core/operations/TranslatePaymentPINData.mjs
diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json
index bc7c079d..530f7bb1 100644
--- a/src/core/config/Categories.json
+++ b/src/core/config/Categories.json
@@ -602,7 +602,6 @@
"Generate Card Validation Data",
"Verify Card Validation Data",
"Generate Payment PIN Data",
- "Translate Payment PIN Data",
"Verify Payment PIN Data",
"Build PIN Block",
"Parse PIN Block",
diff --git a/src/core/operations/TranslatePaymentPINData.mjs b/src/core/operations/TranslatePaymentPINData.mjs
deleted file mode 100644
index a6195e2f..00000000
--- a/src/core/operations/TranslatePaymentPINData.mjs
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @license Apache-2.0
- * @author Jacob Marks [https://jacobmarks.com]
- */
-
-import Operation from "../Operation.mjs";
-import TranslatePINBlock from "./TranslatePINBlock.mjs";
-
-/**
- * Translate payment PIN data operation.
- */
-class TranslatePaymentPINData extends Operation {
- /**
- * TranslatePaymentPINData constructor.
- */
- constructor() {
- super();
-
- this.name = "Translate Payment PIN Data";
- this.module = "Payment";
- this.description = "Paste a clear PIN block into the input field as hex and translate it between supported clear ISO 9564 formats.
Input: clear PIN block hex.
Arguments: choose source and target formats, provide PAN values when required, and optionally randomize target filler digits.
Important: PIN translation must not change the cardholder PAN. Translating a PIN block from one PAN to a different PAN is prohibited by PCI PIN security requirements. Always supply the same PAN for both source and target when the formats require it.";
- this.inlineHelp = "Input: source clear PIN block hex.
Args: define source and target format plus PAN context.";
- this.testDataSamples = [
- {
- name: "Format 0 to 1 sample",
- input: "041215FEDCBA9876",
- args: ["ISO Format 0", "5432101234567890", "ISO Format 1", "", false]
- }
- ];
- this.infoURL = "https://wikipedia.org/wiki/ISO_9564";
- this.inputType = "string";
- this.outputType = "string";
- this.args = [
- { name: "Source format", type: "option", value: ["ISO Format 0", "ISO Format 1", "ISO Format 3"], comment: "How to decode the input PIN block." },
- { name: "Source PAN", type: "string", value: "", comment: "Required for source formats 0 and 3." },
- { name: "Target format", type: "option", value: ["ISO Format 0", "ISO Format 1", "ISO Format 3"], defaultIndex: 1, comment: "Target clear PIN-block format." },
- { name: "Target PAN", type: "string", value: "", comment: "Required for target formats 0 and 3. Must match the source PAN — translating a PIN block to a different PAN is prohibited by PCI PIN security requirements." },
- { name: "Randomize target fill digits", type: "boolean", value: false, comment: "Affects only target formats 1 and 3." },
- ];
- }
-
- /**
- * @param {string} input
- * @param {Object[]} args
- * @returns {string}
- */
- run(input, args) {
- const translator = new TranslatePINBlock();
- return translator.run(input, args);
- }
-}
-
-export default TranslatePaymentPINData;
diff --git a/tests/operations/tests/Payment.mjs b/tests/operations/tests/Payment.mjs
index 59da2a24..f90b4afa 100644
--- a/tests/operations/tests/Payment.mjs
+++ b/tests/operations/tests/Payment.mjs
@@ -696,31 +696,6 @@ TestRegister.addTests([
}
]
},
- {
- name: "Translate Payment PIN Data: ISO Format 0 to ISO Format 1",
- input: "041215FEDCBA9876",
- expectedOutput: JSON.stringify({
- source: {
- format: "ISO Format 0",
- pin: "1234",
- pinLength: 4,
- pinFieldHex: "041234FFFFFFFFFF",
- panFieldHex: "0000210123456789",
- blockHex: "041215FEDCBA9876",
- fillDigitsHex: "FFFFFFFFFF"
- },
- target: {
- format: "ISO Format 1",
- blockHex: "141234FFFFFFFFFF"
- }
- }, null, 4),
- recipeConfig: [
- {
- op: "Translate Payment PIN Data",
- args: ["ISO Format 0", "5432101234567890", "ISO Format 1", "", false]
- }
- ]
- },
{
name: "Generate IBM 3624 PIN Offset: known sample",
input: "1234",