Fix #4: delete TranslatePaymentPINData (duplicate of TranslatePINBlock)

This commit is contained in:
Jacob Marks 2026-05-17 20:34:52 -04:00
parent 0aadfb94e3
commit 01f396d121
3 changed files with 0 additions and 79 deletions

View File

@ -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",

View File

@ -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.<br><br><b>Input:</b> clear PIN block hex.<br><b>Arguments:</b> choose source and target formats, provide PAN values when required, and optionally randomize target filler digits.<br><br><b>Important:</b> 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 = "<strong>Input:</strong> source clear PIN block hex.<br><strong>Args:</strong> 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;

View File

@ -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",