Skip to main content

iOS HiLite — Objects Reference

This page is the authoritative reference for every class, protocol, delegate method, and enum in the Handpoint iOS HiLite SDK. For the step-by-step integration walkthrough, see the iOS HiLite Integration Guide.

Threading

All delegate callbacks (responseFinanceStatus:, responseStatus:, didConnect:, etc.) are delivered on a background thread. Always dispatch to the main queue before touching UIKit or any UI state:

dispatch_async(dispatch_get_main_queue(), ^{
self.statusLabel.text = info.status;
});
DispatchQueue.main.async {
self.statusLabel.text = info.status
}

Core SDK classes​

HeftManager​

The SDK entry point. Obtain the singleton instance with sharedManager. Set its delegate to receive discovery events, then call startDiscovery to find Bluetooth readers.

HeftManager *manager = [HeftManager sharedManager];
manager.delegate = self;
[manager startDiscovery];

Properties:

PropertyTypeNotes
connectedCardReadersNSArrayAll discovered terminals
delegateid<HeftDiscoveryDelegate>Receives discovery and connection callbacks
versionNSStringCurrent SDK version string

Methods:

MethodReturnsNotes
+ sharedManagerHeftManager *Returns the singleton — call once and store the reference
- startDiscoveryvoidStarts Bluetooth scan; fires didFindAccessoryDevice: per device found, then didDiscoverFinished
- clientForDevice:sharedSecret:delegate:voidCreates a HeftClient connection; fires didConnect: on success
- resetDevicesvoidClears the discovered device list

clientForDevice:sharedSecret:delegate: parameters:

ParameterTypeRequiredNotes
deviceHeftRemoteDevice *YesDevice from connectedCardReaders or discovery
sharedSecretNSString *Yes64-character hex string — provided by Handpoint Integration Support
delegateNSObject<HeftStatusReportDelegate> *YesObject to receive all transaction and connection callbacks

For Lightning (HiPro) readers, skip discovery and call clientForDevice:… directly using the device already present in connectedCardReaders.


HeftClient​

The transaction interface. Obtained via didConnect: — do not call any financial operation before this callback fires. All transaction methods return BOOL (YES if accepted and sent to the terminal; the actual result arrives asynchronously via responseFinanceStatus:).

Properties:

PropertyTypeNotes
sharedSecretNSStringShared secret used to authenticate this session
mpedInfoNSDictionaryTerminal details (serial number, firmware, etc.)
isTransactionResultPendingBOOLYES if a previous transaction result is waiting for recovery — check this in didConnect:

mpedInfo dictionary keys:

Key constantValue
kSerialNumberInfoKeyTerminal serial number
kPublicKeyVersionInfoKeyPublic key version
kEMVParamVersionInfoKeyEMV parameters version
kAppNameInfoKeyTerminal application name
kAppVersionInfoKeyTerminal application version
kManufacturerCodeInfoKeyHardware manufacturer
kModelCodeInfoKeyHardware model
kGeneralParamInfoKeyGeneral parameter version
kXMLDetailsInfoKeyFull XML details string

Financial methods:

MethodParametersReturnsNotes
saleWithAmount:currency:cardholder:amount (NSInteger), currency (NSString), cardholder (BOOL)BOOLBasic sale
saleWithAmount:currency:cardholder:options:+ options (SaleOptions)BOOLSale with options
saleAndTokenizeWithAmount:currency:amount, currencyBOOLSale + tokenize card simultaneously
saleAndTokenizeWithAmount:currency:options:+ options (SaleOptions)BOOLSale + tokenize with options
saleReversalWithAmount:currency:transactionId:options:amount, currency, transactionId (NSString), options (Options)BOOLVoid a previous sale — same day only
refundWithAmount:currency:transaction:amount, currency, transaction (NSString)BOOLLinked refund
refundWithAmount:currency:transaction:options:+ options (MerchantAuthOptions)BOOLLinked refund with options
refundReversalWithAmount:currency:transactionId:options:amount, currency, transactionId, options (Options)BOOLVoid a previous refund — same day only
tokenizeCard—BOOLTokenize card without payment
acceptSignature:flag (BOOL)voidRespond to requestSignature: — YES to accept, NO to reject
retrievePendingTransaction—BOOLFetch pending result after Bluetooth reconnect
cancel—voidCancel the current in-progress transaction
financeStartOfDay—BOOLStart of day batch operation
financeEndOfDay—BOOLEnd of day batch operation / settlement
financeInit—BOOLCheck and download terminal software/config updates

Device management methods:

MethodParametersReturnsNotes
logSetLevel:level (eLogLevel)BOOLSet log verbosity on terminal
logGetInfo—BOOLFetch terminal logs; result via responseLogInfo:
logReset—BOOLClear terminal logs
getEMVConfiguration—BOOLRetrieve EMV configuration from terminal

Scanner methods:

HiPro hardware only

The following methods require a HiPro (Lightning/barcode-equipped) terminal. They are not available on Bluetooth HiLite readers.

MethodParametersReturnsNotes
enableScanner—BOOLEnable barcode scanner with default settings
enableScannerWithMultiScan:multiScan (BOOL)BOOLYES allows multiple consecutive scans; NO disables after the first scan
enableScannerWithMultiScan:buttonMode:multiScan (BOOL), buttonMode (BOOL)BOOLbuttonMode:YES requires operator to press the scan button; NO turns the scanner on immediately
enableScannerWithMultiScan:buttonMode:timeoutSeconds:multiScan, buttonMode, timeoutSeconds (NSInteger)BOOLtimeoutSeconds:0 lets the terminal determine the inactivity timeout
disableScanner—voidDisable barcode scanner and exit scan mode

Log level values (eLogLevel):

ValueLevel
eLogNoneNo logging
eLogErrorError messages only
eLogInfoInformational only
eLogFullFull logging — recommended during integration and validation
eLogDebugDebug output

HeftRemoteDevice​

Returned during Bluetooth discovery and passed to clientForDevice:….

PropertyTypeNotes
nameNSStringBluetooth display name of the reader
addressNSStringBluetooth MAC address — use for logging and device identification
accessoryEAAccessoryUnderlying EAAccessory object (Lightning / HiPro connections only)

Protocols (delegates)​

HeftDiscoveryDelegate​

Set on HeftManager.delegate. Receives Bluetooth discovery events and the initial connection callback.

didFindAccessoryDevice:​

- (void)didFindAccessoryDevice:(HeftRemoteDevice *)newDevice;

Fires once for each Bluetooth terminal found during a startDiscovery scan. newDevice.name and newDevice.address identify the device. Populate a picker or auto-connect if the address matches a previously paired reader.

didDiscoverFinished​

- (void)didDiscoverFinished;

Fires when the Bluetooth discovery scan completes. All found devices are now in manager.connectedCardReaders. This is the typical place to call clientForDevice:sharedSecret:delegate:.

- (void)didDiscoverFinished {
HeftRemoteDevice *device = [self.manager.connectedCardReaders firstObject];
if (device) {
[self.manager clientForDevice:device sharedSecret:@"<sharedSecret>" delegate:self];
}
}

didLostAccessoryDevice:​

- (void)didLostAccessoryDevice:(HeftRemoteDevice *)oldDevice;

Fires when a previously discovered Bluetooth reader goes out of range or disconnects. Re-run startDiscovery if reconnection is needed.


HeftStatusReportDelegate​

Set via clientForDevice:…:delegate:. Receives all transaction lifecycle events and the post-connection callback.

didConnect:​

- (void)didConnect:(id<HeftClient>)client;

Fires when the connection to the terminal is established and the SDK is fully initialized. Store client and use it for all subsequent transaction calls. Do not start any financial operations before this fires.

Always check isTransactionResultPending here to recover any result lost during a Bluetooth drop:

- (void)didConnect:(id<HeftClient>)client {
self.heftClient = client;
NSLog(@"didConnect: mpedInfo=%@", client.mpedInfo);

if ([client isTransactionResultPending]) {
[client retrievePendingTransaction];
// Result delivered via responseRecoveredTransactionStatus:
// Do NOT start a new transaction before retrieving — it discards the pending result permanently
}
}

responseStatus:​

- (void)responseStatus:(id<ResponseInfo>)info;

Fires multiple times during a transaction with intermediate status updates from the terminal (e.g. "Waiting for card", "PIN entry", "Connecting to host"). Use to update transaction-progress UI.

info propertyTypeNotes
statusCodeintNumeric EFT_PP_STATUS code (see Status codes below)
statusNSStringHuman-readable status string — display to operator
xmlNSDictionaryDetailed XML state snapshot of the terminal
- (void)responseStatus:(id<ResponseInfo>)info {
NSLog(@"responseStatus: code=0x%04lX status=%@", (long)info.statusCode, info.status);
dispatch_async(dispatch_get_main_queue(), ^{
self.statusLabel.text = info.status;
});
}

responseError:​

- (void)responseError:(id<ResponseInfo>)info;

Fires when a terminal-level error occurs during a transaction. info.status contains the error message string. Log info.statusCode for support.

responseFinanceStatus:​

- (void)responseFinanceStatus:(id<FinanceResponseInfo>)info;

The primary transaction result callback. Fires when the terminal finishes processing any financial operation. info is a FinanceResponseInfo object — see the FinanceResponseInfo reference below.

- (void)responseFinanceStatus:(id<FinanceResponseInfo>)info {
// toDictionary serializes every non-empty field — emit as a canonical log line
NSLog(@"responseFinanceStatus: %@", [info toDictionary]);

NSString *finStatus = info.finStatus;

if ([finStatus isEqualToString:@"AUTHORISED"]) {
// Store eFTTransactionID — required for reversal or refund
[self fulfillOrder:info.eFTTransactionID];
} else if ([finStatus isEqualToString:@"DECLINED"]) {
[self showDeclined:info.errorMessage];
} else if ([finStatus isEqualToString:@"CANCELLED"]) {
[self showCancelled];
} else if ([finStatus isEqualToString:@"PARTIAL_APPROVAL"]) {
NSInteger due = [info.dueAmount integerValue];
[self collectRemainder:due];
} else if ([finStatus isEqualToString:@"UNDEFINED"]) {
// Do NOT retry — recover server-side via Transaction Feed API
[self triggerServerSideRecovery];
}
}

requestSignature:​

- (void)requestSignature:(NSString *)receipt;

Fires during a financial operation when the terminal requires cardholder signature verification. receipt is the merchant receipt content — present it to the operator so they can verify the cardholder's signature.

Dual-format receipt parameter

receipt has two forms — always check before use. If the signature image upload succeeded, receipt is an https:// URL. If the upload failed (no connectivity), receipt is the raw base64-encoded image binary. Always check hasPrefix("http") before treating it as a URL.

- (void)requestSignature:(NSString *)receipt {
if ([receipt hasPrefix:@"http"]) {
NSURL *url = [NSURL URLWithString:receipt];
// Load and display image from URL
} else {
NSData *imageData = [[NSData alloc] initWithBase64EncodedString:receipt options:0];
UIImage *image = [UIImage imageWithData:imageData];
// Display image directly
}

// After cardholder signs, notify the SDK:
[self.heftClient acceptSignature:YES]; // accepted
// or:
[self.heftClient acceptSignature:NO]; // rejected — aborts transaction
}

cancelSignature​

- (void)cancelSignature;

Fires when the terminal cancels the signature request on its own (e.g. cardholder timeout on the device side). Dismiss any signature UI.

responseRecoveredTransactionStatus:​

- (void)responseRecoveredTransactionStatus:(id<FinanceResponseInfo>)info;

Fires in response to retrievePendingTransaction. info contains the recovered transaction result (info.recoveredTransaction == YES), or nil if no pending transaction was found. Treat it identically to a responseFinanceStatus: result.

responseLogInfo:​

- (void)responseLogInfo:(id<LogInfo>)info;

Fires in response to logGetInfo. info.log is the terminal's log output as a string.

responseScannerEvent:​

- (void)responseScannerEvent:(id<ScannerEventResponseInfo>)info;

Fires each time the barcode scanner reads a code while scan mode is active. info.scanCode contains the scanned barcode string. This is an @optional delegate method — implement it only on HiPro hardware.

responseScannerDisabled:​

- (void)responseScannerDisabled:(id<ScannerDisabledResponseInfo>)info;

Fires when the scanner exits scan mode — either because disableScanner was called, a single scan completed in single-scan mode, or the inactivity timeout elapsed. This is an @optional delegate method.

responseEMVReport:​

- (void)responseEMVReport:(NSString *)report;

Fires in response to getEMVConfiguration. report is the full EMV configuration as an XML string. This is an @optional delegate method.


FinanceResponseInfo​

The complete transaction result object. Delivered to responseFinanceStatus: and responseRecoveredTransactionStatus:. Conforms to id<FinanceResponseInfo>.

Call [info toDictionary] to serialize all non-empty fields as an NSDictionary — emit this as your canonical log line for every transaction.

Financial outcome​

FieldTypeNotes
finStatusNSStringPrimary result — see finStatus values below
financialResultNSIntegerNumeric code: 0x00=UNDEFINED, 0x01=APPROVED, 0x02=DECLINED, 0x03=PROCESSED, 0x04=FAILED, 0x05=CANCELLED
statusMessageNSStringHuman-readable result string (same text as finStatus in most cases)
typeNSStringTransaction type: "SALE", "REFUND", "VOID_SALE", "VOID_REFUND", "TOKENIZE_CARD", "SALE_AND_TOKENIZE_CARD"
errorMessageNSStringDetailed error reason — non-empty on DECLINED and FAILED; display or log for support

Transaction identifiers​

FieldTypeNotes
eFTTransactionIDNSStringPrimary GUID — store this on every AUTHORISED result. Required for saleReversalWithAmount:…:transactionId: and refundWithAmount:…:transaction:.
originalEFTTransactionIDNSStringGUID of the original transaction — populated on refunds and reversals only
transactionIdNSStringInternal transaction number. Different from eFTTransactionID. Used as the transaction parameter in tipAdjustment(transaction:amount:callback:). Do not confuse the two — reversals and refunds use eFTTransactionID; tip adjustment uses transactionId (the value labeled eFTTransactionID in the tip adjustment docs refers to this field).
eFTTimestampNSStringTransaction timestamp — format YYYYMMDDHHmmSS
authorisationCodeNSStringProcessor approval code

Amounts​

FieldTypeNotes
authorisedAmountNSIntegerAmount authorised in minor currency unit (e.g. 1000 = £10.00)
requestedAmountNSStringAmount originally requested at transaction start
totalAmountNSStringTotal charged — equals requestedAmount + gratuityAmount for tipped sales, or the partial approval amount
gratuityAmountNSStringTip entered by cardholder on the terminal
gratuityPercentageNSStringTip as a percentage of requestedAmount
dueAmountNSStringRemaining balance after a partial approval (US only) — collect this via a secondary tender
currencyNSStringISO 4217 alpha code used for the transaction

Card information​

FieldTypeNotes
cardSchemeNameNSStringCard brand as emitted by terminal firmware (always uppercase) — "VISA", "MASTERCARD", "AMEX", "MAESTRO", "DISCOVER", "JCB", "DINERS", "UNIONPAY", "INTERAC"
cardEntryTypeNSStringHow the card was read — "ICC" (chip), "NFC" (contactless tap), "MSR" (magnetic stripe swipe)
verificationMethodNSStringCardholder verification used — "PIN", "SIGNATURE", "PIN_SIGNATURE", "NOT_REQUIRED", "UNDEFINED", "FAILED", "MOBILE_PASS_CODE"
CardTokenNSStringCard token returned by tokenizeCard and saleAndTokenize operations

Receipts​

FieldTypeNotes
customerReceiptNSStringCustomer receipt in HTML format — present or print for the cardholder
merchantReceiptNSStringMerchant receipt in HTML format — for your records

Flags and metadata​

FieldTypeNotes
customerReferenceNSStringReference string passed to the transaction via options.customerReference — echoed unchanged
budgetNumberNSStringBudget period reference (SureSwipe/Altech only)
chipTransactionReportNSStringFull EMV parameter report from the chip interaction
balanceNSStringCardholder card balance (if the acquirer supports balance inquiry)
deviceStatusDeviceStatus *Device status at time of transaction — includes serialNumber, batteryStatus, batterymV, batteryCharging, externalPower, applicationName, applicationVersion, statusMessage, and bluetoothName
recoveredTransactionBOOLYES if this result was recovered via retrievePendingTransaction
isRestartingBOOLYES if the terminal is about to restart (e.g. post-firmware update) — disconnect and wait for didConnect: to fire again

finStatus values​

finStatus stringfinancialResultMeaningRequired action
"AUTHORISED"0x01Transaction approvedStore eFTTransactionID; fulfil the order
"DECLINED"0x02Declined by issuer or acquirerShow decline message; do not retry the same card
"CANCELLED"0x05Cardholder or operator cancelledAllow retry
"FAILED"0x04Processing or system errorCheck errorMessage; may retry
"PARTIAL_APPROVAL"—Partial funds available (US only)Collect remaining balance via dueAmount
"PROCESSED"0x03Non-financial operation completed (e.g. financeInit)No payment action needed
"UNDEFINED"0x00No result receivedDo not retry — recover server-side via Transaction Feed API
UNDEFINED handling

UNDEFINED means the SDK received no outcome from the network. The transaction may or may not have been processed. Never retry automatically. Query the Transaction Feed API for the terminal serial number and time window to determine the actual outcome.

The iOS SDK does not support getTransactionStatus() or transactionReference-based recovery. Recovery is always server-side.


Status codes​

Delivered via responseStatus: and responseError: as info.statusCode. Key values:

Codeinfo.status stringWhen it fires
0x0014WaitingForCardTerminal waiting for card tap, insert, or swipe
0x0019PinInputCardholder is entering PIN — show "Enter PIN on reader"
0x001FWaitingSignatureSignature prompt displayed — prepare signature capture UI
0x0020WaitingHostConnectConnecting to acquirer host
0x0035PartialApprovalPartial approval — prompt cardholder for remaining amount
0x0006ConnectTimeoutReader connection timed out — retry connection
0x0007ConnectErrorConnection error — retry clientForDevice:…
0x0012UserCancelledCardholder pressed Cancel on terminal
0x001DSharedSecretInvalidWrong shared secret — verify credentials with Handpoint
0x9999InitialisationCompleteReader is ready for transactions

Enums​

CardEntryType string values​

Returned in FinanceResponseInfo.cardEntryType:

ValueDescription
"ICC"Contact EMV chip (card inserted)
"NFC"Contactless tap (EMV or magnetic stripe contactless)
"MSR"Magnetic stripe swipe
"UNDEFINED"Entry type not applicable or not determined (e.g. non-payment operations)

CardSchemeName string values​

Returned in FinanceResponseInfo.cardSchemeName. The SDK passes this through directly from the terminal firmware — values are always uppercase. Confirmed from live terminal captures: VISA, MASTERCARD, DISCOVER, AMEX.

Value
"VISA"
"MASTERCARD"
"MAESTRO"
"AMEX"
"DISCOVER"
"JCB"
"DINERS"
"UNIONPAY"
"INTERAC"

TipAdjustmentStatus​

Returned via the callback block passed to tipAdjustment(…):

ValueMeaning
TipAdjustmentAuthorisedTip adjustment approved by the processor
TipAdjustmentDeclinedTip adjustment declined by the processor
TipAdjustmentFailedSystem error or timeout — retry recommended

Options objects​

SaleOptions​

Options for saleWithAmount:…:options: and saleAndTokenizeWithAmount:…:options:.

PropertyTypeNotes
customerReferenceNSStringArbitrary reference string echoed in FinanceResponseInfo.customerReference. Max 25 characters.
merchantAuthMerchantAuthMulti-MID credential override — see MerchantAuth / Credential below
divideByMonthsNSStringBudget period in months, e.g. @"3" for 3 months (SureSwipe/Altech only)

MerchantAuthOptions​

Options for refundWithAmount:…:options:. Includes all SaleOptions fields plus merchantAuth for multi-MID refunds.

Options​

Base options object used for reversals.

PropertyTypeNotes
customerReferenceNSStringReference string echoed in result

MerchantAuth / Credential​

Used for multi-MID scenarios where a single terminal processes transactions for multiple merchant accounts.

MerchantAuth *auth = [MerchantAuth new];
Credential *cred = [Credential new];
cred.acquirer = [Credential getAcquirerFromString:@"acquirer_name"];
cred.mid = @"merchant_id";
cred.tid = @"terminal_id";
[auth add:cred];
options.merchantAuth = auth;
PropertyNotes
acquirerAcquirer identifier — use [Credential getAcquirerFromString:@"name"]
midOverride merchant ID for this transaction
tidOverride terminal ID for this transaction

tipAdjustment C function​

Tip adjustment is a C function in HapiRemoteService.h — it calls the Handpoint cloud API directly and does not require a connected card reader.

Acquirer availability: EPI (TSYS, VANTIV) in the United States restaurant industry only.

Setup — call once, before any tip adjustment:

#include "HapiRemoteService.h"

NSString *sharedSecret = @"0102030405060708091011121314151617181920212223242526272829303132";
BOOL initialized = setupHandpointApiConnection(sharedSecret);

Call signature:

BOOL tipAdjustment(NSString *transaction, NSInteger tipAmount, void (^callback)(TipAdjustmentStatus));
ParameterTypeNotes
transactionNSString *The eFTTransactionID GUID from the original sale's FinanceResponseInfo
tipAmountNSIntegerTip amount in minor currency unit (e.g. 1000 = $10.00)
callbackBlockReceives a TipAdjustmentStatus value
NSString *transaction = @"d50af540-a1b0-11e6-85e6-07b2a5f091ec";

tipAdjustment(transaction, 1000, ^(TipAdjustmentStatus status) {
if (status == TipAdjustmentAuthorised) {
// Tip applied — update UI
} else if (status == TipAdjustmentDeclined) {
// Declined — notify operator
} else if (status == TipAdjustmentFailed) {
// Timeout or system error — prompt to retry
}
});
Overwriting tip adjustments

If two tip adjustments are submitted for the same transaction, the second overrides the first. There is no tipAdjustmentReversal.


See also​