Terminal Management
Update terminal
financeInit
Method
The update operation checks for available software or configuration update for the payment terminal and initiates a download if needed.
Code example
//financeInit
//Initializes the card reader and updates config.
-(IBAction)updateCardReader
{
[heftClient financeInit];
}
Events invoked
Invoked during a transaction with different statuses from the payment terminal.
Invoked when an error response happens.
Invoked when the payment terminal finishes processing the transaction.
Returns
Parameter | Notes |
---|---|
Boolean | This method always returns YES |
Shared Manager
sharedManager
Method
Provides access to the heftManager. The heft manager is used for discovering devices and creating a HeftClient with a connection to selected payment terminals.
Code example
//SharedManager
//Provides access to the heftManager
//Create an instance of the shared manager at set it's delegate
HeftManager* heftManager = [HeftManager sharedManager];
heftManager.delegate = self;
Returns
Parameter | Notes |
---|---|
HeftManager | The heftManager instance |
Client for device (NSString)
clientForDevice
Method
Creates a HeftClient object. If a connection is successful, the HeftClient object is returned in the didConnect event. All transactions are done using the heftClient.
Parameters
Parameter | Notes |
---|---|
device Required NSInteger | The payment terminal to connect to. |
sharedSecret Required NSString | Shared secret only known by the merchant and Handpoint. |
aDelegate Required BOOL | The HeftStatusReportDelegate for the HeftClient to report to. |
Code example
//clientForDevice:sharedSecretString:delegate:
//Creates a HeftClient object(connection to device)
NSString* sharedSecret = @"0102030405060708091011121314151617181920212223242526272829303132";
-(void)connectToFirstCardReaderWith:(NSString*)sharedSecret;
{
//Try to connect to the first payment terminal in the array
[heftManager clientForDevice:[[heftManager devicesCopy] objectAtIndex:0] sharedSecretString:sharedSecret delegate:self];
//Client calls the didConnect delegate function if successful
}
Events invoked
Called when a connection to specified device was created.
Returns
Parameter | Notes |
---|---|
Boolean | YES if operation starts successfully |
Start Discovery
startDiscovery
Method
Displays a list of available accessory devices in a modal window.
Code example
//startDiscovery
//Starts the BT discovery process
-(void)startDiscovery;
{
[heftManager startDiscovery];
//Start search activity indicator or other desired functions
}
Set log level
logSetLevel
Method
Sets the log level of the payment terminal. There are four levels of logging: none, info, full, debug. Setting the log level means that relevant information concerning the application operation will be stored.
Parameters
Parameter | Notes |
---|---|
level Required eLogLevel | eLogLevel available types: eLogNone, eLogInfo, eLogFull, eLogDebug |
Code example
//logSetLevel:
//Sets the log level of the card reader.
-(void)disableCardReaderLogs
{
[heftClient logSetLevel:eLogNone];
}
-(void)enableCardReaderDebugLogs
{
[heftClient logSetLevel:eLogDebug];
}
Returns
Parameter | Notes |
---|---|
Boolean | This method always returns YES |
Fetch logs
logGetInfo
Method
Retrieves the logging info. Returns them in the responseLogInfo event.
Code example
//logGetInfo
//Retrieves the logging info.
-(void)getLogsFromCardReader
{
[heftClient logGetInfo];
}
Returns
Parameter | Notes |
---|---|
Boolean | This method always returns YES |
Reset logs
logReset
Method
Clears the logging information stored so far.
Code example
//logReset
//Clears the logging information stored so far
-(void)clearLogs
{
[heftClient logReset];
}
Returns
Parameter | Notes |
---|---|
Boolean | This method always returns YES |
Enable scanner
enableScanner
Method
Switches the payment terminal in scan mode. Only if the card reader supports it. To cancel/stop scan mode, call the cancel method of the heft client.
Parameters
Parameter | Notes |
---|---|
multiScan Boolean | Yes [default] to activate multiScan mode. No to activate singleScan mode. Multi-scan mode allows the user to scan until the scan operation is canceled, or a timeout occurs, single-scan mode is active until one scan has occurred then it disables the scan mode. |
buttonMode Boolean | Yes [default] if buttonMode is on. No otherwise. If button mode is on then the operator needs to press the scan button to activate the scanner (during scan mode). |
timeoutSeconds NSInteger | 0 [default] - The payment terminal will determine when scanning should time out. x - the scanner will time out if x seconds of inactivity occur. |
Code example
//enableScanner:multiScan:buttonMode:timeoutSeconds
//Places the card reader in a scan only mode.
//To cancel/stop scan mode call cancel function.
-(IBAction)startScan
{
[heftClient enableScanner];
}
-(IBAction)startMultiScan
{
[heftClient enableScannerWithMultiScan:YES];
}
Events invoked
Called to inform that a scan has been performed, several calls can be expected. The info object contains scanCode, status and a dictionary (xml).
Disable scanner
disableScanner
Method
Disables the scanner, if possible.
Code example
//disableScanner
//Disable the scanner
-(IBAction)disableScanner
{
[heftClient disableScanner];
}
Events invoked
Called to inform that a scan has been performed, several calls can be expected. The info object contains scanCode, status and a dictionary (xml).
Get SDK version
getSDKVersion
Method
Returns the current SDK version as a string.
Code example
//getSDKVersion
//Log SDK version number
NSLOG(@"SDK version: %@", [heftManager getSDKVersion];
Get SDK build number
getSDKBuildNumber
Method
Returns the current SDK build as a string.
Code example
//getSDKBuildNumber
//Log SDK build number
NSLOG(@"SDK build: %@", [heftManager getSDKBuildNumber];