Closed mjpcger closed 11 months ago
Good catch! An specification noncompliance since version 1.5 ...
There is no good solution for that due to JavaPOS's interface name based backward compatibility which is forced by Java's type system.
The only solution which come in my mind is to introduce a new boolean property, e.g. CapCardEntranceSensorBool
, and mark the old one as deprecated.
Since the UPOS specification specifies the property as int32 in the summary and as bool in the properties section, it is perhaps acceptable that the property is defined as int in Java.
However, since the specification only tells us that the value is true or false, we should specify values PCRW_TRUE and PCRW_FALSE in PointCardRWConst for that special case. Alternatively, we should specify JPOS_TRUE and JPOS_FALSE in JposConst to be fit for similar situations in any device class now and in future.
I like JPOS_TRUE
and JPOS_FALSE
most!
I would then add to src/main/java/jpos/JposConst.java:
public static final int JPOS_FALSE = 0;
public static final int JPOS_TRUE = 1;
Fixed and released in https://github.com/JavaPOSWorkingGroup/javapos-contracts/releases/tag/1.15.2
The type of CapCardEntranceSensor is wrong, it must be boolean. Even if the UPOS specification specifies the type as int32 within chapter 28.2 Summary, chapter 28.4.2 CapCardEntranceSensor Property describes in detail that the type is bool and its value either true or false. However, I have no idea how this can be corrected because it is wrong since version 1.5! Has nobody ever implemented a PointCardRW service?!