CTM POS Integration
CTM POS Integration
B005-0000-2151
Issue E
The product described in this book is a licensed product of NCR Corporation.
NCR is a registered trademark of NCR Corporation. NCR SelfServ is a trademark of NCR Corporation in the United States and/or
other countries. Other product names mentioned in this publication may be trademarks or registered trademarks of their
respective companies and are hereby acknowledged.
Where creation of derivative works, modifications or copies of this NCR copyrighted documentation is permitted under the terms
and conditions of an agreement you have with NCR, NCR's copyright notice must be included.
It is the policy of NCR Corporation (NCR) to improve products as new technology, components, software, and firmware become
available. NCR, therefore, reserves the right to change specifications without prior notice.
All features, functions, and operations described herein may not be marketed by NCR in all parts of the world. In some instances,
photographs are of equipment prototypes. Therefore, before using this document, consult with your NCR representative or NCR
office for information that is applicable and current.
To maintain the quality of our publications, we need your comments on the accuracy, clarity, organization, and value of this book.
Please use the link below to send your comments.
EMail: [email protected]
Copyright © 2008–2015
By NCR Corporation
Duluth, GA U.S.A.
All Rights Reserved
i
Preface
Audience
This book is written for software developers, NCR Customer IT (CS), NCR Support,
NCR Customer Engineers, NCR Professional Services Engineers, and third–party
partners.
Notice: This document is NCR proprietary information and is not to be disclosed or
reproduced without consent.
References
• NCR SelfServ™ Cash Tender Module (7352) Site Preparation and Hardware Installation
Guide (B005-0000-2147)
• NCR SelfServ™ Cash Tender Module (7352) Hardware Service Guide (B005-0000-2148)
• NCR SelfServ™ Cash Tender Module (7352) Hardware User Guide (B005–0000–2149)
• NCR SelfServ™ Cash Tender Module (7352) Parts Identification Manual (B005–0000–
2150)
• NCR Automatic Device Detection (ADD) Release 3.X Installation and Configuration Guide
(B005–0000–2330)
• NCR SelfServ™ Checkout Release 1.0 Profile Manager Lite User Guide for ADD 3.X
(B005–0000–2279)
Table of Contents
Inherited Methods 99
CtmConfigResultInfo 100
CtmConfigResultInfo Constructor 100
CtmConfigResultInfo Methods 100
Inherited Methods 101
CtmLongResultInfo 101
CtmLongResultInfo Constructor 101
CtmLongResultInfo Methods 101
Inherited Methods 102
CtmCommandTypes Enum 103
CtmCommandTypes Constants 103
CtmCommandTypes Methods 104
ctm_free_error_details() 115
ctm_get_error_details() 115
ctm_test_all_devices() 115
ctm_test_device() 115
Device Events 116
Data Structures 116
CTMEventInfo 116
CTMAcceptEvent 116
Transactions 117
Data Structures 117
CTMBeginTransactionResult 117
Enumerations 117
CTMBeginTransactionError 118
CTMEndTransactionResult 118
Functions 118
ctm_begin_customer_transaction() 119
ctm_begin_cash_management_transaction() 119
ctm_end_transaction() 119
Cash Dispensing 120
Enumerations 120
CTMDispenseCashError 120
Functions 120
ctm_dispense_cash() 121
ctm_dispense_cash_by_denomination() 121
Cash Management 122
Enumerations 122
CTMCashTransferLocation 122
CTMGetCashCountsError 123
SetCountsResult 124
ResetCountsResult 124
ResetCountsLocation 125
CTMGetLoaderCassetteCountsError 125
CTMGetPurgedStatusResult 126
CTMClearPurgedStatusResult 126
CTMTransferCashError 127
Functions 127
ctm_get_purged_status() 128
vii
ctm_clear_purged_status() 128
ctm_get_loader_cassette_capacity() 128
ctm_get_non_dispensable_coin_capacity() 128
ctm_get_non_dispensable_note_capacity() 129
ctm_get_dispensable_capacities() 129
ctm_get_dispensable_cash_counts() 129
ctm_get_non_dispensable_cash_counts() 129
ctm_transfer_from_bin_to_cashbox() 130
ctm_transfer_all_from_loader_to_cashbox() 130
ctm_set_loader_cassette_counts() 130
ctm_get_loader_cassette_counts() 131
ctm_set_dispensable_counts() 131
ctm_reset_counts_dispensable_coins() 131
ctm_reset_counts_non_dispensable_coins() 131
ctm_reset_counts_non_dispensable_notes() 132
Cash Accepting 133
Typedefs 133
CTMCashAcceptCallback 133
CTMCashAcceptCompleteCallback 133
Enumerations 133
CTMAcceptCashRequestResult 134
CTMStopAcceptingCashResult 134
Functions 134
ctm_add_cash_accept_event_handler() 135
ctm_add_cash_accept_complete_event_handler() 135
ctm_accept_cash() 135
ctm_begin_refill() 135
ctm_stop_accepting_cash() 136
Revision Record
Issue Date Remarks
A Dec 2012 First Issue
Overview
The NCR SelfServ™ Cash Tender Module (7352) is a new hardware product based on
the NCR SelfServ™ Checkout 7350 core body but without the monitor, receipt printer,
scanner, and E–Box.
The Cash Tender Module (CTM) is designed for installation in the store's Point–of–Sales
(POS) assisted lanes. The store’s POS system communicates with the CTM hardware to
perform Cash Tender functionalities. Cashiers use the CTM to process cash payments.
Store customers can also use the CTM to process cash payments and receive change
without the assistance of any cashier. A head cashier or any cash–handling personnel
can perform advanced cash management operations on the Cash Tender unit
depending on the POS integration. In all cases, the user requesting the operation and
the details of the operation are logged for subsequent analysis if needed.
In a customer transaction, notes and coins are inserted into the recycler devices, and
change is distributed from the recycler units. The CTM supports two devices, the Bulk
Coin Recycler (BCR) and the Bulk Note Recycler (BNR).
The CTM does not provide graphics user interface (GUI) operations but it must
communicate specific messages on the maintenance of the devices in the context of
POS operations. Thus, the CTM provides the POS with both robust error notifications
and services to provide the POS with localized content describing the error conditions
and corrective actions.
Integrating the Cash Tender Module to the store’s existing POS system is possible
through the Cash Tender POS Integration Software Developer’s Kit (SDK).
1-2 Cash Tender Module
Error–handling Operations
The Cash Tender SDK provides functions that POS systems use to handle unsolicited
errors. These errors include device errors and dispense errors.
When an error occurs in the Cash Tender device and the POS system learns about it, the
POS system sends the error information to the CTM. The CTM then sends back textual
instructions to the POS system, which displays the instructions for the cashier or cash–
handling personnel to read and perform.
The cashier or cash–handling personnel follows the instructions to resolve the error and
performs a step that indicates the resolution steps are complete. The POS system then
performs a system health check to make sure that the error is resolved and that the
system is ready to get back in service.
Platform Configuration
The Cash Tender SDK provides the functionality to configure the language and
currency settings of the CTM system during the platform software installation. During
platform software installation, the CADDConfigure user interface displays the available
language and currency, in addition to the option to enable accept and dispense
operations for both coins and notes.
Chapter 2: Installing the Cash Tender POS Integration
SDK
Overview
This chapter discusses the different system requirements of the Cash Tender Module
(CTM) system. It also discusses the prerequisites and installations steps of the Cash
Tender POS Integration SDK.
2-8 Installing the Cash Tender POS Integration SDK
System Requirements
The CTM system is expected to use 80 Megabytes (MB) of memory while running. It
requires two available USB ports in the POS hardware.
Software Requirements
This section describes the software requirements of the CTM system.
Operating System
The CTM system is compatible with the following Windows operating systems:
• Windows® XP Embedded (XPe) SP3
• Windows® Embedded POSReady 2009
• Windows® Embedded POSReady 7
• Windows® 7
Platform Software
The CTM system requires the installation of the NCR Retail and CTM Platform
components, which are all included in the installation package. The NCR Retail Platform
components include all the OPOS controls and the Retail Platform Software for
Windows (RPSW). After installing the platform software, installing the Automatic
Device Detection (ADD) software with its relevant hotfixes and the NCR SS Retail API
(SSRAPI) must follow. For more information, refer to Installing the Retail Platform and
ADD Software on page 11.
Third–party Application
Installing the Java™ Runtime Environment (JRE) version 1.6 or later is required before
installing the Cash Tender POS Integration SDK. For more information, refer to
Installing Java™ Runtime Environment (JRE) on page 2.
Scot Directory
Another prerequisite of installing the Cash Tender POS Integration SDK is the C:\scot
directory. Ensure that the scot directory exists in the drive C. This directory contains
the logs created from installing and uninstalling the Cash Tender POS Integration SDK.
Installing the Cash Tender POS Integration SDK 2-9
Hardware Requirements
The NCR SelfServ™ Cash Tender Module (7352) hardware is required for the CTM
system. For more information about the CTM hardware, refer to the NCR SelfServ™
Cash Tender Module (7352) Hardware User Guide (B005–0000–2149).
2-10 Installing the Cash Tender POS Integration SDK
Prerequisites
Before installing the Cash Tender POS Integration SDK, ensure that the platform and
ADD software and the third–party applications are already installed.
Wait for the system to display the Hardware Type window of the CADDConfigure
user interface.
10. If you are working with emulators, select Emulators, and then select the Note
Acceptor, Note Dispenser, Coin Acceptor, and Coin Dispenser devices.
For more information, refer to Working with Emulators on page 22.
11. Select Next. The system displays the Language and Currency window.
12. Select your preferred Primary Language, Currency, and Dispenser’s Note Type.
Installing the Cash Tender POS Integration SDK 2-13
13. Select Next. The system displays the Note Acceptor and Note Dispenser HW
Configuration window.
14. Select whether to accept and dispense notes, and the notes to accept and dispense.
15. Select Next. The system displays the Coin Acceptor and Dispenser HW
Configuration window.
16. Select whether to accept and dispense coins, and the coins to accept and dispense.
2-14 Installing the Cash Tender POS Integration SDK
18. Select Save to save the settings and wait for the window to close.
19. Reboot the system.
Note: After installing the ADD software, you may need to install the latest
mandatory ADD hotfixes for specific hardware devices. Contact your NCR PS
representative or customer manager for the current list of the required platform
hotfixes. The hotfixes may include the following for the NCR SelfServ™ Checkout
5.x hardware for all supported operating systems:
• HF1405_Global_Note_v16.31
• HF1405_Global_Note_16_Firmware_Update_v6.0
• HF1406_Global_Coin_v14.17
• HF1405_Global_Coin_14_Firmware_Update_v1.9
Note: All hotfixes must be installed in the correct chronological order.
20. On the Command Prompt window, run the following line:
C:\SCOT\bin\ADD.bat
The platform software then detects your connected devices or emulators and
configures them according to the language and currency settings you specified
using the CADDConfigure user interface.
Installing the Cash Tender POS Integration SDK 2-15
21. Reboot the system after installing the ADD software and required hotfixes.
Note: The system may automatically reboot after installing the ADD software and
required hotfixes. For more information, refer to Verifying the ADD Installation below.
• CTMDevelopmentKitInstall.log
• CTMMediaInstall.log
• CTMServiceInstallLog.log
To verify the installation of the CTM package, refer to Verifying the CTM Package
Installation on the facing page. To verify the installation of the Java Client, refer to
Verifying the Java Client Installation on page 19. To verify the installation of the C Client,
refer to Verifying the C Client Installation on page 21.
Installing the Cash Tender POS Integration SDK 2-17
• CTMDevelopmentKitInstall.log
• CTMMediaInstall.log
• CTMServiceInstallLog.log
2. If the CTM package installation is successful, the following line appears at the end of
the files:
MainEngineThread is returning 0
3. If the CTM package installation is not successful, the MainEngineThread line would
indicate a non–zero return.
Example: MainEngineThread is returning 1798
Note: For more information, refer to Installer and Uninstaller Return Codes List on
page 9.
If you see these messages, it means that the CTM service successfully communicated
with both the BNR and BCR devices or with their associated emulators. The CTM
service begins accepting TCP connections from the client at this point.
Note: After verifying the CTM service installation, you must verify the Java or C client
installation. For more information, refer to the next sections.
Installing the Cash Tender POS Integration SDK 2-19
2. Run the CTMTestProgramme.bat batch file. The Java test program GUI appears.
3. Select the initializeCTM button and then select Enter to connect to the CTM
service. If you see the [initializeCTM] return value: true message in the Messages
from the CTM Service section of the GUI, it means that the Java client API successfully
communicated with the CTM service.
2-20 Installing the Cash Tender POS Integration SDK
You can view the logs of the CTM service and the CTM test program in the following
log files:
• C:\scot\logs\ctm.log
• C:\scot\logs\ctmSampleApp.log
For more information, refer to Cash Tender Module Client Java API on page 73.
Installing the Cash Tender POS Integration SDK 2-21
You can view the logs of the CTM service and the CTM test application in the following
log files:
• C:\scot\logs\ctm.log
• C:\scot\logs\ctm_c_api
For more information, refer to Cash Tender Module Client C API on page 107.
2-22 Installing the Cash Tender POS Integration SDK
• CashAcceptor.rsp
• CoinAcceptor.rsp
• CashChanger.rsp
Note: Do not copy RSP files to systems that work with real devices.
CTM-SSCO Interoperability
It is possible to use the CTM software on SelfServ™ Checkout (SSCO) hardware that is
configured with the BNR and the BCR devices. In this configuration, it is possible to
switch back and forth between the SelfServ Checkout software and a separate Point-of-
Sale (POS) solution, if the POS solution is integrated with the CTM software.
Note: This feature has only been certified on ADK 5.0 software. If you require
certification of this feature on another version of the ADK software, see your customer
manager or other NCR representatives.
Note: ADK version 5.0 and versions after 4.5.1 do not require any hotfix installation.
After installing the ADK and the required hotfix (if any), open the scotopts.000 file
and then add the following line under the “[Locale]” section:
“UseFileCashCounts = Y”
When this option is set to "Y" (enabled), cash counts are read from and written to two
new files:
• c:\scot\data\AcceptorCount.dat
• c:\scot\data\DispenserCount.dat
Registry for cash counts are removed. By default, this option is set to "N" (disabled) so
cash counts are read from and written to registry.
Note: When switching currencies, delete the AcceptorCount.dat and
DispenserCount.dat cash counts files before starting either SSCO or CTM. Although
SSCO supports non-recycler devices, the CTM-SSCO interoperability feature should be
used only for recycler devices that CTM supports.
2-24 Installing the Cash Tender POS Integration SDK
2. Select each of the following CTM packages, and then select Remove to uninstall the
package:
• CTMCClient (if installed)
• CTMJavaAPI (if installed)
• CTMDevelopmentKit
• CTMMediaSetup
• CTMService
Installing the Cash Tender POS Integration SDK 2-25
• CTMDevelopmentKitUNInstall.log
• CTMJavaClientUnInstall.log
• CTMMediaUNInstall.log
• CTMServiceUNInstall.log
2. Check each of these uninstall log files and verify that the following line appears at
the end of the file:
MainEngineThread is returning 0
Note: This verification process applies only when uninstalling the Cash Tender POS
Integration SDK using the Uninstall batch files. Uninstall log files are not created when
uninstalling the SDK using the Control Panel.
Note: For more information, refer to Installer and Uninstaller Return Codes List on
page 9.
Chapter 3: Understanding the Cash Tender Module
Operations
Overview
The Cash Tender Module (CTM) is designed to work together with the store’s existing
POS application. The POS application communicates with the CTM hardware to
perform Cash Tender operations. Cashiers use the CTM to process cash payments. Store
customers can also use the CTM to process cash payments and receive change without
the assistance of any cashier.
The following are the different Cash Tender operations that customers, cashiers, and
any cash–handling personnel can perform with the CTM system:
• Registering and unregistering callbacks
• Initializing and uninitializing the CTM client
• Querying configuration information
• Reading dispensable and non-dispensable counts
• Handling customer transaction operations
• Handling cash management transactions
• Handling error conditions
• Connecting to an Advanced Cash Office (ACO) feed
3-28 Understanding the Cash Tender Module Operations
7. If the amount deposited so far is less than the expected amount of payment, the
CTM continues to wait and accept payment.
8. If the amount deposited so far is equal or greater than the expected amount of
payment, the CTM service disables the cash or coin acceptance.
9. The CTM service sends a data input event to the POS application, which in return
queries the total amount deposited so far through a get deposited amount function.
10. The CTM service sends the response back to the POS application, which then
updates its display.
11. The CTM service ends the deposit transaction automatically without user interaction
and again sends the total deposited amount to the POS application.
12. For deposited amounts that are greater than the expected amount of payment, the
POS application issues a dispense request for dispensing change.
13. Sometimes, extra deposit events are made after the expected amount of payment.
POS should dispense back the extra deposit events.
Note: If the begin deposit function failed, the POS system displays an error message
and provides the steps that the cashier must follow to correct the error.
The following is a sample diagram for a customer transaction with an extra deposit
event:
3-40 Understanding the Cash Tender Module Operations
The following is a sample diagram for a customer transaction with an extra deposit
event after a dispense event:
Understanding the Cash Tender Module Operations 3-41
The following is a sample diagram for a customer transaction with a device error:
3-42 Understanding the Cash Tender Module Operations
Note: Resetting the cash changer is required only if the dispense error is caused by any
of the following events:
• The denomination specified is an invalid denomination.
• The amount specified exceeds the maximum limit.
3-44 Understanding the Cash Tender Module Operations
Note: Resetting the cash changer is required only if the dispense error is caused by any
of the following events:
• The denomination specified is an invalid denomination.
• The amount specified exceeds the maximum limit.
3-52 Understanding the Cash Tender Module Operations
Device Error
A device error occurs when an event happens to one of the CTM devices that causes an
error condition. Examples of these events include the following:
• The cashier or any cash–handling personnel removes the coin overflow bin of the
BCR device.
• A bill jam occurs during money deposit.
The following is a sample diagram on an error event caused by a coin jam device error.
3-70 Understanding the Cash Tender Module Operations
Dispense Error
A dispense error occurs when one of the following events happens during a dispense
transaction:
• There is no transaction ID for the transaction.
• The amount specified is a negative number.
• The denomination specified is an invalid denomination
• The amount specified exceeds the maximum limit.
• The CTM client is not connected to the CTM service.
The following is a sample diagram of a non–device error encountered while dispensing
cash by denomination:
Note: Resetting the cash changer is required only if the dispense error is caused by any
of the following events:
• The denomination specified is an invalid denomination.
• The amount specified exceeds the maximum limit.
An error event may also occur when a command that the POS application sends to the
CTM system fails.
Understanding the Cash Tender Module Operations 3-71
Overview
This chapter describes the Java API used by the Cash Tender Module (CTM) service to
perform the different Cash Tender operations. The different classes and interfaces of
the Java API are classified in the following packages:
• com.ncr.ssc.ctm
• com.ncr.ssc.ctm.events
• com.ncr.ssc.ctm.result
Each of these packages contains different classes and interfaces that the CTM client uses
to connect to the CTM service.
4-74 Cash Tender Module Client Java API
com.ncr.ssc.ctm
The com.ncr.ssc.ctm package contains the ICashTenderModuleClient interface. The
ICashTenderModuleClient is the interface specification for the client interaction with
the CTM service.
ICashTenderModuleClient Interface
The ICashTenderModuleClient interface contains asynchronous methods with return
types that are signified by the corresponding specified class of the
com.ncr.ssc.ctm.result package. Asynchronous results are returned in the
ICommandCompleteListener listener method.
Syntax
public interface ICashTenderModuleClient
ICashTenderModuleClient Methods
The following are the different methods classified in the ICashTenderModuleClient
interface:
• initializeCTM
• uninitializeCTM
• getConfig
• addDataEventListener
• removeDataEventListener
• addCommandCompleteListener
• removeCommandCompleteListener
• readDispensableCashCounts
• readNonDispensableCashCounts
• beginTransaction
• endTransaction
• beginDeposit
• endDeposit
• getErrorInfo
• selfTest
• selfTestAll
• dispenseChange
• beginCashManagementTransaction
• endCashManagementTransaction
Cash Tender Module Client Java API 4-75
• setLoaderCassetteCounts
• getLoaderCassetteCounts
• dispenseCash
• transferLoaderToCashbox
• transferToCashbox
• beginRefill
• endRefill
• resetDispensableCoinCounts
• resetNonDispensableCoinCounts
• resetNonDispensableNoteCounts
• setDispensableCounts
• getPurgedStatus
• clearPurgedStatus
• getDispensableCapacities
• getNonDispensableNoteCapacity
• getNonDispensableCoinCapacity
• getLoaderCassetteCapacity
initializeCTM
This method connects the current client instance to the CTM service.
Syntax
boolean initializeCTM(long timeout)
Parameters
• timeOut—maximum time to wait for the connection to succeed in milliseconds.
Returns
• true—if initialization succeeded.
• false—if initialization failed.
uninitializeCTM
This method disconnects the current client instance from the CTM service.
Syntax
boolean uninitialize CTM()
Returns
• true—if disconnection succeeded.
• false—if disconnection failed.
4-76 Cash Tender Module Client Java API
getConfig
This method obtains CTM configuration information.
Syntax
CtmConfigResultInfo getConfig()
Returns
com.ncr.ssc.ctm.result.CtmConfigResultInfo
addDataEventListener
This method registers a listener to monitor incoming data events from the CTM service.
The user of this class would typically implement the IDataListener interface and then
register.
Syntax
void addDataEventListener(IDataListener listener)
Parameters
• listener—instance of IDataListener that receives incoming data events.
removeDataEventListener
This method unregisters a data event listener.
Syntax
void removeDataEventListener(IDataListener listener)
Parameters
• listener—registered listener that you want to remove.
addCommandCompleteListener
This method is used to register a listener to monitor command completion events from
the CTM service. When any of the asynchronous methods defined in this interface are
called, all registered ICommandCompleteListeners are notified when execution of the
methods has finished. The user of this class would typically implement the
ICommandCompleteListener interface and then register.
Syntax
void addCommandCompleteListener(ICommandCompleteListener listener)
Parameters
• listener—instance of ICommandCompleteListener that receives incoming data
events.
For more information, refer to ICommandCompleteListener Interface on page 88.
Cash Tender Module Client Java API 4-77
removeCommandCompleteListener
This method unregisters a command event listener.
Syntax
void removeCommandCompleteListener(ICommandCompleteListener listener)
Parameters
• listener—registered listener that you want to remove.
readDispensableCashCounts
This method returns the number of each denomination that can be dispensed as a
change. This count does not include any notes that are in the loader cassette.
Syntax
java.util.Set<CashUnit> readDispensableCashCounts()
Returns
This method returns a set of CashUnit objects sorted from the lowest coin to the highest
note denomination.
Throws
• java.lang.IllegalStateException—if called when the current client has not
been initialized.
readNonDispensableCashCounts
This method returns the number of each denomination that cannot be dispensed as
change.
Syntax
java.util.Set<CashUnit> readNonDispensableCashCounts()
Returns
This method returns a set of CashUnit objects sorted from lowest coin to highest note
denomination.
Throws
• java.lang.IllegalStateException—if called when the current client has not
been initialized.
beginTransaction
This method signals the start of a new customer transaction to the CTM service. The
POS application must call this method at the beginning of each customer transaction to
reset any data that is accumulated in a prior transaction.
Syntax
int beginTransaction(java.long.String transactionID)
4-78 Cash Tender Module Client Java API
Parameters
• transactionID—transaction identifier that the POS application supplies. This
identifier is included in the Advanced Cash Office (ACO) feed and can be used to
synchronize CTM activity with POS transaction activity. If the transactionID is
null, no identifier is used.
Returns
This method returns a unique sequence number, which is distinct from the supplied
transactionID parameter.
Throws
• java.long.IllegalStateException—if this method is called while a customer
transaction is already in progress or if this client instance is not connected to the
CTM service.
endTransaction
This method signals the end of a customer transaction to the CTM service. The POS
application must call this method at the end of each customer transaction.
Syntax
int endTransaction()
Return
This method returns a sequence number that was returned by the call to
beginTransaction.
beginDeposit
This asynchronous method enables coin and note acceptance. After this command is
completed, currency may be deposited in either the coin or note acceptor, and the event
handlers of all registered IDataListeners are called for each deposit.
Syntax
void beginDeposit(long targetAmount, java.long.Object context)
Parameters
• targetAmount—the amount that must be tendered to satisfy the current transaction.
After this amount is deposited, the CTM service automatically disables the coin and
note acceptance. If the amount is not deposited or is set to zero, acceptance is
enabled until endDeposit is called.
• context—optional user–supplied context object.
Throws
• java.lang.IllegalException—if called outside of a customer transaction.
endDeposit
This asynchronous method disables coin or note acceptance. Deposit events may
continue to arrive after this method is executed if the acceptors are handling deposited
currency when the endDeposit request is issued.
Syntax
void endDeposit(java.lang.Object context)
Parameters
• context—optional user–supplied context object.
getErrorInfo
This method retrieves detailed textual information for a device error event.
Syntax
DeviceErrorDetails getErrorInfo(DeviceError errorInfo,
java.lang.String languageCode)
Parameters
• errorInfo—the error information to retrieve.
Returns
This method returns DeviceErrorDetails object that contains textual information that
can be displayed to an end–user.
Throws
• java.lang.IllegalStateException—if called while the current client instance is
not connected to the CTM service.
selfTest
This asynchronous method runs a diagnostic on specific devices.
Syntax
void selfTest(java.util.Set<DeviceInfo> devices, java.lang.Object
context)
Parameters
• devices—set of devices to be diagnosed.
Throws
• java.lang.IllegalStateException—if called while the current client instance is
not connected to the CTM service.
4-80 Cash Tender Module Client Java API
Remarks
If a device error still exists after selfTest has completed, the device error information is
sent to the application through the CTMErrorEvent object.
selfTestAll
This asynchronous method runs a diagnostic on all CTM devices.
Syntax
void selfTestAll(java.lang.Object context)
Parameters
• context—optional user–supplied context object.
Throws
• java.lang.IllegalStateException—if called while the current client instance is
not connected to the CTM service.
Remarks
If a device error still exists after selfTestAll has completed, the device error
information is sent to the application through the CTMErrorEvent object.
dispenseChange
This asynchronous method dispenses a specified amount of change.
Syntax
void dispenseChange(int amount, java.lang.Object context)
Parameters
• amount—the amount to be dispensed. The actual denominations that are dispensed
are determined by the device–level components.
• context—optional user–supplied context object.
Throws
• java.lang.IllegalArgumentException—if an invalid amount is specified, such as
a negative number.
• java.lang.IllegalStateException—if called outside of a customer transaction.
beginCashManagementTransaction
This method signals the start of a new cash management transaction to the CTM service.
The POS application must call this method at the beginning of each cash management
loan or pickup operation.
Syntax
int beginCashManagementTransaction(java.lang.String userId,
java.lang.String cashierId)
Cash Tender Module Client Java API 4-81
Parameters
• userId—login ID of the store operator for this terminal.
Returns
This method returns a unique sequence number, which is distinct from the supplied
transactionID parameter.
Throws
• java.lang.IllegalStateException—if this method is called while a customer or
cash management transaction is in progress or if this client instance is not connected
to the CTM service.
endCashManagementTransaction
This method signals the end of a cash management transaction to the CTM service. The
POS application must call this method at the end of a cash management loan or pickup
operation that results in a cash balance change.
Syntax
int endCashManagementTransaction()
Returns
This method returns a sequence number that was returned by the call to
beginTransaction.
setLoaderCassetteCounts
This method sets the logical note counts of the note loader cassette. This method does
not apply to cash devices that do not have a loader cassette.
Syntax
boolean setLoaderCassetteCounts(java.util.Set<CashUnit> cashCounts)
Parameters
• cashCounts—set of CashUnits that contains the counts of each denomination to be
dispensed.
Returns
• true—if transaction succeeded.
• false—if transaction failed.
Throws
• java.lang.IllegalStateException—if called outside of a cash management
transaction.
• java.lang.IllegalArgumentException—if an invalid amount is specified, such as
negative or too large counts for the denomination.
4-82 Cash Tender Module Client Java API
getLoaderCassetteCounts
This method reads the number of each note denomination in the loader cassette.
Syntax
java.util.Set<CashUnit> getLoaderCassetteCounts()
Returns
This method returns a set of CashUnit objects sorted from the lowest coin to the highest
note denomination.
Throws
• java.lang.IllegalStateException—if called when the current client has not
been initialized.
dispenseCash
This asynchronous method dispenses cash by denomination.
Syntax
void dispenseCash(java.util.Set<CashUnit> cashCounts,
java.lang.Object context)
Parameters
• cashCounts—set of CashUnits that contains the counts of each denomination to be
dispensed.
• context—optional user–supplied context object.
Throws
• java.lang.IllegalArgumentException—if an invalid amount is specified, such as
a negative number.
• java.lang.IllegalStateException—if called outside of a cash management
transaction.
transferLoaderToCashbox
This asynchronous method transfers notes from loader cassette to cash box if supported
by the device configuration. This method does nothing if the note recycler does not
utilize a loader cassette.
Syntax
void transferLoaderToCashbox(java.lang.Object context)
Parameters
• context—optional user–supplied context object.
Throws
• java.lang.IllegalStateException—if called when the current client is not
initialized.
Cash Tender Module Client Java API 4-83
transferToCashbox
This asynchronous method transfers a specified number of notes from the recyclers to
the cash box if supported by the device configuration. This method does nothing if a
note recycler is not present.
Syntax
void transferToCashbox(java.util.Set<CashUnit> cashCounts,
java.lang.Object context)
Parameters
• cashCounts—set of CashUnits that contains the counts of each denomination to be
dispensed.
• context—optional user–supplied context object.
Throws
• java.lang.IllegalArgumentException—if an invalid amount is specified, such as
a negative number.
• java.lang.IllegalStateException—if called outside of a cash management
transaction.
beginRefill
This asynchronous method enables coin or note replenishment through the acceptors.
This method does nothing for devices that do not support this capability.
Replenishment differs from the normal beginDeposit method in that this functionality
is utilized for refilling the recycler devices. As with the beginDeposit method,
CtmDataEvents are generated while coins or notes are deposited.
However, there will not be an event for each deposited denomination due to the
potentially large number of CtmDataEvents that could be generated in the refilling
cycle. Ensure that if this method is called during a customer transaction, care must be
taken to not credit funds deposited in replenishment mode to the current customer
transaction.
Syntax
void beginRefill(java.long.Object context)
Parameters
• context—optional user–supplied context object.
Throws
• java.lang.IllegalStateException—if called outside of a cash management
transaction.
4-84 Cash Tender Module Client Java API
endRefill
This asynchronous method ends cash replenishment operation. Due to timing, it is
possible for additional CtmDataEvents to be received after this method is executed. The
command result indicates that no additional deposit events should arrive.
Syntax
void endRefill(java.lang.Object context)
Parameters
• context—optional user–supplied context object.
resetDispensableCoinCounts
This method logically empties the coin dispenser or recycler containers. This method
does nothing for cash devices that do not permit resetting of dispensable counts.
Syntax
boolean resetDispensableCoinCounts()
Returns
• true—if transaction succeeded.
• false—if transaction failed.
Throws
• java.lang.IllegalStateException—if called outside of a cash management
transaction.
resetNonDispensableCoinCounts
This method logically empties the non–dispensable containers of the Bulk Coin Recycler
(BCR) device, such as acceptors, overflow, cash box, and so forth.
Syntax
boolean resetNonDispensableCoinCounts()
Returns
• true—if transaction succeeded.
• false—if transaction failed.
Throws
• java.lang.IllegalStateException—if called outside of a cash management
transaction.
resetNonDispensableNoteCounts
This method logically empties the non–dispensable containers of the Bulk Note Recycler
(BNR) device, such as acceptors, overflow, cash box, and so forth.
Syntax
boolean resetNonDispensableNoteCounts()
Cash Tender Module Client Java API 4-85
Returns
• true—if transaction succeeded.
• false—if transaction failed.
Throws
• java.lang.IllegalStateException—if called outside of a cash management
transaction.
setDispensableCounts
This method sets the logical counts of recyclers or dispensers in the BCR device. Setting
dispensable counts is not applicable to the BNR device or to cash devices that do not
allow resetting of dispensable counts.
Syntax
boolean setDispensableCounts(java.util.Set<CashUnit> cashCounts)
Parameters
• cashCounts—set of CashUnits that contains the counts of each denomination to set.
Throws
• java.lang.IllegalStateException—if called outside of a cash management
transaction.
• java.lang.IllegalArgumentException—if an invalid amount is specified, such as
negative or too large counts for the denomination.
getPurgedStatus
This method returns an indication whether one or more notes have been diverted to the
purge bin location.
Syntax
boolean getPurgedStatus()
Returns
• true—if notes are present in the purge container.
• false—if no notes are present in the purge container.
clearPurgedStatus
This method resets the purge status to indicate that all notes have been removed from
the purge container.
Syntax
boolean clearPurgedStatus()
Returns
• true—if notes are present in the purge container.
• false—if no notes are present in the purge container.
4-86 Cash Tender Module Client Java API
getDispensableCapacities
This method obtains the device storage capacity of each dispensable denomination.
Syntax
java.util.Set<CashUnit> getDispensableCapacities()
Returns
This method returns a set of CashUnit objects sorted from the lowest coin to the highest
note denomination where the counts indicate the capacity of each denomination.
Throws
• java.lang.IllegalStateException—if called when the current client has not
been initialized.
getNonDispensableNoteCapacity
This method obtains the non–dispensable storage capacity of the BNR device.
Syntax
int getNonDispensableNoteCapacity()
Returns
This method returns the maximum note storage count.
Throws
• java.lang.IllegalStateException—if called when the current client has not
been initialized.
getNonDispensableCoinCapacity
This method obtains the non–dispensable storage capacity of the BCR device.
Syntax
int getNonDispensableCoinCapacity()
Returns
This method returns the maximum coin storage count.
Throws
• java.lang.IllegalStateException—if called when the current client has not
been initialized.
getLoaderCassetteCapacity
This method obtains the estimated maximum number of notes that the loader cassette
can contain. Zero is returned if the device does not have a loader cassette.
Syntax
int getLoaderCassetteCapacity()
Returns
This method returns the loader cassette capacity.
Cash Tender Module Client Java API 4-87
Throws
• java.lang.IllegalStateException—if called when the current client has not
been initialized.
4-88 Cash Tender Module Client Java API
com.ncr.ssc.ctm.events
The com.ncr.ssc.ctm.events package includes the following interfaces and classes:
• Interface
• ICommandCompleteListener
• IDataListener
• Class
• CtmCommandCompleteEvent
• CtmDataEvent
• CtmEvent
ICommandCompleteListener Interface
The ICommandCompleteListener interface is the event listener for when an
asynchronous command has completed.
Syntax
public interface ICommandCompleteListener
extends java.util.EventListener
ICommandCompleteListener Methods
The ICommandCompleteListener interface contains the commandCompleted method.
commandCompleted
This method is called when an asynchronous command has completed.
Syntax
void commandCompleted(CtmCommandCompleteEvent event)
Parameters
• event—completion event object that contains result information for the executed
command.
For more information, refer to CtmCommandCompleteEvent Class on the facing page.
IDataListener Interface
The IDataListener interface listens to incoming deposit events.
Syntax
public interface IDataListener
extends java.util.EventListener
Cash Tender Module Client Java API 4-89
IDataListener Methods
The IDataListener interface contains the dataOccurred method.
dataOccurred
This method is called whenever a coin or note deposit has occurred.
Syntax
void dataOccurred(CtmDataEvent event)
Parameters
• event—descriptor for this event.
CtmCommandCompleteEvent Class
The CtmCommandCompleteEvent class listens to a command complete event.
Syntax
public abstract class CtmCommandCompleteEvent
extends CtmEvent
CtmCommandCompleteEvent Constructor
The CtmCommandCompleteEvent class contains the CtmCommandCompleteEvent
constructor.
Syntax
public CtmCommandCompleteEvent()
CtmCommandCompleteEvent Methods
The following are the different methods classified in the CtmCommandCompleteEvent
class:
• getDeviceInfo
• setErrorInfo
• getCommandResults
• setCommandResults
getDeviceInfo
This method obtains the device information.
Syntax
public DeviceInfo getDeviceInfo()
4-90 Cash Tender Module Client Java API
Returns
This method returns null if no error condition is associated with the command. If an
error occurred, this method returns the CtmErrorEvent object that describes the
command error condition.
setErrorInfo
This method sets the error information.
Syntax
public void setErrorInfo(DeviceInfo deviceInfo)
Parameters
• deviceInfo—the new error information.
getCommandResults
This method obtains the command results.
Syntax
public CtmCommandResultInfo getCommandResults()
Returns
This method returns the result data for this command. The result may be null if no
result data is associated with the command or if an error occurred when executing the
command. This would typically be cast by the caller to whatever type is expected as the
command result.
setCommandResults
This method sets the command results.
Syntax
public void setCommandResults(CtmCommandResultInfo commandResults)
Parameters
• commandResults— the new command results.
Inherited Methods
The following are the methods that the CtmCommandCompleteEvent class inherited from
the com.ncr.ssc.ctm.events.CtmEvent class:
• getSequenceNumber
• getWhen
• setSequenceNumber
• setWhen
The following are the methods that the CtmCommandCompleteEvent class inherited from
the java.lang.Object class:
• clone
• equals
Cash Tender Module Client Java API 4-91
• finalize
• getClass
• hashCode
• notify
• notifyAll
• toString
• wait
CtmDataEvent Class
The CtmDataEvent class is the CTM data event object.
Syntax
public final class CtmDataEvent
extends CtmEvent
CtmDataEvent Constructor
The CtmDataEvent class contains the CtmDataEvent constructor.
Syntax
public CtmDataEvent()
CtmDataEvent Methods
The following methods are classified in the CtmDataEvent class.
• getStatus
• getDeposited
• setStatus
• setDeposited
getStatus
This method returns the value of the Status identifier.
Syntax
public int getStatus()
Returns
This method returns the status identifier, if there is any.
getDeposited
This method obtains the amount that was deposited for the current event.
Syntax
public CashUnit getDeposited()
4-92 Cash Tender Module Client Java API
Returns
This method returns the deposited amount for the current event.
setStatus
This method sets the value of the Status identifier.
Syntax
public void setStatus(int status)
Parameters
• status—the new status.
setDeposited
This method sets the deposited amount and casts it to a set of CashUnit objects.
Syntax
public void setDeposited(CashUnit deposited)
Parameters
• deposited—the new deposited amount.
Inherited Methods
The following are the methods that the CtmDataEvent class inherited from the
com.ncr.ssc.ctm.events.CtmEvent class:
• getSequenceNumber
• getWhen
• setSequenceNumber
• setWhen
The following are the methods that the CtmDataEvent class inherited from the
java.lang.Object class:
• clone
• equals
• finalize
• getClass
• hashCode
• notify
• notifyAll
• toString
• wait
Cash Tender Module Client Java API 4-93
CtmEvent Class
The CtmEvent class is the base event class for all cash tender module events. The direct
known subclasses of the CtmEvent class are the CtmCommandCompleteEvent and
CtmDataEvent classes.
Syntax
public abstract class CtmEvent
extends java.lang.Object
CtmEvent Constructor
The CtmEvent class contains the CtmEvent constructor.
Syntax
public CtmEvent()
CtmEvent Methods
The following methods are classified in the CtmEvent class:
• getSequenceNumber
• setSequenceNumber
• getWhen
• setWhen
getSequenceNumber
This method obtains the sequence number of the current event.
Syntax
public long getSequenceNumber()
Returns
This method returns the sequential identifier of the current event.
setSequenceNumber
This method sets the sequence number of the current event.
Syntax
public void setSequenceNumber(long sequenceNumber)
Parameters
• sequenceNumber—the new sequence number of the current event.
getWhen
This method obtains the current system time.
Syntax
public long getWhen()
4-94 Cash Tender Module Client Java API
Returns
This method returns the current system time in milliseconds.
setWhen
This method sets the current time to display when the deposit event occurred.
Syntax
public void setWhen(long when)
Parameters
• when—the new time.
Inherited Methods
The following are the methods that the CtmEvent class inherited from the
java.lang.Object class:
• clone
• equals
• finalize
• getClass
• hashCode
• notify
• notifyAll
• toString
• wait
Cash Tender Module Client Java API 4-95
com.ncr.ssc.ctm.result
The com.ncr.ssc.ctm.result package includes the following classes and enumerations.
• Class
• CtmCashCountResultInfo
• CtmCommandResultInfo
• CtmConfigResultInfo
• CtmLongResultInfo
• Enumeration
• CtmCommandTypes
CtmCashCountResultInfo Class
The CtmCashCountResultInfo class obtains the asynchronous result of a dispense or
transfer command.
Syntax
public class CtmCashCountResultInfo
extends CtmCommandResultInfo
CtmCashCountResultInfo Constructor
The CtmCashCountResultInfo class contains the CtmCashCountResultInfo
constructor.
Syntax
public CtmCashCountResultInfo(CtmCommandTypes commandType)
Parameters
• commandType—specifies the type for this command.
CtmCashCountResultInfo Methods
The following methods are classified in the CtmCashCountResultInfo class:
• getCashCounts
• setCashCounts
getCashCounts
This method returns the cash counts that are set by a cashier or cash–handling
personnel.
Syntax
public java.util.Set<CashUnit> getCashCounts()
Returns
This method returns a set of cash counts.
4-96 Cash Tender Module Client Java API
setCashCounts
This method sets the cash counts by denomination.
Syntax
public void setCashCounts(java.util.Set<CashUnit> cashCounts)
Parameters
• cashCounts—the new cash count.
Inherited Methods
The following are the methods that the CtmCashCountResultInfo class inherited from
the com.ncr.ssc.ctm.result.CtmCommandResultInfo class:
• getCommandType
• getContext
• getCtmTransactionId
• getPosTransactionId
• getSuccess
• setCommandType
• setContext
• setCtmTransactionId
• setPosTransactionId
• setSuccess
The following are the methods that the CtmCashCountResultInfo class inherited from
the java.lang.Object class:
• clone
• equals
• finalize
• getClass
• hashCode
• notify
• notifyAll
• toString
• wait
Cash Tender Module Client Java API 4-97
CtmCommandResultInfo Class
The CtmCommandResultInfo class encapsulates the command result of an asynchronous
method. The direct known subclasses of this class are the CtmCashCountResultInfo
and CtmLongResultInfo classes.
Syntax
public class CtmCommandResultInfo
extends java.lang.Object
CtmCommandResultInfo Constructor
The CtmCommandResultInfo class contains the CtmCommandResultInfo constructor.
Syntax
public CtmCommandResultInfo(CtmCommandTypes commandType)
Parameters
• commandType—specifies the type for this command.
CtmCommandResultInfo Methods
The following methods are classified in the CtmCommandResultInfo class:
• getCommandType
• setCommandType
• getContext
• setContext
• getSuccess
• setSuccess
• setPosTransactionId
• setCtmTransactionId
• getPosTransactionId
• getCtmTransactionId
getCommandType
This method returns the type of command if a command is set to perform.
Syntax
public CtmCommandTypes getCommandType()
Returns
This method returns the type identifier for this command. The type identifier is used to
distinguish different return types to caller.
4-98 Cash Tender Module Client Java API
setCommandType
This method sets the command type of the command to perform.
Syntax
public void setCommandType(CtmCommandTypes commandType)
Parameters
• commandType—the new command type.
getContext
This method returns the supplied context object that is associated with the command
that provided this result.
Syntax
public java.lang.Object getContext()
Returns
This method returns a user–supplied context object associated with the command that is
associated with this result.
setContext
This method sets the supplied context object associated with the command that
provided this result.
Syntax
public void setContext(java.lang.Object context)
Parameters
• context—the new context.
getSuccess
This method returns the status of the command completion, whether it is a success or a
failure.
Syntax
public java.lang.Boolean getSuccess()
Returns
• true—if the command succeeded.
• false—if the command failed.
setSuccess
This method sets the status of the command completion, whether it is a success or a
failure. It uses the true and false values to indicate the success status.
Syntax
public void setSuccess(java.lang.Boolean success)
Parameters
• success—the new value whether the command is a success or a failure.
Cash Tender Module Client Java API 4-99
setPosTransactionId
This method sets the POS transaction identifier that the POS provides. This identifier
must be set to perform CTM events.
Syntax
public void setPosTransactionId(java.lang.String posTransactionId)
Parameters
• posTransactionId—the transaction identifier that the POS provides.
setCtmTransactionId
This method sets the CTM transaction identifier. This CTM transaction ID is required to
perform CTM events.
Syntax
public void setCtmTransactionId(int ctmTransactionId)
Parameters
• ctmTransactionId—the transaction ID to use for performing cash management
transactions.
getPosTransactionId
This method returns the POS transaction ID.
Syntax
public java.lang.String getPosTransactionId()
Returns
This method returns the POS transaction identifier that was supplied as an argument to
beginTransaction.
getCtmTransactionId
This method returns the CTM transaction ID.
Syntax
public int getCtmTransactionId()
Returns
This method returns the sequence number that was returned by the last call to
beginTransaction or beginCashManagementTransaction.
Inherited Methods
The following are the methods that the CtmCommandResultInfo class inherited from the
java.lang.Object class:
• clone
• equals
• finalize
4-100 Cash Tender Module Client Java API
• getClass
• hashCode
• notify
• notifyAll
• toString
• wait
CtmConfigResultInfo
The CtmConfigResultInfo class obtains the results of the getConfig command.
Syntax
public final class CtmConfigResultInfo
extends java.lang.Object
CtmConfigResultInfo Constructor
The CtmConfigResultInfo class contains the CtmConfigResultInfo constructor.
Syntax
public CtmConfigResultInfo()
CtmConfigResultInfo Methods
The following methods are classified in the CtmConfigResultInfo class:
• getConfigData
• setConfigData
getConfigData
This method returns a series of key or value configuration strings for static
configuration values.
Syntax
public java.util.Map<java.lang.String,java.lang.String> getConfigData
()
Returns
This method returns configuration data as string key or value pairs.
setConfigData
This method sets the configuration data.
Syntax
public void setConfigData
(java.util.Map<java.lang.String,java.lang.String> configData)
Parameters
• configData—the new configuration data.
Cash Tender Module Client Java API 4-101
Inherited Methods
The following are the methods that the CtmConfigResultInfo class inherited from the
java.lang.Object class:
• clone
• equals
• finalize
• getClass
• hashCode
• notify
• notifyAll
• toString
• wait
CtmLongResultInfo
The CtmLongResultInfo class obtains the asynchronous result of a command that
returns a long value result.
Syntax
public class CtmLongResultInfo
extends CtmCommandResultInfo
CtmLongResultInfo Constructor
The CtmLongResultInfo class contains the CtmLongResultInfo constructor.
Syntax
public CtmLongResultInfo(CtmCommandTypes commandType)
Parameters
• commandType—specifies the type for this command.
CtmLongResultInfo Methods
The following methods are classified in the CtmLongResultInfo class:
• getLongResultInfo
• setLongResultInfo
getLongResultInfo
This method returns the result of the command.
Syntax
public long getLongResult()
4-102 Cash Tender Module Client Java API
Returns
This method returns the long result of the current command.
setLongResultInfo
This method sets the result of the command in long data type.
Syntax
public void setLongResult(long longResult)
Parameters
• longResult—the new long result.
Inherited Methods
The following are the methods that the CtmLongResultInfo class inherited from the
com.ncr.ssc.ctm.result.CtmCommandResultInfo class:
• getCommandType
• getContext
• getCtmTransactionId
• getPosTransactionId
• getSuccess
• setCommandType
• setContext
• setCtmTransactionId
• setPosTransactionId
• setSuccess
The following are the methods that the CtmLongResultInfo class inherited from the
java.lang.Object class:
• clone
• equals
• finalize
• getClass
• hashCode
• notify
• notifyAll
• toString
• wait
Cash Tender Module Client Java API 4-103
CtmCommandTypes Enum
The CtmCommandTypes enumeration provides the enumeration values for the CTM
command types. The following is the syntax for using this enumeration:
public enum CtmCommandTypes
extends java.lang.Enum<CtmCommandTypes>
CtmCommandTypes Constants
The following constants are classified in the CtmCommandTypes enumeration:
• CMD_DISPENSE_CHANGE
• CMD_DISPENSE_CASH
• CMD_TRANSFER_LOADER_TO_CASHBOX
• CMD_TRANSFER_TO_CASHBOX
• CMD_BEGIN_DEPOSIT
• CMD_END_DEPOSIT
• CMD_BEGIN_REFILL
• CMD_END_REFILL
CMD_DISPENSE_CHANGE
This constant is the CTM event used to dispense change.
Syntax
public static final CtmCommandTypes CMD_DISPENSE_CHANGE
CMD_DISPENSE_CASH
This constant is the CTM event used to dispense cash by denomination.
Syntax
public static final CtmCommandTypes CMD_DISPENSE_CASH
CMD_TRANSFER_LOADER_TO_CASHBOX
This constant is the CTM event used to transfer money from the loader device to the
cashbox.
Syntax
public static final CtmCommandTypes CMD_TRANSFER_LOADER_TO_CASHBOX
CMD_TRANSFER_TO_CASHBOX
This constant is the CTM event used to transfer money to the cashbox.
Syntax
public static final CtmCommandTypes CMD_TRANSFER_TO_CASHBOX
4-104 Cash Tender Module Client Java API
CMD_BEGIN_DEPOSIT
This constant is the CTM event used to enable the cash or coin acceptor devices to begin
deposit.
Syntax
public static final CtmCommandTypes CMD_BEGIN_DEPOSIT
CMD_END_DEPOSIT
This constant is the CTM event used to disable the cash or coin acceptors to end the
deposit.
Syntax
public static final CtmCommandTypes CMD_END_DEPOSIT
CMD_BEGIN_REFILL
This constant is the CTM event used to enable cash or coin acceptors to refill money in
the recyclers.
Syntax
public static final CtmCommandTypes CMD_BEGIN_REFILL
CMD_END_REFILL
This constant is the CTM event used to disable cash or coin acceptors to stop the refill
process.
Syntax
public static final CtmCommandTypes CMD_END_REFILL
CtmCommandTypes Methods
The following methods are classified in the CtmCommandTypes enumeration:
• values
• valueOf
values
This method returns an array containing the constants of the current enumeration type.
This method may be used to iterate over the constants as follows:
for (CtmCommandTypes c : CtmCommandTypes.values())System.out.println(c);
Syntax
public static CtmCommandTypes[] values()
Returns
This method returns the array that contains the constants of the current enumeration
type.
Cash Tender Module Client Java API 4-105
valueOf
This method returns the enumeration constant of this type with the specified name. The
string must match exactly an identifier used to declare an enumeration constant in this
type. Extraneous white space characters are not permitted.
Syntax
public static CtmCommandTypes valueOf(java.lang.String name)
Parameters
• name—the name of the enumeration constant to be returned.
Returns
This method returns the enumeration constant with the specified name.
Throws
• java.lang.IllegalArgumentException—if this enumeration type has no constant
with the specified name.
• java.lang.NullPointerException—if the argument is null.
4-106
Chapter 5: Cash Tender Module Client C API
Overview
This chapter describes the C API used by the Cash Tender Module (CTM) service to
perform the different Cash Tender operations. The different functions and data
structures of the C API are classified in the following modules:
• Client Initialization
• Device Errors and System Messages
• Device Events
• Transactions
• Cash Dispensing
• Cash Managements
• Cash Accepting
Each of these modules discusses the different functions, data structures, enumerations,
and type definitions (typedefs) that the CTM client uses to connect to the CTM service.
5-108 Cash Tender Module Client C API
Client Initialization
The Client Initialization module lists the functions and return codes necessary to
initialize the CTM API and connect it to the CTM service. It contains the following:
• Enumerations
• Functions
Enumerations
The Client Initialization module includes the CTMInitializationResult enumeration.
CTMInitializationResult
The CTMInitializationResult enumeration lists the possible return values for the
ctm_initialize() function. The following table describes the different enumerators of
the CTMInitializationResult enumeration:
Enumerator Description
CTM_INIT_SUCCESS Indicates that the CTM client has successfully con-
nected to the CTM service.
CTM_INIT_ERROR_RUNTIME Indicates that a standard C library call failed and pop-
ulated the error number of the errno.h file.
CTM_INIT_ERROR_INVALID_ Indicates that the CTM client could not parse the ser-
SERVICE_URL
vice URL parameter.
CTM_INIT_ERROR_COULD_NOT_ Indicates that the CTM client could not connect to the
CONNECT
CTM service.
CTM_INIT_ERROR_ALREADY_ Indicates that the CTM client is already initialized.
INITIALIZED
CTM_INIT_ERROR_REJECTED_ Indicates that the CTM service rejected the CTM cli-
BY_SERVICE
ent connection request.
CTM_INIT_ERROR_AT_LEAST_ Indicates that at least one device cannot be claimed.
ONE_DEVICE_NOT_READY
CTM_INIT_ERROR_MISSING_ Indicates that you must register a callback to the ctm_
SYSTEM_MESSAGE_EVENT_
add_system_message_event_handler() function.
HANDLER
CTM_INIT_ERROR_MISSING_ Indicates that you must register a callback to the ctm_
DEVICE_ERROR_EVENT_HANDLER
add_device_error_event_handler() function.
Cash Tender Module Client C API 5-109
Functions
The Client Initialization module includes the following functions:
• ctm_get_config()
• ctm_initialize()
• ctm_uninitialize()
ctm_get_config()
The ctm_get_config() function is used to obtain CTM configuration information.
Syntax
struct CTMGetConfigResult ctm_get_config()
Returns
This function returns a key value pair containing information on the CTM
configuration.
ctm_initialize()
The ctm_initialize() function is used to initialize the CTM client. When you use this
function, a blocking call attempts to connect to the CTM service at the specified URL. If
the CTM client is successfully initialized and the connection to the CTM service is
successful, the CTM client starts calling existing callbacks while the corresponding
events occur.
Syntax
enum CTMInitializationResult ctm_initialize(const char *
szServiceURL)
Parameters
• szServiceURL—the URL of the CTM service.
Example: ctm://localhost:3636
Returns
This function returns one of the values from the CTMInitializationResult
enumeration.
ctm_uninitialize()
The ctm_uninitialize() function is used to uninitialize the CTM client. This function
stops the connection between the CTM client and the CTM service.
Syntax
void ctm_uninitialize()
5-110 Cash Tender Module Client C API
Data Structures
The module for device errors and system messages include the following data
structures:
• CTMDeviceError
• CTMDeviceErrorSet
• CTMDeviceTestResult
• CTMDeviceErrorDetails
• CTMDeviceInfo
CTMDeviceError
The CTMDeviceError data structure lists the information on the cash device error.
The following table displays the data fields included in the CTMDeviceError data
structure:
CTMDeviceErrorSet
The CTMDeviceErrorSet data structure lists the information of a set of device errors.
The following table displays the data fields included in the CTMDeviceErrorSet data
structure:
CTMDeviceTestResult
The CTMDeviceTestResult data structure lists all the fields for the possible return
values of the following functions:
• ctm_test_device()
• ctm_test_all_devices()
The following table displays the data fields included in the CTMDeviceTestResult data
structure:
CTMDeviceErrorDetails
The CTMDeviceErrorDetails data structure lists all the fields that are used to resolve a
device error.
The following table displays the data fields included in the CTMDeviceErrorDetails
data structure:
CTMDeviceInfo
The CTMDeviceInfo data structure lists the fields used for the device information.
The following table displays the data fields included in the CTMDeviceInfo data
structure:
Typedef
The module for device errors and system messages includes the
CTMDeviceErrorCallback typedef.
CTMDeviceErrorCallback
The CTMDeviceErrorCallback typedef is the callback used for device error events.
Syntax
typedef void(* CTMDeviceErrorCallback)(struct CTMEventInfo, struct
CTMDeviceError)
Enumerations
The module for device errors and system messages includes the following enumerations:
• CTMDeviceTestError
• CTMDeviceType
• CTMErrorDetailsResult
Cash Tender Module Client C API 5-113
CTMDeviceTestError
The CTMDeviceTestError enumeration lists the possible return values of the following
functions:
• ctm_test_all_devices()
• ctm_test_device()
Enumerator Description
CTM_DEVICE_TEST_SUCCESS Indicates that the CTM service successfully tested
the devices.
CTM_DEVICE_TEST_ERROR_ Indicates that an invalid identifier was provided for
UNKNOWN_DEVICE_TYPE
a device test request.
CTM_DEVICE_TEST_ERROR_NOT_ Indicates that the CTM client is not connected to
CONNECTED
the CTM service.
CTMDeviceType
The CTMDeviceType enumeration lists the possible types of a CTM device.
The following table displays the enumerators of the CTMDeviceType enumeration:
Enumerator Description
CTM_DEVICETYPE_ Indicates that the device is a cash changer.
CASHCHANGER
CTM_DEVICETYPE_ Indicates that the device is a cash acceptor.
CASHACCEPTOR
CTM_DEVICETYPE_ Indicates that the device is a coin acceptor.
COINACCEPTOR
CTM_DEVICETYPE_ Indicates that the device is another type of device that is not a cash
OTHER
changer, a cash acceptor, or a coin acceptor.
5-114 Cash Tender Module Client C API
CTMErrorDetailsResult
The CTMErrorDetailsResult enumeration provides a list of possible return values for
the ctm_get_error_details() function.
The following table displays the enumerators of the CTMErrorDetailsResult
enumeration:
Enumerator Description
CTM_ERROR_DETAILS_SUCCESS Indicates that the CTM service successfully retrieved
the error details.
CTM_ERROR_DETAILS_UNKNOWN_ Indicates that an invalid identifier was provided for
DEVICE_TYPE
a device error details request.
CTM_ERROR_DETAILS_NOT_ Indicates that the CTM client is not initialized.
INITIALIZED
CTM_ERROR_DETAILS_ERROR_ Indicates that the CTM service returned a null
DETAILS_STRUCT_IS_NULL
pointer.
CTM_ERROR_DETAILS_ERROR_ Indicates that there is an error in the data contained
DETAILS_STRUCT_CONTAINS_
the data structure.
DATA
CTM_ERROR_DETAILS_ERROR_ Indicates that the data structure is invalid.
STRUCT_IS_INVALID
CTM_ERROR_DETAILS_NO_DATA_ Indicates that the CTM client did not receive any
RECEIVED
data.
CTM_ERROR_DETAILS_RUNTIME_ Indicates that a standard C library call failed and
ERROR
populated the error number of the errno.h file.
Functions
The module for device errors and system messages includes the following functions:
• ctm_add_device_error_event_handler()
• ctm_free_error_details()
• ctm_get_error_details()
• ctm_test_all_devices()
• ctm_test_device()
ctm_add_device_error_event_handler()
The ctm_add_device_error_event_handler() function is used to set an event handler
callback for the device error event.
Syntax
void ctm_add_device_error_event_handler(CTMDeviceErrorCallback)
Cash Tender Module Client C API 5-115
ctm_free_error_details()
The ctm_free_error_details() function is used to free the resources that the ctm_
get_error_details() function used.
Syntax
void ctm_free_error_details(struct CTMDeviceErrorDetails *
psErrDetails)
ctm_get_error_details()
The ctm_get_error_details() function is used to retrieve detailed textual information
for a device error event.
Syntax
enum CTMErrorDetailsResult ctm_get_error_details(const struct CTM
DeviceError sDeviceError, const char* szLocaleID, struct
CTMDeviceErrorDetails* psErrDetails)
Parameters
• sDeviceError—the device error that occurred.
Note: When a CashChanger device error event is received, a “BNR & BCR” device
model is provided. Please set “Any” as the device model on the psErrDetails
parameter.
Returns
This function returns the detailed textual information for the specified device error.
ctm_test_all_devices()
The ctm_test_all_devices() function is used to run a diagnostic on all CTM devices.
Syntax
struct CTMDeviceTestResult ctm_test_all_devices()
ctm_test_device()
The ctm_test_device() function is used to run a diagnostic on a specific device.
Syntax
struct CTMDeviceTestResult ctm_test_device(struct CTMDeviceInfo
sDeviceInfo)
Parameters
• sDeviceInfo—refers to the information of the device to test.
5-116 Cash Tender Module Client C API
Device Events
The Device Events module lists the data that the CTM API passes to the CTM callback
functions during asynchronous device events.
Data Structures
The Device Events module includes the following data structures:
• CTMEventInfo
• CTMAcceptEvent
CTMEventInfo
The CTMEventInfo data structure includes the field used to store the exact time when a
particular event occurred.
The following table displays the data fields included in the CTMEventInfo data
structure:
CTMAcceptEvent
The CTMAcceptEvent data structure lists all the fields used for cash accept events.
The following table displays the data fields included in the CTMAcceptEvent data
structure:
Transactions
The Transactions module lists the functions used to define transactions for reporting
purposes.
Any request that accepts, dispenses, or transfers cash must have a transaction associated
with it for reporting purposes. To do associate a transaction for cash requests, you must
create or assign a transaction ID through the ctm_begin_transaction() or ctm_begin_
cash_management_transaction() functions before performing the request. When a
customer or cash management transaction is finished, you must close the transaction by
calling the ctm_end_transaction() function.
This module contains the following:
• Data structures
• Enumerations
• Functions
Data Structures
The Transactions module includes the CTMBeginTransactionResult data structure.
CTMBeginTransactionResult
The CTMBeginTransactionResult data structure lists all the fields for the results of a
begin transaction event.
The following table displays the data fields included in the
CTMBeginTransactionResult data structure:
Enumerations
The Transactions module includes the following enumerations:
• CTMBeginTransactionError
• CTMEndTransactionResult
5-118 Cash Tender Module Client C API
CTMBeginTransactionError
The CTMBeginTransactionError enumeration lists the possible return values of the
following functions:
• ctm_begin_customer_transaction()
• ctm_begin_cash_management_transaction()
Enumerator Description
CTM_BEGIN_TRX_SUCCESS Indicates that the transaction has started.
CTM_BEGIN_TRX_ERROR_ Indicates that you must end the previous transaction first
ALREADY_IN_PROGRESS
before starting a new transaction.
CTM_BEGIN_TRX_ERROR_NOT_ Indicates that the CTM client is not connected to the
CONNECTED
CTM service.
CTMEndTransactionResult
The CTMEndTransactionResult enumeration lists the possible return values of the ctm_
end_transaction() function.
Enumerator Description
CTM_END_TRX_SUCCESS Indicates that the transaction has ended.
CTM_END_TRX_ERROR_NO_ Indicates that there is no transaction in pro-
TRANSACTION_IN_PROGRESS
gress.
CTM_END_TRX_ERROR_MUST_SUPPLY_ Indicates that you must provide a non–empty
TRANSACTION_ID
transaction ID string.
CTM_END_TRX_ERROR_NOT_CONNECTED Indicates that the CTM client is not connected
to the CTM service.
Functions
The Transactions module includes the following functions:
• ctm_begin_customer_transaction()
• ctm_begin_cash_management_transaction()
• ctm_end_transaction()
Cash Tender Module Client C API 5-119
ctm_begin_customer_transaction()
The ctm_begin_customer_transaction() function is used to start a new customer
transaction. The POS application must call this method at the beginning of each
customer transaction to reset any data that were accumulated during a prior transaction.
Syntax
struct CTMBeginTransactionResult ctm_begin_customer_transaction(const
char* szTransactionID)
Parameters
• szTransactionID—a unique identifier for the customer transaction.
ctm_begin_cash_management_transaction()
The ctm_begin_cash_management_transaction() function is used to start a new cash
management transaction. The POS application must call this method at the beginning of
each cash management loan or pickup operation.
Syntax
struct CTMBeginTransactionResult ctm_begin_cash_management_
transaction(char* szUserID, char* szCashierID, char* szTransactionID)
Parameters
• szUserID—a unique identifier for the attendant operating the application.
ctm_end_transaction()
The ctm_end_transaction() function is used to end a customer or cash management
transaction.
Syntax
enum CTMEndTransactionResult ctm_end_transaction(char*
szTransactionID)
Parameters
• szTransactionID—a unique identifier for the completed customer or cash
management transaction. The CTM API frees the string and assigns NULL to
szTransactionID if the CTM API had previously allocated the string through the
ctm_begin_cash_management_transaction() or ctm_begin_cash_management_
transaction() functions.
5-120 Cash Tender Module Client C API
Cash Dispensing
The Cash Dispensing module lists the functions used to dispense cash from the cash
devices and the data that the CTM service passes to the callback functions during the
handling of the cash dispensed events. This module contains the following:
• Enumerations
• Functions
Enumerations
The Cash Dispensing module includes the CTMDispenseCashError enumeration.
CTMDispenseCashError
The CTMDispenseCashError enumeration lists the possible return values of the
following functions:
• ctm_dispense_cash()
• ctm_dispense_cash_by_denomination()
Enumerator Description
CTM_DISPENSE_CASH_SUCCESS Indicates that the CTM service successfully
dispensed cash.
CTM_DISPENSE_CASH_ERROR_NEEDS_ Indicates that there is no transaction ID for
OPEN_TRANSACTION_ID
the transaction.
CTM_DISPENSE_CASH_ERROR_CANNOT_BE_ Indicates that the amount specified is a neg-
NEGATIVE
ative number.
CTM_DISPENSE_CASH_ERROR_INVALID_ Indicates that the denomination specified is
DENOMINATION
an invalid denomination
CTM_DISPENSE_CASH_ERROR_EXCEEDS_ Indicates that the amount specified exceeds
CONFIGURABLE_MAXIMUM
the maximum limit.
CTM_DISPENSE_CASH_ERROR_NOT_ Indicates that the CTM client is not con-
CONNECTED
nected to the CTM service.
Functions
The Cash Dispensing module includes the following functions:
• ctm_dispense_cash()
• ctm_dispense_cash_by_denomination()
Cash Tender Module Client C API 5-121
ctm_dispense_cash()
The ctm_dispense_cash() function is used to dispense cash from the cash devices.
Syntax
struct CTMDispenseCashResult ctm_dispense_cash(uint32_t
u32AmountToDispense)
Parameters
• u32AmountToDispose—refers to the amount to dispense.
ctm_dispense_cash_by_denomination()
The ctm_dispense_cash_by_denomination() function is used to dispense cash by
denomination.
Syntax
struct CTMDispenseCashResult ctm_dispense_cash_by_denomination(struct
CTMCashUnitSet stCashToDispense)
Parameters
• stCashToDispense—refers to the set of CashUnits that contains the counts of each
denomination to be dispensed.
5-122 Cash Tender Module Client C API
Cash Management
The Cash Management module lists the functions used to manage the notes and coins in
the cash devices. It also lists the data that the CTM service passes to the callback
functions during the handling of the cash transferred events. This module contains the
following:
• Enumerations
• Functions
Enumerations
The Cash Management module includes the following enumerations:
• CTMCashTransferLocation
• CTMGetCashCountsError
• SetCountsResult
• ResetCountsResult
• ResetCountsLocation
• CTMGetLoaderCassetteCountsError
• CTMGetPurgedStatusResult
• CTMClearPurgedStatusResult
• CTMTransferCashError
CTMCashTransferLocation
The CTMCashTransferLocation enumeration lists the locations used to report the result
of a cash transfer request.
The following table displays the enumerators of the CTMCashTransferLocation
enumeration:
Enumerator Description
CTM_CASH_TRANSFER_ Indicates that the cash transfer occurs in the loader
LOCATION_LOADER
cassette.
The loader cassette is the location where cash is stored
before being transferred to individual dispenser bins.
Cash Tender Module Client C API 5-123
Enumerator Description
CTM_CASH_TRANSFER_ Indicates that the cash transfer occurs in the cash box.
LOCATION_CASHBOX
The cash box is the location where bills that cannot be
transferred to an individual dispenser bin go. The cash–
handling personnel can remove bills from the dispenser
bins by transferring the bills from the dispenser bins to the
cash box and removing the cash box cassette from the Bank
Note Recycler (BNR) device.
CTM_CASH_TRANSFER_ Indicates that the cash transfer occurs at an individual
LOCATION_INDIVIDUAL_
dispenser bin.
BIN
Cash devices can dispense cash that are stored in the
dispenser bins
CTMGetCashCountsError
The CTMGetCashCountsError enumeration lists the possible return values of the
following functions:
• ctm_get_dispensable_cash_counts()
• ctm_get_non_dispensable_cash_counts()
Enumerator Description
CTM_GET_CASH_COUNTS_SUCCESS Indicates that the CTM service successfully got the
cash counts.
CTM_GET_CASH_COUNTS_DEVICE_ Indicates that the device is not present.
IN_ERROR
CTM_GET_CASH_COUNTS_NOT_ Indicates that the CTM client is not connected to the
CONNECTED
CTM service.
5-124 Cash Tender Module Client C API
SetCountsResult
The SetCountsResult enumeration lists the possible return values of the following
function:
• ctm_set_loader_cassette_counts()
• ctm_set_dispensable_counts()
Enumerator Description
CTM_SET_COUNTS_SUCCESS Indicates that the CTM service successfully set the
loader cassette and dispensable counts.
CTM_SET_COUNTS_NEEDS_OPEN_ Indicates that there is no transaction ID for the
CASH_MANAGEMENT_TRX_ID
begin cash management event.
CTM_SET_COUNTS_AMOUNT_ Indicates that the amount specified is a negative
CANNOT_BE_NEGATIVE
number.
CTM_SET_COUNTS_AMOUNT_ Indicates that the denomination specified is an
INVALID_DENOMINATION
invalid denomination
CTM_SET_COUNTS_AMOUNT_ Indicates that the amount specified exceeds the max-
EXCEEDS_CONFIGURABLE_MAX
imum limit.
CTM_SET_COUNTS_DEVICE_NOT_ Indicates that the device is not present.
PRESENT
CTM_SET_COUNTS_NOT_ Indicates that the CTM client is not connected to the
CONNECTED
CTM service.
ResetCountsResult
The ResetCountsResult enumeration lists the possible return values for the following
functions:
• ctm_reset_counts_dispensable_coins()
• ctm_reset_counts_non_dispensable_coins()
• ctm_reset_counts_non_dispensable_notes()
Enumerator Description
CTM_RESET_COUNTS_SUCCESS Indicates that the CTM service successfully reset the
device individual bin, cash box, or the coin overflow
bin.
Cash Tender Module Client C API 5-125
Enumerator Description
CTM_RESET_COUNTS_NEEDS_ Indicates that there is no transaction ID for the begin
OPEN_CASH_MANAGEMENT_TRX_
cash management event.
ID
CTM_RESET_COUNTS_DEVICE_ Indicates that the device is not present.
NOT_PRESENT
CTM_RESET_COUNTS_NOT_ Indicates that the CTM client is not connected to the
CONNECTED
CTM service.
ResetCountsLocation
The ResetCountsLocation enumeration lists the possible reset counts locations.
The following table displays the enumerators of the ResetCountsLocation
enumeration:
Enumerator Description
CTM_RESET_COUNTS_LOADER_ Indicates that the reset of the counts occurs in the
CASSETTE
loader cassette.
CTM_RESET_COUNTS_DISPENSABLE_ Indicates that the dispensable coin counts must be
COINS
reset.
CTM_RESET_COUNTS_NON_ Indicates that the non–dispensable coin counts
DISPENSABLE_COINS
must be reset.
CTM_RESET_COUNTS_NON_ Indicates that the non–dispensable note counts
DISPENSABLE_NOTES
must be reset.
CTMGetLoaderCassetteCountsError
The CTMGetLoaderCassetteCountsError enumeration lists the possible return values
of the ctm_get_loader_cassette_counts() function.
The following table displays the enumerators of the
CTMGetLoaderCassetteCountsError enumeration:
Enumerator Description
CTM_GETLOADERCOUNTS_SUCCESS Indicates that the CTM service successfully got
the loader cassette counts.
CTM_GETLOADERCOUNTS_NOT_ Indicates that the CTM client is not connected
CONNECTED
to the CTM service.
CTM_GETLOADERCOUNTS_NEEDS_OPEN_ Indicates that there is no transaction ID for the
CASH_MANAGEMENT_TRX_ID
begin cash management event.
CTM_GETLOADERCOUNTS_DEVICE_NOT_ Indicates that the device is not present.
PRESENT
5-126 Cash Tender Module Client C API
CTMGetPurgedStatusResult
The CTMGetPurgedStatusResult enumeration lists the possible return values of the
ctm_get_purged_status() function.
Enumerator Description
CTM_GET_PURGED_STATUS_PURGE_BIN_ Indicates that the CTM service detected
CONTAINS_NOTES
purged bills.
CTM_GET_PURGED_STATUS_PURGE_BIN_ Indicates that the CTM service did not
DOESNT_CONTAINS_NOTES
detect any purged bills.
CTM_GET_PURGED_STATUS_NOT_CONNECTED Indicates that the CTM client is not con-
nected to the CTM service.
CTMClearPurgedStatusResult
The CTMClearPurgedStatusResult enumeration lists the possible return values of the
ctm_clear_purged_status() function.
Enumerator Description
CTM_CLEAR_PURGED_STATUS_ Indicates that the CTM service cleared purged
SUCCESS
bills.
CTM_CLEAR_PURGED_STATUS_ Indicates that the CTM service was not able to
ERROR_RUNTIME
clear purged bills.
CTM_CLEAR_PURGED_STATUS_NOT_ Indicates that the CTM client is not connected to
CONNECTED
the CTM service.
Cash Tender Module Client C API 5-127
CTMTransferCashError
The CTMTransferCashError enumeration lists the possible return values of the
following functions:
• ctm_transfer_from_bin_to_cashbox()
• ctm_transfer_all_from_loader_to_cashbox()
Enumerator Description
CTM_TRANSFER_SUCCESS Indicates that the CTM service successfully trans-
ferred cash.
CTM_TRANSFER_NEEDS_OPEN_CASH_ Indicates that there is no transaction ID for the
MANAGEMENT_TRX_ID
begin cash management event.
CTM_TRANSFER_AMOUNT_CANNOT_ Indicates that the amount specified is a negative
BE_NEGATIVE
number.
CTM_TRANSFER_AMOUNT_INVALID_ Indicates that the denomination specified is an
DENOMINATION
invalid denomination.
CTM_TRANSFER_AMOUNT_EXCEEDS_ Indicates that the amount specified exceeds the
CONFIGURABLE_MAX
maximum limit.
CTM_TRANSFER_NOT_CONNECTED Indicates that the CTM client is not connected to
the CTM service.
Functions
The Cash Management module includes the following functions:
• ctm_get_purged_status()
• ctm_clear_purged_status()
• ctm_get_loader_cassette_capacity()
• ctm_get_non_dispensable_coin_capacity()
• ctm_get_non_dispensable_note_capacity()
• ctm_get_dispensable_capacities()
• ctm_get_non_dispensable_cash_counts()
• ctm_get_dispensable_cash_counts()
• ctm_transfer_from_bin_to_cashbox()
• ctm_transfer_all_from_loader_to_cashbox()
• ctm_set_loader_cassette_counts()
5-128 Cash Tender Module Client C API
• ctm_get_loader_cassette_counts()
• ctm_set_dispensable_counts()
• ctm_reset_counts_dispensable_coins()
• ctm_reset_counts_non_dispensable_coins()
• ctm_reset_counts_non_dispensable_notes()
ctm_get_purged_status()
The ctm_get_purged_status() function determines whether any dispensable notes
have been sent to the purged bin. You may also call this function to determine whether
a defective note is placed in a loader cassette and the validator cannot read it.
Syntax
enum CTMGetPurgedStatusResult ctm_get_purged_status()
Returns
This function returns one of the values from the CTMGetPurgedStatusResult
enumeration.
ctm_clear_purged_status()
The ctm_clear_purged_status() function clears the purge status.
Syntax
enum CTMClearPurgedStatusResult ctm_clear_purged_status()
Returns
This function returns one of the values from the CTMClearPurgedStatusResult
enumeration.
ctm_get_loader_cassette_capacity()
The ctm_get_loader_cassette_capacity() function obtains the estimated maximum
number of notes that the loader cassette can contain.
Syntax
struct CTMGetCapacitiesResult ctm_get_loader_cassette_capacity()
Returns
This function returns the maximum loader cassette capacity or zero (0) if the device
does not have a loader cassette.
ctm_get_non_dispensable_coin_capacity()
The ctm_get_non_dispensable_coin_capacity() function obtains the non–
dispensable storage capacity for the coin device.
Syntax
struct CTMGetCapacitiesResult ctm_get_non_dispensable_coin_capacity()
Cash Tender Module Client C API 5-129
Returns
This function returns the maximum coin storage count.
ctm_get_non_dispensable_note_capacity()
The ctm_get_non_dispensable_note_capacity() function obtains the non–
dispensable storage capacity for the note device.
Syntax
struct CTMGetCapacitiesResult ctm_get_non_dispensable_note_capacity()
Returns
This function returns the maximum note storage count.
ctm_get_dispensable_capacities()
The ctm_get_dispensable_capacities() function obtains the storage capacity of each
dispensable denomination.
Syntax
struct CTMGetCapacitiesResult ctm_get_dispensable_capacities()
Returns
This function returns a set of CashUnit where the counts indicate the capacity of each
denomination.
ctm_get_dispensable_cash_counts()
The ctm_get_dispensable_cash_counts() function returns the number of each
denomination that the CTM can dispense as a change. This count does not include the
notes that are in the loader cassette.
Syntax
struct CTMGetCashCountsResult ctm_get_dispensable_cash_counts()
Returns
This function returns a set of CashUnit objects sorted from the lowest coin to the
highest note denomination.
ctm_get_non_dispensable_cash_counts()
The ctm_get_non_dispensable_cash_counts() function returns the number of each
denomination that the CTM cannot dispense as a change.
Syntax
struct CTMGetCashCountsResult ctm_get_non_dispensable_cash_counts()
Returns
This method returns a set of CashUnit objects sorted from the lowest coin to the highest
note denomination.
5-130 Cash Tender Module Client C API
ctm_transfer_from_bin_to_cashbox()
The ctm_transfer_from_bin_to_cashbox() function transfers a specified number of
notes from the recyclers to the cash box if supported by the device configuration. If a
note recycler is not present in the device, nothing happens when you call this function.
Syntax
struct CTMTransferFromBinToCashboxResult ctm_transfer_from_bin_to_
cashbox(struct CTMCashUnitSet stCashToTransfer)
Parameters
• stCashToTransfer—set of CashUnits that contains the counts of each
denomination to be transferred.
Returns
This function returns one of the values from the CTMTransferCashError enumeration.
ctm_transfer_all_from_loader_to_cashbox()
The ctm_transfer_all_from_loader_to_cashbox() function transfers all cash from
the loader cassette directly to the cashbox.
Syntax
struct CTMTransferAllFromLoaderToCashboxResult ctm_transfer_all_from_
loader_to_cashbox()
Returns
This function returns one of the values from the CTMTransferCashError enumeration.
ctm_set_loader_cassette_counts()
The ctm_set_loader_cassette_counts() function sets the logical note counts of the
note loader cassette. If a loader cassette is not present in the device, nothing happens
when you call this function.
Syntax
enum SetCountsResult ctm_set_loader_cassette_counts(struct
CTMCashUnitSet stCashToSet)
Parameters
• stCashToSet—set of CashUnits that contains the counts of each denomination to
set.
Returns
This function returns true if the loader cassette count is successfully set, and false on
failure.
Cash Tender Module Client C API 5-131
ctm_get_loader_cassette_counts()
The ctm_get_loader_cassette_counts() returns the number of each note
denomination in the loader cassette.
Syntax
struct CTMGetLoaderCassetteCountsResult ctm_get_loader_cassette_
counts()
Returns
This method returns a set of CashUnit objects sorted from the lowest coin to the highest
note denomination.
ctm_set_dispensable_counts()
The ctm_set_dispensable_counts() function sets the logical cash counts of recyclers
or dispensers in the BCR device. Setting dispensable counts is not applicable to the BNR
device or to cash devices that do not allow resetting of dispensable counts.
Syntax
enum SetCountsResult ctm_set_dispensable_counts(struct CTMCashUnitSet
stCashToSet)
Parameters
• stCashToSet— set of CashUnits that contains the counts of each denomination to
set.
Returns
This function returns one of the values from the SetCountsResult enumeration.
ctm_reset_counts_dispensable_coins()
The ctm_reset_counts_dispensable_coins() function is used to empty the coin
dispenser or recycler containers. This method does nothing for cash devices that do not
permit resetting of dispensable counts.
Syntax
enum ResetCountsResult ctm_reset_counts_dispensable_coins()
Returns
This function returns true if the dispensable coin count was successfully reset, and
false on failure.
ctm_reset_counts_non_dispensable_coins()
The ctm_reset_counts_non_dispensable_coins() function is used to empty the
non–dispensable containers (coin overflow bin) of the Bulk Coin Recycler (BCR) device.
Syntax
enum ResetCountsResult ctm_reset_counts_non_dispensable_coins()
5-132 Cash Tender Module Client C API
Returns
This function returns true if the non–dispensable coin count was successfully reset, and
false on failure.
ctm_reset_counts_non_dispensable_notes()
The ctm_reset_counts_non_dispensable_notes() function is used to empty the
non–dispensable containers (cash box) of the BNR device.
Syntax
enum ResetCountsResult ctm_reset_counts_non_dispensable_notes()
Returns
This function returns true if the non–dispensable note count was successfully reset, and
false on failure.
Cash Tender Module Client C API 5-133
Cash Accepting
The Cash Accepting module lists the functions that are used to accept cash from the
cash devices and the data that the CTM service passes to the callback functions during
the handling of cash accept events.
This module contains the following:
• Typedefs
• Enumerations
• Functions
Typedefs
The Cash Accepting module includes the following typedefs:
• CTMCashAcceptCallback
• CTMCashAcceptCompleteCallback
CTMCashAcceptCallback
The CTMCashAcceptCallback typedef is the callback for cash deposit events.
Syntax
typedef void(* CTMCashAcceptCallback)(const struct CTMEventInfo,
const struct CTMAcceptEvent)
CTMCashAcceptCompleteCallback
The CTMCashAcceptCompleteCallback typedef is the callback used on events where the
deposited amount is enough or more than the expected amount.
Syntax
typedef void(* CTMCashAcceptCompleteCallback)(const struct
CTMEventInfo)
Enumerations
The Cash Accepting module includes the following enumerations:
• CTMAcceptCashRequestResult
• CTMStopAcceptingCashResult
5-134 Cash Tender Module Client C API
CTMAcceptCashRequestResult
The CTMAcceptCashRequestResult enumeration lists the possible return values of the
following functions:
• ctm_begin_refill()
• ctm_accept_cash()
Enumerator Description
CTM_ACCEPT_CASH_SUCCESS Indicates that the CTM service has successfully per-
formed the cash accept event.
CTM_ACCEPT_CASH_ERROR_ Indicates that you must provide an open transaction
NEEDS_OPEN_TRANSACTION_ID
ID to complete the current request.
CTM_ACCEPT_CASH_ERROR_ Indicates that you must end the previous cash accept
ALREADY_IN_PROGRESS
event first before starting a new one.
CTM_ACCEPT_CASH_ERROR_NOT_ Indicates that the CTM client is not connected to the
CONNECTED
CTM service.
CTMStopAcceptingCashResult
The CTMStopAcceptingCashResult enumeration lists the possible return values of the
ctm_stop_accepting_cash() function.
Enumerator Description
CTM_STOP_ACCEPTING_CASH_SUCCESS Indicates that the CTM service successfully
stopped the cash accepting event.
CTM_STOP_ACCEPTING_CASH_ERROR_ Indicates that there is no deposit in progress.
NO_DEPOSIT_IN_PROGRESS
CTM_STOP_ACCEPTING_CASH_ERROR_ Indicates that the CTM client is not connected
NOT_CONNECTED
to the CTM service.
Functions
The Cash Accepting module includes the following functions:
• ctm_add_cash_accept_event_handler()
• ctm_add_cash_accept_complete_event_handler()
• ctm_accept_cash()
Cash Tender Module Client C API 5-135
• ctm_begin_refill()
• ctm_stop_accepting_cash()
ctm_add_cash_accept_event_handler()
The ctm_add_cash_accept_event_handler() function is used to provide an event
handler callback to CTM when the cash accept event is ongoing.
Syntax
void ctm_add_cash_accept_event_handler(CTMCashAcceptCallback)
ctm_add_cash_accept_complete_event_handler()
The ctm_add_cash_accept_complete_event_handler() function is used to provide an
event handler callback to CTM when the cash accept event is complete.
Syntax
void ctm_add_cash_accept_complete_event_handler
(CTMCashAcceptCompleteCallback)
ctm_accept_cash()
The ctm_accept_cash() function is used to accept cash from cash accept devices
during a transaction.
Syntax
enum CTMAcceptCashRequestResult ctm_accept_cash(uint32_t
u32AmountToAccept)
Parameters
• u32AmountToAccept—refers to the amount of cash to accept in a transaction. After
this amount is deposited, the CTM service will automatically disable coin and note
acceptance. If the amount is not deposited or is set to zero, acceptance is enabled
until ctm_stop_accepting_cash() is called.
Returns
This function returns one of the values from the CTMAcceptCashRequestResult
enumeration.
ctm_begin_refill()
The ctm_begin_refill() function is used to replenish coins and notes through the
acceptors. This method does nothing for devices that do not support this capability.
Syntax
enum CTMAcceptCashRequestResult ctm_begin_refill()
Returns
This function returns one of the values from the CTMAcceptCashRequestResult
enumeration.
5-136 Cash Tender Module Client C API
ctm_stop_accepting_cash()
The ctm_stop_accepting_cash() function is used to disable coin and note acceptance.
Note: Deposit events may continue to arrive after the ctm_stop_accepting_cash()
function is called if the cash accept devices are handling deposited currency when the
endDeposit request is issued.
Syntax
enum CTMStopAcceptingCashResult ctm_stop_accepting_cash()
Returns
This function returns one of the values from the CTMStopAcceptingCashResult
enumeration.
Appendix A: Installing Third–party Software
Overview
This appendix discusses the guide to installing the following third–party applications
used in the functionality of the Cash Tender Module (CTM) system:
• Java™ Runtime Environment (JRE)
A-2 Installing Third-party Software
Name Version
MinGW Port of the GNU Compiler Collection (GCC) 4.6.1–2
Runtime Libraries
POSIX Threads for Win32 2.9
Google Protocol Buffers 2.4.1
Apache log4cxx 0.10.0
Apache Portable Runtime (APR)
APR–util 1.4.6
1.4.1
AOP alliance 1.0
Apache Ant Core 1.8.2
Apache Ant Launcher 1.8.2
Apache Velocity 1.5
args4j 2.0.8
ASM Analysis 3.2
ASM Commons 3.3.1
ASM Core 3.3.1
ASM Tree 3.3.1
ASM Util 3.2
Build Helper Maven Plugin 1.7
B-4 Open Source Software
Name Version
Classworlds 1.1
CLI 1.0
Code Generation Library 2.2.2
com4j runtime 20110320
com4j type library importer 20110320
Commons Collections 3.2.1
Commons IO 1.3.2
Commons Lang 2.6
Commons Logging 1.1.1
commons–beanutils 1.7.0
commons–digester 1.6
Default Plexus Container 1.0–alpha–9–stable–1
Doxia :: APT Module 1.0
Doxia :: Core 1.0
Doxia :: FML Module 1.0
Doxia :: Sink API 1.0
Doxia :: XDoc Module 1.0
Doxia :: XHTML Module 1.0
Doxia Sitetools :: Decoration Model 1.0
Doxia Sitetools :: Site Renderer Component 1.0
HttpClient 2.0.2
jdependency 0.7
jdom 1.0
JDOM 1.1
JSch 0.1.27
JTidy 4aug2000r7–dev
JUnit 3.8.1
Licensing Maven Mojo 1.7
Maven AntRun Plugin 1.7
Open Source Software B-5
Name Version
Maven Archiver 2.5
Maven Artifact 2.0.6
Maven Artifact 2.0.9
Maven Artifact Manager 2.0.9
Maven Assembly Plugin 2.3
Maven Common Artifact Filters 1.2
Maven Core 2.0.9
Maven Dependency Analyzer 1.2
Maven Dependency Plugin 2.4
Maven Dependency Tree 1.1
Maven Dependency Tree 1.2
Maven Doxia Integration Tools 1.0.2
Maven Error Diagnostics 2.0.9
Maven File Management API 1.2.1
Maven Filtering 1.0
Maven Invoker 2.0.11
Maven Local Settings Model 2.0.6
Maven Local Settings Model 2.0.9
Maven Model 2.0.6
Maven Model 2.0.9
Maven Monitor 2.0.9
Maven Plugin API 2.0.6
Maven Plugin API 2.0.9
Maven Plugin Descriptor Model 2.0.9
Maven Plugin Parameter Documenter API 2.0.9
Maven Plugin Registry Model 2.0.6
Maven Plugin Registry Model 2.0.9
Maven Plugin Testing Mechanism 1.1
Maven Profile Model 2.0.6
B-6 Open Source Software
Name Version
Maven Profile Model 2.0.9
Maven Project Builder 2.0.6
Maven Project Builder 2.0.9
Maven Reporting API 3.0
Maven Reporting Implementation 2.0.5
Maven Repository Builder 1.0–alpha–2
Maven Repository Metadata Model 2.0.9
Maven Shade Plugin 1.6
Maven Shared I/O API 1.1
Maven Wagon API 1.0–beta–2
Maven Wagon File Provider 1.0–beta–2
Maven Wagon HTTP Shared Library 1.0–beta–2
Maven Wagon Lightweight HTTP Provider 1.0–beta–2
Maven Wagon SSH Common Library 1.0–beta–2
Maven Wagon SSH External Provider 1.0–beta–2
Maven Wagon SSH Provider 1.0–beta–2
Maven Wagon WebDav Provider 1.0–beta–2
MXP1: Xml Pull Parser 3rd Edition (XPP3) 1.1.4c
oro 2.0.8
Plexus :: Component Annotations 1.5.5
Plexus Archiver Component 2.0
Plexus Common Utilities 1.5.5
Plexus Common Utilities 3.0
Plexus Default Interactivity Handler 1.0–alpha–4
Plexus I18N Component 1.0–beta–7
Plexus Interpolation API 1.15
Plexus IO Components 2.0.1
Plexus Resource Component 1.0–alpha–7
Plexus Velocity Component 1.1.7
Open Source Software B-7
Name Version
plexus–build–api 0.0.4
protobuf–java–format 1.2
Protocol Buffer Java API 2.4.1
SLF4J API Module 1.5.6
SLF4J Simple Binding 1.5.6
slide–webdavlib 2.1
Spring Integration Core 2.1.0
spring–aop 3.0.7
spring–aop 3.1.1
spring–asm 3.1.1
spring–beans 3.1.1
spring–context 3.1.1
spring–core 3.1.1
spring–expression 3.1.1
Validator 1.2.0
XML Commons External Components XML APIs 1.0.b2
XML Im–/Exporter 1.1
XML Pull Parsing API 1.1.3.1
XStream Core 1.4.2
B-8 Open Source Software
Appendix C: Installer and Uninstaller Return Codes List
Error Return
Description Note
Code Value
Success 0 The action completed suc- Applicable for both the installation and unin-
cessfully. stallation process.
Install_ 1602 The user canceled the installation Applicable for both the installation and unin-
UserExit or the installation terminated stallation process.
unexpectedly.
Install_ 1603 A fatal error occurred during Non–admin user (Applicable for both the installation
Failure installation. and uninstallation process.)
Unknown 1605 This action is valid only for Applicable for uninstalling already uninstalled
Product products that are currently products or products that are not yet installed.
installed.
Product 1638 Another version of this product is Applicable for installing another version of a
Version already installed. Installation of product that is already installed. For example,
this version cannot continue. installing version 13 without uninstalling version 12.