AuthenticateDevice Method
Authenticates a POS terminal.
Syntax
void __fastcall AuthenticateDevice();Remarks
AuthenticateDevice authenticates a POS device with TSYS. After a device is authenticated GenKey will hold a unique value that should be included in all future transaction requests from the terminal. Before calling this method an AuthenticationCode must be obtained from TSYS.
The following Merchant properties are applicable when calling this method:
- MerchantBankId
- MerchantCategoryCode
- MerchantCountryCode
- MerchantCurrencyCode
- MerchantLanguage
- MerchantNumber
- MerchantServicePhone
- MerchantStoreNumber
- MerchantTerminalNumber
- MerchantTimeZone
- MerchantZip
After calling this method check ResponseCode to determine if the authentication succeeded. If the authentication succeeded ResponseCode will be "A1" and GenKey will be populated. If authentication failed ResponseCode will be "A2".
In addition to GenKey the following Response properties are populated:
- ResponseCode
- ResponseTransactionDate
- ResponseTransactionNumber
- ResponseTransactionTime
- ResponseAuthSource
- ResponseText
TSYSTerminalMgr1.Merchant.BankId = "999999"; TSYSTerminalMgr1.Merchant.CategoryCode = "9999"; TSYSTerminalMgr1.Merchant.Name = "TESTMERCHANT"; TSYSTerminalMgr1.Merchant.Number = "888000002447"; TSYSTerminalMgr1.Merchant.StoreNumber = "5999"; TSYSTerminalMgr1.Merchant.TerminalNumber = "1234"; TSYSTerminalMgr1.Merchant.Zip = "27516"; TSYSTerminalMgr1.Merchant.ServicePhone = "6023337807"; TSYSTerminalMgr1.TransactionNumber = 1234; TSYSTerminalMgr1.AuthenticationCode = "N123456789"; TSYSTerminalMgr1.AuthenticateDevice(); string genkey = ""; if (TSYSTerminalMgr1.Response.Code == "A1") //approved genkey = TSYSTerminalMgr1.GenKey;