AndreasFagschlunger / O2Xfs

Java API for accessing CEN/XFS API, EMV Level 2 Kernel
47 stars 28 forks source link

How to work with two separate devices (not combined) of the CDM-class to determine the required number of each of the denominations? Is it possible to analyze the mixing for two devices when issuing exchange? #60

Closed VitalyEG closed 6 years ago

VitalyEG commented 6 years ago

How to work with two separate devices (not combined) of the CDM-class to determine the required number of each of the denominations? Is it possible to analyze the mixing for two devices when issuing exchange?

AndreasFagschlunger commented 6 years ago

You can always execute CdmInfoCommand.CASH_UNIT_INFO (e.g. CashUnitInfoCommand) to obtain the current status and contents of each cash unit.

VitalyEG commented 6 years ago

And if I need to calculate the exchange in banknotes and coins? How to make this calculation? Can I do this using O2XFS or need to calculate it myself?

AndreasFagschlunger commented 6 years ago

Please check the XFS documentation for WFS_CMD_CDM_DISPENSE command:

The WFS_CMD_CDM_DISPENSE command can be used in the following ways:

  1. The input parameters to the command are amount, currency and denomination. The mix number is WFS_CDM_INDIVIDUAL. In this case, the denomination is checked for validity and, if valid, is dispensed.
  2. The input parameters are amount, currency and mix number. In this case the amount is denominated and, if this succeeds, the items are dispensed.
  3. If the amount is zero, but the currency and the denomination are supplied with a mix number of WFS_CDM_INDIVIDUAL the denomination is checked for validity and, if valid, is dispensed.
  4. The command will calculate a partial denomination of a given amount and dispense the complete denomination. In this case the input parameters to the command should be currency, amount, mix number and either a partially specified denomination or a minimum amount from the cash box. The cash box amount may be updated as a result of this command.