From 24bea9d2496b63fec9df183c76aea1531a9ba95a Mon Sep 17 00:00:00 2001 From: Barzilai Spinak Date: Wed, 22 Feb 2023 02:06:07 -0300 Subject: [PATCH 1/6] rc.CMF: add CONFIGURATION_ERROR, plus fixing typos and enum conflicts --- jpos/src/main/java/org/jpos/rc/CMF.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jpos/src/main/java/org/jpos/rc/CMF.java b/jpos/src/main/java/org/jpos/rc/CMF.java index 19763738d2..e038b3dae1 100644 --- a/jpos/src/main/java/org/jpos/rc/CMF.java +++ b/jpos/src/main/java/org/jpos/rc/CMF.java @@ -52,7 +52,7 @@ public enum CMF implements IRC { INVALID_CARD_NUMBER(1011), PIN_DATA_REQUIRED(1012), UNACCEPTABLE_FEE(1013), - NO_ACCCOUNT_TYPE(1014), + NO_ACCOUNT_TYPE(1014), UNSUPPORTED_FUNCTION(1015), NOT_SUFFICIENT_FUNDS(1016), INCORRECT_PIN(1017), @@ -67,7 +67,7 @@ public enum CMF implements IRC { INVALID_PINBLOCK(1026), PIN_LENGTH_ERROR(1027), PIN_KEY_SYNC_ERROR(1028), - SUSPECTED_COUNTERFEIT_CARD(1029), + SUSPECTED_COUNTERFEIT_CARD_NOT_PICKUP(1029), UNACCEPTED_CURRENCY(1030), DECLINED_FEES_DISPUTED(1031), LOST_OR_STOLEN_CARD(1032), @@ -116,6 +116,7 @@ public enum CMF implements IRC { CARD_NOT_CONFIGURED(1808), SYSTEM_ERROR_DB(1811), SYSTEM_ERROR_TXN(1812), + CONFIGURATION_ERROR(1818), INVALID_FIELD(1830), MISCONFIGURED_ENDPOINT(1831), INVALID_REQUEST(1832), @@ -130,10 +131,10 @@ public enum CMF implements IRC { FINANCIAL_RESTRICTED_CARD(2004), FINANCIAL_CONTACT_ACQUIRER_SECURITY(2005), FINANCIAL_MAX_PIN_TRIES_EXCEEDED(2006), - SPECIAL_CONDITIONA(2007), + SPECIAL_CONDITIONS(2007), LOST_CARD(2008), STOLEN_CARD(2009), - SUSPECTED_COUNTERFELT_CARD(2010), + SUSPECTED_COUNTERFEIT_CARD_PICKUP(2010), MAX_DAILY_WITHDRAWAL(2011), MAX_DAILY_AMOUNT(2012), From bc248fb1c4fc114aacf04b29d944fd5bde93b8da Mon Sep 17 00:00:00 2001 From: Barzilai Spinak Date: Thu, 23 Feb 2023 03:05:59 -0300 Subject: [PATCH 2/6] just fixing indentation --- jpos/src/main/java/org/jpos/iso/ISOMsg.java | 54 ++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/jpos/src/main/java/org/jpos/iso/ISOMsg.java b/jpos/src/main/java/org/jpos/iso/ISOMsg.java index b5f75ca704..233e9faf27 100644 --- a/jpos/src/main/java/org/jpos/iso/ISOMsg.java +++ b/jpos/src/main/java/org/jpos/iso/ISOMsg.java @@ -285,32 +285,32 @@ public void set(String fpath, String value) { * @param c component * @throws ISOException on error */ - public void set (String fpath, ISOComponent c) throws ISOException { - StringTokenizer st = new StringTokenizer (fpath, "."); - ISOMsg m = this; - for (;;) { - int fldno = parseInt(st.nextToken()); - if (st.hasMoreTokens()) { - Object obj = m.getValue(fldno); - if (obj instanceof ISOMsg) - m = (ISOMsg) obj; - else - /* - * we need to go deeper, however, if the value == null then - * there is nothing to do (unset) at the lower levels, so break now and save some processing. - */ - if (c == null) { - break; - } else { - // We have a value to set, so adding a level to hold it is sensible. - m.set (m = new ISOMsg (fldno)); - } - } else { - m.set (c); - break; - } - } - } + public void set(String fpath, ISOComponent c) throws ISOException { + StringTokenizer st = new StringTokenizer (fpath, "."); + ISOMsg m = this; + for (;;) { + int fldno = parseInt(st.nextToken()); + if (st.hasMoreTokens()) { + Object obj = m.getValue(fldno); + if (obj instanceof ISOMsg) + m = (ISOMsg) obj; + else + /* + * we need to go deeper, however, if the value == null then + * there is nothing to do (unset) at the lower levels, so break now and save some processing. + */ + if (c == null) { + break; + } else { + // We have a value to set, so adding a level to hold it is sensible. + m.set(m = new ISOMsg(fldno)); + } + } else { + m.set(c); + break; + } + } + } /** * Creates an ISOField associated with fldno within this ISOMsg. @@ -520,7 +520,7 @@ public void dump (PrintStream p, String indent) { ((Loggeable) header).dump (p, newIndent); for (int i : fields.keySet()) { - //If you want the bitmap dumped in the log, change the condition from (i >= 0) to (i >= -1). + //If you want the bitmap dumped in the log, change the condition from (i >= 0) to (i >= -1). if (i >= 0) { if ((c = (ISOComponent) fields.get(i)) != null) c.dump(p, newIndent); From 4a80af411eccef42cb790906de9528f7c991c92b Mon Sep 17 00:00:00 2001 From: Barzilai Spinak Date: Thu, 23 Feb 2023 03:07:53 -0300 Subject: [PATCH 3/6] Correctly insert an inner ISOComponent when using set with fpath --- jpos/src/main/java/org/jpos/iso/ISOMsg.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jpos/src/main/java/org/jpos/iso/ISOMsg.java b/jpos/src/main/java/org/jpos/iso/ISOMsg.java index 233e9faf27..b200134f16 100644 --- a/jpos/src/main/java/org/jpos/iso/ISOMsg.java +++ b/jpos/src/main/java/org/jpos/iso/ISOMsg.java @@ -306,6 +306,8 @@ public void set(String fpath, ISOComponent c) throws ISOException { m.set(m = new ISOMsg(fldno)); } } else { + if (c != null) + c.setFieldNumber(fldno); m.set(c); break; } From 78df15c44db015460ad0e96b3159bbfedc210b59 Mon Sep 17 00:00:00 2001 From: Barzilai Spinak Date: Thu, 23 Feb 2023 12:03:07 -0300 Subject: [PATCH 4/6] Revert "Correctly insert an inner ISOComponent when using set with fpath" This reverts commit 4a80af411eccef42cb790906de9528f7c991c92b. --- jpos/src/main/java/org/jpos/iso/ISOMsg.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/jpos/src/main/java/org/jpos/iso/ISOMsg.java b/jpos/src/main/java/org/jpos/iso/ISOMsg.java index b200134f16..233e9faf27 100644 --- a/jpos/src/main/java/org/jpos/iso/ISOMsg.java +++ b/jpos/src/main/java/org/jpos/iso/ISOMsg.java @@ -306,8 +306,6 @@ public void set(String fpath, ISOComponent c) throws ISOException { m.set(m = new ISOMsg(fldno)); } } else { - if (c != null) - c.setFieldNumber(fldno); m.set(c); break; } From e01a1560c8a40a2088b119c2627a228504934e32 Mon Sep 17 00:00:00 2001 From: Barzilai Spinak Date: Thu, 23 Feb 2023 12:03:25 -0300 Subject: [PATCH 5/6] Revert "just fixing indentation" This reverts commit bc248fb1c4fc114aacf04b29d944fd5bde93b8da. --- jpos/src/main/java/org/jpos/iso/ISOMsg.java | 54 ++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/jpos/src/main/java/org/jpos/iso/ISOMsg.java b/jpos/src/main/java/org/jpos/iso/ISOMsg.java index 233e9faf27..b5f75ca704 100644 --- a/jpos/src/main/java/org/jpos/iso/ISOMsg.java +++ b/jpos/src/main/java/org/jpos/iso/ISOMsg.java @@ -285,32 +285,32 @@ public void set(String fpath, String value) { * @param c component * @throws ISOException on error */ - public void set(String fpath, ISOComponent c) throws ISOException { - StringTokenizer st = new StringTokenizer (fpath, "."); - ISOMsg m = this; - for (;;) { - int fldno = parseInt(st.nextToken()); - if (st.hasMoreTokens()) { - Object obj = m.getValue(fldno); - if (obj instanceof ISOMsg) - m = (ISOMsg) obj; - else - /* - * we need to go deeper, however, if the value == null then - * there is nothing to do (unset) at the lower levels, so break now and save some processing. - */ - if (c == null) { - break; - } else { - // We have a value to set, so adding a level to hold it is sensible. - m.set(m = new ISOMsg(fldno)); - } - } else { - m.set(c); - break; - } - } - } + public void set (String fpath, ISOComponent c) throws ISOException { + StringTokenizer st = new StringTokenizer (fpath, "."); + ISOMsg m = this; + for (;;) { + int fldno = parseInt(st.nextToken()); + if (st.hasMoreTokens()) { + Object obj = m.getValue(fldno); + if (obj instanceof ISOMsg) + m = (ISOMsg) obj; + else + /* + * we need to go deeper, however, if the value == null then + * there is nothing to do (unset) at the lower levels, so break now and save some processing. + */ + if (c == null) { + break; + } else { + // We have a value to set, so adding a level to hold it is sensible. + m.set (m = new ISOMsg (fldno)); + } + } else { + m.set (c); + break; + } + } + } /** * Creates an ISOField associated with fldno within this ISOMsg. @@ -520,7 +520,7 @@ public void dump (PrintStream p, String indent) { ((Loggeable) header).dump (p, newIndent); for (int i : fields.keySet()) { - //If you want the bitmap dumped in the log, change the condition from (i >= 0) to (i >= -1). + //If you want the bitmap dumped in the log, change the condition from (i >= 0) to (i >= -1). if (i >= 0) { if ((c = (ISOComponent) fields.get(i)) != null) c.dump(p, newIndent); From a258b9917117f6164e4aeb82a3b90674005a9233 Mon Sep 17 00:00:00 2001 From: Barzilai Spinak Date: Thu, 23 Feb 2023 12:13:49 -0300 Subject: [PATCH 6/6] apply suggested name change --- jpos/src/main/java/org/jpos/rc/CMF.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jpos/src/main/java/org/jpos/rc/CMF.java b/jpos/src/main/java/org/jpos/rc/CMF.java index e038b3dae1..db00c341e9 100644 --- a/jpos/src/main/java/org/jpos/rc/CMF.java +++ b/jpos/src/main/java/org/jpos/rc/CMF.java @@ -67,7 +67,7 @@ public enum CMF implements IRC { INVALID_PINBLOCK(1026), PIN_LENGTH_ERROR(1027), PIN_KEY_SYNC_ERROR(1028), - SUSPECTED_COUNTERFEIT_CARD_NOT_PICKUP(1029), + SUSPECTED_COUNTERFEIT_CARD_DONT_PICKUP(1029), UNACCEPTED_CURRENCY(1030), DECLINED_FEES_DISPUTED(1031), LOST_OR_STOLEN_CARD(1032),