Skip to main content

Windows SDK — Objects & Enums Reference

This page documents every object and enumeration returned by or passed to the HandpointSDK NuGet package.


TransactionResult​

TransactionResult is the main result object delivered to EndOfTransaction and TransactionResultReady. All financial outcome fields are on this object.

Receipt and signature URL formats

customerReceipt and merchantReceipt are normally delivered as HTTPS URLs pointing to HTML files stored in Handpoint cloud. If the terminal cannot reach the Handpoint servers, the raw HTML is delivered instead. Always test both paths.

signatureUrl is similarly a URL under normal operation. If the upload fails, the terminal delivers a base64-encoded PNG. Check with value.StartsWith("http") to distinguish.

string sig = result.SignatureUrl;
if (!string.IsNullOrEmpty(sig))
{
if (sig.StartsWith("http"))
DisplayImage(sig); // load URL
else
DisplayImage(Convert.FromBase64String(sig)); // decode binary
}
PropertyC# TypeDescription
aidstringEMV Application Identifier (tag 9F06)
arcstringEMV Authorisation Response Code (tag 8A)
authorisationCodestringAcquirer authorisation code
balanceBigInteger?Available balance on the card (if returned by issuer)
budgetNumberstringBudget instalment number (South Africa acquirers)
cardEntryTypeCardEntryTypeHow the card was read — see enum below
cardLanguagePreferencestringPreferred language on the card (EMV tag 5F2D)
cardSchemeNameCardSchemeNameCard brand (Visa, MasterCard, etc.)
cardTokenstringPAN token — populated for TokenizeCard and SaleAndTokenizeCard
chipTransactionReportstringFull EMV tag dump from the chip
currencyCurrencyCurrency used for the transaction
customerReceiptstringURL or raw HTML of the customer receipt
customerReferencestringEchoed from the optional parameter sent at request time
deviceStatusDeviceStatusTerminal battery and app version at time of transaction
dueAmountBigIntegerRemaining amount in a partial approval (US only)
efttimestamplongTransaction timestamp (milliseconds since epoch, terminal clock)
efttransactionIDstringHandpoint GUID — use this as originalTransactionID for reversals and linked refunds
errorMessagestringHuman-readable error description when finStatus is FAILED
expiryDateMMYYstringCard expiry in MMYY format
finStatusFinancialStatusFinal outcome — the field you act on first
gratuityAmountBigIntegerTip amount in minor units (deprecated in SDK 5.0 — use tipAmount)
gratuityPercentagedoubleTip percentage (deprecated in SDK 5.0 — use tipPercentage)
iadstringEMV Issuer Application Data (tag 9F10)
issuerResponseCodestringResponse code from card issuer
maskedCardNumberstringMasked PAN, e.g. ************1456
merchantAddressstringMerchant address from TMS
merchantNamestringMerchant name from TMS
merchantReceiptstringURL or raw HTML of the merchant receipt
metadataMetadataEcho of Metadata1–5 sent at request time
midstringMerchant Identifier
originalEFTTransactionIDstringFor reversals — the ID of the original transaction being reversed
paymentScenarioPaymentScenarioCard entry scenario (chip, contactless, magstripe, MOTO, etc.)
recoveredTransactionbooltrue if result arrived via GetTransactionStatus recovery flow
requestedAmountBigIntegerAmount sent to the terminal
rrnstringRetrieval Reference Number (acquirer-assigned unique ID)
signatureUrlstringURL of captured signature image, or base64-encoded PNG if upload failed
statusMessagestringHuman-readable status, e.g. "Approved or completed successfully"
tenderTypeTenderTypeCredit or debit
tidstringTerminal Identifier
tipAmountBigIntegerTip amount in minor currency units
tipPercentagedoubleTip as a percentage of the base amount
totalAmountBigIntegerTotal charged (base + tip)
transactionIDstringTerminal-internal counter ID
tsistringEMV Transaction Status Information (tag 9B)
tvrstringEMV Terminal Verification Results (tag 95)
typeTransactionTypeTransaction type: SALE, REFUND, VOID_SALE, etc.
unMaskedPanstringFull PAN — only for non-payment (loyalty) cards
verificationMethodVerificationMethodCardholder verification used (PIN, SIGNATURE, etc.)

OperationStartResult​

Returned synchronously by every financial operation (except TipAdjustment, which returns Task<FinancialStatus>).

PropertyC# TypeDescription
OperationStartedbooltrue if the SDK accepted and sent the command to the terminal. Does not mean approved.
TransactionReferencestringUUID to persist before the operation. Use it with GetTransactionStatus if EndOfTransaction does not fire. Linked refunds and reversals do not generate a new reference — they reuse the original.
ErrorMessagestringReason the operation was rejected (populated when OperationStarted is false).

StatusInfo​

Delivered to CurrentTransactionStatus throughout the operation lifecycle.

PropertyC# TypeDescription
CancelAllowedbooltrue if StopCurrentTransaction() will be accepted at this point
statusStatusCurrent status code — see the Status enum
messagestringHuman-readable status string
DeviceStatusDeviceStatusSnapshot of terminal battery and app info

SignatureRequest​

Delivered to SignatureRequired when a chip-and-signature or swipe transaction needs operator confirmation.

PropertyC# TypeDescription
TimeoutintSeconds before the SDK times out waiting for SignatureResult
MerchantReceiptstringURL or raw HTML merchant receipt to display to the operator

Call hapi.SignatureResult(true) to approve or hapi.SignatureResult(false) to decline.


DeviceStatus​

Embedded inside TransactionResult and StatusInfo.

PropertyC# TypeDescription
SerialNumberstringTerminal serial number
BatteryStatusstringBattery percentage, e.g. "100"
BatterymVstringBattery millivolts
BatteryChargingtstringCharging state, e.g. "Not Charging" or "USB"
ExternalPowerstringExternal power source status
ApplicationNamestringPayments app name on the terminal
ApplicationVersionstringPayments app version on the terminal

FinancialStatus (enum)​

The primary field to switch on in EndOfTransaction.

ValueMeaning
AUTHORISEDTransaction approved. Store efttransactionID and fulfil the order.
DECLINEDDeclined by acquirer or issuer. Do not fulfil the order.
CANCELLEDCardholder or operator cancelled (e.g. StopCurrentTransaction, cancel button).
FAILEDTechnical failure — network error, unreadable card, etc. Check errorMessage. The card was not charged.
PARTIAL_APPROVALUS only — acquirer approved partial funds. dueAmount contains the remaining balance. Either collect the remainder separately or call SaleReversal to void.
PROCESSEDUsed specifically for PrintReceipt success.
CAPTUREDPre-auth captured. Only returned for PreAuthorizationCapture.
IN_PROGRESSReturned by GetTransactionStatus only — gateway knows the transaction but has no final result yet. Poll again in 10 s.
REFUNDEDReturned by GetTransactionStatus only — the original sale has been refunded.
UNDEFINEDAny other status, or returned by GetTransactionStatus when the transaction ID is unknown to the gateway. If UNDEFINED is returned after 90 s from transaction start, the card was not charged.

CardEntryType (enum)​

ValueMeaning
UNDEFINEDEntry method not determined
MSRMagnetic stripe swipe
ICCChip (contact)
CNPCard not present (MOTO, keyed entry)

CardSchemeName (enum)​

Enum member names (PascalCase): MasterCard Visa Maestro AmericanExpress Discover JCB Diners UnionPay Interac

The terminal firmware emits all-uppercase strings (VISA, MASTERCARD, AMEX, DISCOVER…). The SDK deserializes these into the corresponding enum member.


ConnectionMethod (enum)​

Windows SDK supports BLUETOOTH, CLOUD, and SIMULATOR. The others exist in the SDK but are not supported on Windows.

ValueSupport
BLUETOOTHHiLite readers
CLOUDPAX SmartPOS terminals
SIMULATORBuilt-in simulator (no hardware required)
USBNot supported on Windows
SERIALNot supported on Windows
HTTPSNot supported on Windows
WIFINot supported on Windows
ETHERNETNot supported on Windows

ConnectionStatus (enum)​

Connected Connecting Disconnected Disconnecting Initializing NotConfigured


PaymentScenario (enum)​

ValueMeaning
UNKNOWNScenario not determined
MAGSTRIPEContact magnetic stripe
MAGSTRIPECONTACTLESSContactless magnetic stripe
CHIPContact chip
CHIPCONTACTLESSContactless chip
CHIPFAILMAGSTRIPEChip fallback to magnetic stripe
MOTOMail order / telephone order

TenderType (enum)​

NOT_SET CREDIT DEBIT


VerificationMethod (enum)​

UNDEFINED SIGNATURE PIN PIN_SIGNATURE FAILED NOT_REQUIRED MOBILE_PASS_CODE


TransactionType (enum)​

UNDEFINED SALE VOID_SALE REFUND VOID_REFUND CANCEL_SALE CANCEL_REFUND TOKENIZE_CARD SALE_AND_TOKENIZE_CARD REVERSAL UPDATE HOST_INIT PRINT_RECEIPT CARD_PAN CANCEL_TRX MOTO_SALE MOTO_REFUND MOTO_REVERSAL


DeviceParameter (enum)​

Used with device configuration calls to send settings to the terminal.

BluetoothName BluetoothPass SystemTimeout ScreenTimeout SignatureTimeout Language


Optional Transaction Parameters (XmlTag map keys)​

Any financial operation that accepts a Dictionary<string, string> map supports these keys:

KeyAvailable forDescription
XmlTag.CustomerReference.Tag()All transactionsUp to 36-character string echoed back in TransactionResult.customerReference
XmlTag.Metadata1.Tag() – XmlTag.Metadata5.Tag()All transactionsUp to 250 characters each; echoed in TransactionResult.metadata. Allowed chars: a-z A-Z 0-9 - ( ) @ : % _ \ + . ~ # ? & / = { } " ' ,
XmlTag.Budget.Tag()Sale onlyTwo-digit string ("03", "24") to split across months
XmlTag.DuplicateCheck.Tag()Sale, SaleAndTokenize, SaleReversal, Refund, RefundReversalPass "0" to disable duplicate-payment detection (enabled by default from SDK 3.3.0)
XmlTag.MoneyRemittanceCountryCode.Tag()All transactionsISO 3166-1 alpha-3 country code for Mastercard money remittance
XmlTag.MoneyRemittanceFullName.Tag()All transactionsRecipient full name for Mastercard money remittance

Currency (enum)​

The Currency enum covers all ISO 4217 currency codes. Common values: AED AUD CAD CHF DKK EUR GBP HKD JPY MXN NOK NZD SEK SGD USD — and many more. Pass as Currency.USD, Currency.EUR, etc.


Status (enum)​

The Status enum covers every intermediate status that can appear in StatusInfo.status during CurrentTransactionStatus. Common values include: WaitingForCard, CardInserted, CardTapped, PinInput, PinInputCompleted, WaitingSignature, WaitingHostConnect, WaitingHostSend, WaitingHostReceive, RemoveCard, PartialApproval, UserCancelled, PosCancelled, UpdateStarted, UpdateFinished, UpdateFailed, PrintingMerchantReceipt, PrintingCustomerReceipt.

Full list (not exhaustive): Undefined Success InvalidData ProcessingError CommandNotAllowed NotInitialised ConnectTimeout ConnectError SendingError ReceivingError NoDataAvailable TransactionNotAllowed UnsupportedCurrency NoHostAvailable CardReaderError CardReadingFailed InvalidCard InputTimeout UserCancelled InvalidSignature WaitingForCard CardInserted ApplicationSelection ApplicationConfirmation AmountValidation PinInput ManualCardInput WaitingForCardRemoval TipInput SharedSecretInvalid SharedSecretAuth WaitingSignature WaitingHostConnect WaitingHostSend WaitingHostReceive WaitingHostDisconnect PinInputCompleted PosCancelled RequestInvalid CardCancelled CardBlocked RequestAuthTimeout RequestPaymentTimeout ResponseAuthTimeout ResponsePaymentTimeout IccCardSwiped RemoveCard ScannerIsNotSupported ScannerEvent BatteryTooLow AccountTypeSelection BtIsNotSupported PaymentCodeSelection PartialApproval AmountDueValidation InvalidUrl WaitingCustomerReceipt PrintingMerchantReceipt PrintingCustomerReceipt UpdateStarted UpdateFinished UpdateFailed UpdateProgress WaitingHostPostSend WaitingHostPostReceive Rebooting PrinterOutOfPaper ErrorConnectingToPrinter CardTapped ReceiptPrintSuccess InvalidPinLength OfflinePinAttempt OfflinePinLastAttempt ProcessingSignature CardRemoved TipEntered CardLanguagePreference AutomaticPrintingStarted CancelOperationNotAllowed UpdateSoftwareStarted UpdateSoftwareFinished UpdateSoftwareFailed UpdateSoftwareProgress InstallSoftwareStarted InstallSoftwareFinished InstallSoftwareFailed InstallSoftwareProgress UpdateConfigStarted UpdateConfigFinished UpdateConfigFailed UpdateConfigProgress InitialisationComplete


Device​

Device is the object used to identify and connect to a payment terminal. Pass it to Connect(), Disconnect(), Update(), and other device management calls.

Constructor

Device(
string name,
string address,
string port,
ConnectionMethod connectionMethod,
string sharedSecret = null,
int timeout = 0
)
ParameterTypeRequiredDescription
namestringYesA display name for the terminal — used for logging and UI only
addressstringYesBluetooth MAC address ("68:AA:D2:00:D5:27") or Cloud address ("serialNumber-model", e.g. "9822032398-PAXA920")
portstringYesPort string — pass "" for Cloud; pass "1" for Bluetooth
connectionMethodConnectionMethodYesHow to connect — BLUETOOTH, CLOUD, or SIMULATOR
sharedSecretstringNoOverrides the default shared secret for this specific device
timeoutintNoConnection timeout in milliseconds (0 = SDK default)

Properties

PropertyTypeDescription
IdstringUnique identifier assigned by the SDK
NamestringDisplay name passed at construction
AddressstringDevice address passed at construction
PortstringPort string passed at construction
ConnectionMethodConnectionMethodConnection type passed at construction

Example

// HiLite via Bluetooth (MAC address must be UPPER CASE)
Device hilite = new Device("CardReader7", "68:AA:D2:00:D5:27", "1", ConnectionMethod.BLUETOOTH);

// PAX A920 via Cloud (serialNumber-model format)
Device pax = new Device("MyPAX", "9822032398-PAXA920", "", ConnectionMethod.CLOUD);

// Built-in simulator (no hardware required)
Device sim = new Device("Sim", "Address", "Port", ConnectionMethod.SIMULATOR);

HandpointCredentials​

A class that bundles the authentication credentials passed to HapiFactory.GetAsyncInterface().

Constructors

// Bluetooth-only — sharedSecret required
HandpointCredentials(string sharedSecret)

// Cloud (PAX) + GetTransactionStatus support — both fields required
HandpointCredentials(string sharedSecret, string cloudApiKey)

Properties

PropertyTypeDescription
SharedSecretstringAuthenticates the SDK to the Payments App / HiLite reader. Required. For Cloud connections any non-null string is accepted.
CloudApiKeystringMerchant API key for Cloud connections and GetTransactionStatus. Required for PAX/Cloud; omit for Bluetooth-only integrations.

Example

// HiLite (Bluetooth) — shared secret only
var btCreds = new HandpointCredentials("0102030405060708091011121314151617181920212223242526272829303132");

// PAX (Cloud) — shared secret + Cloud API key
var cloudCreds = new HandpointCredentials(
"0102030405060708091011121314151617181920212223242526272829303132",
"YOUR_CLOUD_API_KEY"
);

HapiFactory​

A sealed factory class that creates and returns the single Hapi instance. Call GetAsyncInterface once during app startup and store the result.

Static method

static Hapi GetAsyncInterface(Events.Required listener, HandpointCredentials credentials)
ParameterTypeRequiredDescription
listenerEvents.RequiredYesYour class implementing Events.Required (and optionally Events.Status, Events.Log, etc.)
credentialsHandpointCredentialsYesShared secret and optional Cloud API key

Returns the Hapi instance. If called again in the same process lifetime, the existing instance is returned unchanged.

Example

public class PaymentHandler : Events.Required
{
private Hapi hapi;

public void Init()
{
var credentials = new HandpointCredentials(
"0102030405060708091011121314151617181920212223242526272829303132",
"YOUR_CLOUD_API_KEY"
);
hapi = HapiFactory.GetAsyncInterface(this, credentials);
}

public void EndOfTransaction(TransactionResult result, Device device) { /* ... */ }
public void CurrentTransactionStatus(StatusInfo info, Device device) { /* ... */ }
public void DeviceDiscoveryFinished(List<Device> devices) { /* ... */ }
public void SignatureRequired(SignatureRequest request, Device device) { hapi.SignatureResult(true); }
public void TransactionResultReady(TransactionResult result, Device device) { /* ... */ }
}
note

HapiFactory is a singleton internally — only one Hapi is created per process. If you call GetAsyncInterface a second time, the original instance is returned. To switch credentials you must restart the process.


HapiManager​

A static class that exposes runtime status and configuration of the SDK. All members are static methods.

Static methods

MethodReturn typeDescription
HapiManager.GetDefaultSharedSecret()stringReturns the shared secret currently in use
HapiManager.GetLogLevel()LogLevelReturns the current log level of the SDK
HapiManager.InTransaction()booltrue while a transaction is in progress on the default device. May return true if there is a communication error but the terminal has completed the transaction.
HapiManager.InTransaction(Device device)boolSame check, scoped to a specific device
HapiManager.GetSdkVersion()VersionReturns the SDK assembly version
HapiManager.IsTransactionResultPending()booltrue if the terminal has a transaction result that has not yet been delivered. Check this when reconnecting after a communication failure.
HapiManager.IsTransactionResultPending(Device device)boolSame check, scoped to a specific device

Settings

Pass a Settings object as a third argument to HapiFactory.GetAsyncInterface() to configure SDK behaviour:

PropertyTypeDefaultDescription
AutomaticReconnectionbooltrueWhen true, the SDK automatically reconnects after a connection drop
ShowSDKUIComponentsboolfalseShows SDK-provided UI overlays (progress screens)
GetReceiptsAsURLsboolfalseWhen true, receipts are delivered as HTTPS URLs rather than raw HTML
Localestring"en_US"Locale string used for terminal UI language selection

Example

bool inTxn = HapiManager.InTransaction();
LogLevel level = HapiManager.GetLogLevel();
bool pending = HapiManager.IsTransactionResultPending();

// Custom settings
var settings = new Settings { AutomaticReconnection = false };
hapi = HapiFactory.GetAsyncInterface(this, credentials, settings);

LogLevel (enum)​

Controls the verbosity of SDK logging. Set via hapi.SetLogLevel(). The current level is read with HapiManager.GetLogLevel().

ValueDescription
NoneNo logging
InfoInformational messages (default)
FullAll messages including request/response frames
DebugMaximum verbosity — includes internal state changes
hapi.SetLogLevel(LogLevel.Debug);

Metadata​

The Metadata object echoes back the five optional metadata fields that were sent with the transaction request. It is delivered inside TransactionResult.metadata.

Properties

PropertyTypeMax lengthDescription
Metadata1string250 charsArbitrary data field 1
Metadata2string250 charsArbitrary data field 2
Metadata3string250 charsArbitrary data field 3
Metadata4string250 charsArbitrary data field 4
Metadata5string250 charsArbitrary data field 5

Valid characters for all fields: a-z A-Z 0-9 - ( ) @ : % _ \ + . ~ # ? & / = { } " ' ,

How to set metadata on a transaction

var map = new Dictionary<string, string>();
map.Add(XmlTag.Metadata1.Tag(), "table-7");
map.Add(XmlTag.Metadata2.Tag(), "server-42");
OperationStartResult op = hapi.Sale(new BigInteger(1000), Currency.EUR, map);

// In EndOfTransaction:
Console.WriteLine(result.Metadata.Metadata1); // "table-7"
Console.WriteLine(result.Metadata.Metadata2); // "server-42"

MoneyRemittanceOptions​

Encapsulates recipient details required for Mastercard money remittance transactions. Merchants with MCC 4829 (wire transfers) or 6540 (stored-value card purchase) must supply these fields for Mastercard. VISA transactions do not require them.

Properties

PropertyTypeRequiredDescription
fullNamestringYesFirst and last name of the transfer recipient (letters and spaces only)
countryCodeCountryCodeYesRecipient's country as an ISO 3166-1 alpha-3 code

How to pass money remittance options

Money remittance data is passed via the optional map parameter using XmlTag keys:

var map = new Dictionary<string, string>();
map.Add(XmlTag.MoneyRemittanceFullName.Tag(), "John Doe");
map.Add(XmlTag.MoneyRemittanceCountryCode.Tag(), "USA");

OperationStartResult op = hapi.Sale(new BigInteger(5000), Currency.USD, map);