4D Payments SDK 2016 .NET Edition

Questions / Feedback?

AuthenticateDevice Method

Authenticates a POS terminal.


public void AuthenticateDevice();
Public Sub AuthenticateDevice()


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 fields are applicable when calling this method:

The following additional properties are also applicable:

After calling this method check Code to determine if the authentication succeeded. If the authentication succeeded Code will be "A1" and GenKey will be populated. If authentication failed Code will be "A2".

In addition to GenKey the following Response fields are populated:

AuthenticateDevice Example:
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";

string genkey = "";
if (TSYSTerminalMgr1.Response.Code == "A1") //approved
  genkey = TSYSTerminalMgr1.GenKey;

.NET Standard Notes

To call this method in an asynchronous manner call AuthenticateDeviceAsync instead. When the method completes (or an error is encountered) the AuthenticateDeviceCompleted event will fire.

Copyright (c) 2021 4D Payments Inc. - All rights reserved.
4D Payments SDK 2016 .NET Edition - Version 16.0 [Build 7809]