All pages
Powered by GitBook
1 of 6

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Appendix D - Apple VAS

These instructions are for preparing Apple VAS (value-added service) transactions.

Merchant ID and URL Slots

  • Set the Apple VAS Merchant ID and URL property for each slot 1 to 6 using IDeviceControl --> setConfigInfo().

POS Capabilities

  • Set the POS capabilities property using IDeviceControl --> setConfigInfo().

Start Transaction

  • Set the PaymentMethods to include PaymentMethod.AppleVAS.

  • Set AppleVASMode to: VASMode.Single, VASMode.Dual, or VASMode.VASOnly.

  • Set AppleVASProtocol to: VASProtocol.Full or VASProtocol.URL.

  • Data from an Apple VAS (9F27 and 9F2A) is returned in separate Apple VAS slot containers.

Tag

Length

Value /Description

FE

var

VAS Data Container

//FF01

var

Apple VAS Container Slot 1 Container

///9F27

var

VAS Data. Up to 128 bytes.

///9F2A

Tag

Length

Value /Description

///9F27

var

VAS Data. Up to 128 bytes.

///9F2A

var

Mobile Token. Up to 36 bytes.

//FF05

Transaction Response

var

Mobile Token. Up to 36 bytes.

//FF02

var

Apple VAS Container Slot 2 Container

///9F27

var

VAS Data. Up to 128 bytes.

///9F2A

var

Mobile Token. Up to 36 bytes.

//FF03

var

Apple VAS Container Slot 3 Container

///9F27

var

VAS Data. Up to 128 bytes.

///9F2A

var

Mobile Token. Up to 36 bytes.

//FF04

var

Apple VAS Container Slot 4 Container

var

Apple VAS Container Slot 5 Container

///9F27

var

VAS Data. Up to 128 bytes.

///9F2A

var

Mobile Token. Up to 36 bytes.

//FF06

var

Apple VAS Container Slot 6 Container

///9F27

var

VAS Data. Up to 128 bytes.

///9F2A

var

Mobile Token. Up to 36 bytes.

Appendix A - Status Codes

Library Status Codes

public enum StatusCode
{
SUCCESS = 0,
TIMEOUT = 1,
ERROR = 2,
UNAVAILABLE = 3
}

Enum

Description

SUCCESS

The operation completed successfully.

TIMEOUT

The operation timed out.

ERROR

Error attempting the operation.

UNAVAILABLE

Status currently unavailable.

Supported Function List

The following table shows which MTUSDK API function is supported for a device.

Function / Product

DynaFlex

DynaFlex Pro

DynaFlex II

DynaFlex II PED

DynaProx

DynaFlex II Go

CoreAPI

createCMSDevice

Function / Product

DynaFlex

DynaFlex Pro

DynaFlex II

DynaFlex II PED

DynaProx

DynaFlex II Go

Name

*

*

*

*

*

*

Function / Product

DynaFlex

DynaFlex Pro

DynaFlex II

DynaFlex II PED

DynaProx

DynaFlex II Go

send

*

*

*

*

*

*

Function / Product

DynaFlex

DynaFlex Pro

DynaFlex II

DynaFlex II PED

DynaProx

DynaFlex II Go

setConfigInfo

*

*

*

*

*

*

setDisplayImage

createDevice

*

*

*

*

*

*

createMMSDevice

*

*

*

*

*

*

createPPSCRA

createSCRA

getDeviceList

*

*

*

*

*

*

getAPIVersion

*

*

*

*

*

*

setMQTTBrokerInfo

*

setMQTTClientID

*

setMQTTClientCertificateInfo

*

setMQTTDeviceDiscoveryTimeout

*

startMQTTDeviceStatusMonitory

*

setMQTTPublishTopic

*

setMQTTQos

*

setMQTTSubscribeTopic

*

stopMQTTDeviceStatusMonitoring

*

setSystemStatusCallback

*

IDevice

cancelTransaction

*

*

*

*

*

*

getCapabilities

*

*

*

*

*

*

getConnectionInfo

*

*

*

*

*

*

getConnectionState

*

*

*

*

*

*

getDeviceConfiguration

*

*

*

*

*

*

getDeviceInfo

*

*

*

*

*

*

requestPAN

*

*

requestPIN

*

requestSignature

*

*

sendAuthorization

*

*

*

*

*

*

sendClassicNFCCommand

*

*

*

*

sendNFCCommand

*

*

*

*

sendSelection

*

*

*

*

*

*

startTransaction

*

*

*

*

*

*

subscribeAll

*

*

*

*

*

*

unsubscribeAll

*

*

*

*

*

*

IDeviceCapabilities

AutoSignatureCapture

*

*

*

*

*

*

BatteryBackedClock

*

*

*

*

*

*

Display

*

*

*

*

*

*

MSRPowerSaver

*

*

*

*

*

*

PaymentMethods

*

*

*

*

*

*

PINPad

*

*

*

*

*

*

Signature

*

*

*

*

*

*

SRED

*

*

*

*

*

*

IDeviceControl

close

*

*

*

*

*

*

deviceReset

*

*

*

*

*

*

displayMessage

*

*

endSession

*

*

*

*

*

*

getInput

open

*

*

*

*

*

*

playSound

sendExtendedCommand

sendSync

*

*

*

*

*

*

setDateTime

setLatch

showImage

*

*

showBarCode

*

*

startBarCodeReader

*

*

*

*

*

*

stopBarCodeReader

*

*

*

*

*

*

ConnectionInfo

getAddress

*

*

*

*

*

*

getConnectionType

*

*

*

*

*

*

getDeviceType

*

*

*

*

*

*

getCertificationInfo

*

*

*

*

*

*

DeviceInfo

getModel

*

*

*

*

*

*

getName

*

*

*

*

*

*

getSerial

*

*

*

*

*

*

IDeviceConfiguration

getChallengeToken

*

*

*

*

*

*

getConfigInfo

*

*

*

*

*

*

getDeviceInfo

*

*

*

*

*

*

getFile

*

*

*

*

*

*

getKeyInfo

*

*

*

*

*

*

sendFile

*

*

*

*

*

*

sendImage

*

*

sendSecureFile

*

*

*

*

*

*

*

*

updateFirmware

*

*

*

*

*

*

updateKeyInfo

*

*

*

*

*

*

Appendix E - Google Wallet Smart Tap VAS

These instructions are for preparing Google Wallet Smart Tap VAS (value-added service) transactions.

Mobile Device

  • Configure the mobile device for Google Wallet Smart Tap Pass.

Load Key

  • Load the LTPK protection key (Long Term Private Key) into the MagTek device.

  • Upload a Public Key to the Google Pay & Wallet Console for the issuer account associate with the Google Wallet Pass.

Collector ID Slots

  • Set the Google Smart Tap Collector ID property for each slot 1 to 6 using IDeviceControl --> setConfigInfo().

  • Set the POS capabilities property using IDeviceControl Γ  setConfigInfo().

  • Set the PaymentMethods to include PaymentMethod.GoogleVAS.

  • Set AppleVASMode to: VASMode.Single, VASMode.Dual, or VASMode.VASOnly.

  • Data from a Google Wallet Smart Tap (DF7B) is returned in separate Collector ID slot containers associated with the Google Wallet Pass.

Tag

Length

Value /Description

FF41

var

Google Smart Tap Container

//FF01

var

Collector ID Slot 1 Container

///DF7B

var

Service Response NDEF Record

Tag

Length

Value /Description

///DF7B

var

Service Response NDEF Record

//FF04

var

Collector ID Slot 4 Container

///DF7B

POS Capabilities

Start Transaction

Transaction Response

//FF02

var

Collector ID Slot 2 Container

///DF7B

var

Service Response NDEF Record

//FF03

var

Collector ID Slot 3 Container

var

Service Response NDEF Record

//FF05

var

Collector ID Slot 5 Container

///DF7B

var

Service Response NDEF Record

//FF06

var

Collector ID Slot 6 Container

///DF7B

var

Service Response NDEF Record

Appendix C - EMV Transaction Flow

This section demonstrates transaction flow.

Flow Chart - QuickChip

Sample Code - QuickChip

The following breaks out the EMV flow chart into code. When enabling QuickChip mode, host does not send the ARPC to the device to complete the transaction. Events are shown separately and in the order received.

// Assign parameters.
List<PaymentMethod> paymentMethod = new List<PaymentMethod>(); paymentMethod.Add(PaymentMethod.MSR); 
paymentMethod.Add(PaymentMethod.Contact); 
paymentMethod.Add(PaymentMethod.Contactless);

transaction = new Transaction();
transaction.Amount = β€œ1.00”;
transaction.CashBack = β€œ0.00”; 
transaction.EMVOnly = true; 
transaction.PaymentMethods = paymentMethod;
transaction.QuickChip = true; // QuickChip mode enabled.

// Start transaction.
bool result = device.startTransaction(transaction);
public void OnEvent(EventType eventType, IData data)
{
    string message 
    switch (eventType);
        {
            case EventType.DisplayMessage:
                // Get the message.
                message = data.StringValue;
    }
}
public void OnEvent(EventType eventType, IData data)
{
    string message; 
    switch (eventType);
        {
            case EventType.InputRequest:
            // Get the message.
            message = data.StringValue;

            // display/retrieve user selection.

            // set status and selection result.
            IData selectionData = new BaseData(new Byte[] {status, selection});
            device.sendSelection(selectionData);
    }
}
public void OnEvent(EventType eventType, IData data)
{
        byte[] ARQC = null; 
        switch (eventType);
                {
                        case EventType.AuthorizationRequest:
                        // Forward ARQC to processor.
                        /* data[0..1] – ARQC length
                        data[2..n] – remainder contains the ARQC TLV object */
        }
}
 public void OnEvent(EventType eventType, IData data)
{
        string message; 
        switch (eventType);
                {
                        case EventType.DisplayMessage:
                                // Display approval message. 
                                message = data.StringValue;

                                // A data size of 0 is an instruction to clear the display. 
                                if (data.StringValue.Length == 0)
                                {
                                        // Clear the UI display.
                                }
                }
}
public void OnEvent(EventType eventType, IData data)
{
        string message; 
        switch (eventType);
                {
                        case EventType.TransactionResult:
                                /* data[0]	– Signature Required 
                                data[1..2] – Batch Data length
                                data[3..n] – remainder contains the Batch Data TLV object
                                */

                        // Parse the TLV from data[].
                        // Abstract Approval status from TLV tag β€œDFDF1A”.
                        // Abstract Signature Required status from TLV tag data[0].
        }
}

Flow Chart – Signature Capture

Sample Code – Signature Capture

The following breaks out the EMV flow chart into code. Events are shown separately and in the order received.

// Assign parameters.
List<PaymentMethod> paymentMethod = new List<PaymentMethod>(); paymentMethod.Add(PaymentMethod.MSR); paymentMethod.Add(PaymentMethod.Contact); paymentMethod.Add(PaymentMethod.Contactless);

transaction = new Transaction();
transaction.Amount = β€œ1.00”;
transaction.CashBack = β€œ0.00”; transaction.EMVOnly = true; transaction.PaymentMethods = paymentMethod; transaction.QuickChip = true;

// Start transaction.
bool result = device.startTransaction(transaction);
public void OnEvent(EventType eventType, IData data)
{
        string message; 
        switch (eventType);
                {
                        case EventType.DisplayMessage:

                                // Get the message.
                                message = data.StringValue;
        }
}
 public void OnEvent(EventType eventType, IData data)
{
string message; 
switch (eventType);
        {
        case EventType.InputRequest:
        // Get the message.
        message = data.StringValue;

        // display/retrieve user selection.

        // set status and selection result.
        IData selectionData = new BaseData(new Byte[] {status, selection});
        device.sendSelection(selectionData);
    }
}
public void OnEvent(EventType eventType, IData data)
{
        byte[] ARQC = null; 
        switch (eventType);
                {
                        case EventType.AuthorizationRequest:
                                // #4a
                                // Forward ARQC to processor.
                                /* data[0..1] – ARQC length
                                data[2..n] – remainder contains the ARQC TLV object */
                }
}
public void OnEvent(EventType eventType, IData data)
{
        string message; 
        switch (eventType);
                {
                        case EventType.DisplayMessage:
                                // Display approval message. 
                                message = data.StringValue;

                                // A data size of 0 is an instruction to clear the display. 
                                if (data.StringValue.Length == 0)
                                {
                                        // Clear the UI display.
                                }
                        }
}
public void OnEvent(EventType eventType, IData data)
{
        string message; 
        switch (eventType);
                {
                        case EventType.TransactionResult:
                                /* data[0]	– Signature Required 
                                data[1..2] – Batch Data length
                                data[3..n] – remainder contains the Batch Data TLV object
                                */

                                // Parse the TLV from data[].
                                // Abstract Approval status from TLV tag β€œDFDF1A”.
                                // Abstract Signature Required status from TLV tag data[0].
                }
}
public void OnEvent(EventType eventType, IData data)
{
        String signature; 
        switch (eventType);
                {
                        case EventType.Signature: 
                        signature = data.StringValue;
                }
}

Sample Code – With ARPC

The following breaks out the EMV flow chart into code. When disabling QuickChip mode, host must send the ARPC to the device to complete the transaction. Events are shown separately and in the order received.

C.1 Sample Code – With ARPC

The following breaks out the EMV flow chart into code. When disabling QuickChip mode, host must send the ARPC to the device to complete the transaction. Events are shown separately and in the order received.

// Assign parameters.
List<PaymentMethod> paymentMethod = new List<PaymentMethod>(); paymentMethod.Add(PaymentMethod.MSR); 
paymentMethod.Add(PaymentMethod.Contact); 
paymentMethod.Add(PaymentMethod.Contactless);

transaction = new Transaction();
transaction.Amount = β€œ1.00”;
transaction.CashBack = β€œ0.00”; 
transaction.EMVOnly = true; 
transaction.PaymentMethods = paymentMethod;
transaction.QuickChip = false; //QuickChip mode disabled.

// Start transaction.
bool result = device.startTransaction(transaction);
public void OnEvent(EventType eventType, IData data)
{
        string message; 
        switch (eventType);
                {
                        case EventType.DisplayMessage:

                                // Get the message.
                                message = data.StringValue;
        }
}
 public void OnEvent(EventType eventType, IData data)
{
        string message; 
        switch (eventType);
                {
                        case EventType.InputRequest:

                                // Get the message.
                                message = data.StringValue;

                                // display/retrieve user selection.
        
                                // set status and selection result.
                                IData selectionData = new BaseData(new Byte[] {status, selection});
                                device.sendSelection(selectionData);
                }
}
public void OnEvent(EventType eventType, IData data)
{
        byte[] ARQC = null; 
        switch (eventType);
                {
                        case EventType.AuthorizationRequest:
                                // Forward the ARQC to the processor.
                                /* data[0..1] – ARQC length
                                data[2..n] – remainder contains the ARQC TLV object */

                                ARQC.ByteArray = data.ByteArray;
                                // App function to send the request to the processor. 
                                ARPC = sendARQCToProcessorForApproval(ARQC.ByteArray);

                }
}

After the ARPC is returned from the processor, it is constructed into a TLV container and then sent to the device. The ARPC for approved (00) is set in ASCII 3030.

The optional tags 91, 71, and 72 (Issuer Authentication Data, Issuer Script Template 1, and Issuer Script Template 2) are not included in this example.

See the construction of the ARPCTLV in the table below.

ARPC TLV object for sendAuthorization().

The use case for an MSR fallback is when communication with the chip results in a terminated transaction and the TransactionStatus is reported as MSRFallback.

The host application will re-attempt the transaction. To invoke this use case, here are the following pre-requisites.

Pre-requisites:

  • Device already configured for Device-Driven Fallback = Disabled.

  • A card to cause the fallback. Example but not limited to a card with no applications programmed or a card with an application not configured on the device.

Scheme:

  • --> Host begins an initial transaction with PaymentMethod set to MSR+Chip+Contactless.

  • <β€” Device responds with fail and with status of MSRFallback.

  • --> Host displays a message to use magstripe.

  • --> Host starts a transaction with PaymentMethod set to MSR.

Begin initial transaction:

Continue with Fallback transaction:

This section demonstrates transaction flow.

<β€” Device may respond with transaction cancelled card read error.
  • --> Host displays a message each time the transaction fails until successful or until Host decides to end the transaction.

  • <β€” Device sends the transaction result.

  • String ARPC = β€œ8A3030”;
    IData ARPCTLV = new BaseData("");
    ARPCTLV.StringValue = "FF7413DFDF250742363243413546FA067004” + ARPC;
    
    device.sendAuthorization(ARPCTLV);

    Tag

    Len

    Value / Description

    Typ

    Req

    Default

    FF74

    var

    Container for non-MAC ARPC

    T

    R

    /DFDF25

    var

    Device Serial Number (IFD Serial Number)

    Tag

    Len

    Value / Description

    Typ

    Req

    Default

    ///71

    var

    Issuer Script Template 1

    As defined in EMV Integrated Circuit Card Specifications for Payment Systems 4.3. The host may include as many instances of this parameter as needed, up to a maximum length of 128 bytes including Tags and Lengths.

    B

    O

    ///72

    var

    Issuer Script Template 2

    As defined in EMV Integrated Circuit Card Specifications for Payment Systems 4.3. The host may include as many instances of this parameter as needed, up to a maximum length of 128 bytes including Tags and Lengths.

    B

    public void OnEvent(EventType eventType, IData data)
    {
            string message; 
            switch (eventType);
                    {
                            case EventType.DisplayMessage:
                                    // Display approval message. 
                                    message = data.StringValue;
    
                                    // A data size of 0 is an instruction to clear the display. 
                                    if (data.StringValue.Length == 0)
                                    {
                                            // Clear the UI display.
                                    }
                    }
    }
    public void OnEvent(EventType eventType, IData data)
    {
            string message; 
            switch (eventType);
                    {
                            case EventType.TransactionResult:
                                    /* data[0]	– Signature Required 
                                    data[1..2] – Batch Data length
                                    data[3..n] – remainder contains the Batch Data TLV object
                                    */
    
                                    // Parse the TLV from data[].
                                    // Abstract Approval status from TLV tag β€œDFDF1A”.
                                    // Abstract Signature Required status from TLV tag data[0].
                    }
    }
    public void OnEvent(EventType eventType, IData data)
    {
            String signature; 
            switch (eventType);
                    {
                            case EventType.Signature: 
                                    signature = data.StringValue;
                    }
    }

    MSR Fallback Flow

    B

    R

    /FA

    var

    Container for generic data

    T

    R

    //70

    var

    Container for ARPC

    T

    R

    ///8A

    02

    Authorization Response Code

    Β· 0x3030 = Approved

    Β· 0x3031 = Issuer Referral

    Β· 0x3035 = Declined

    Β· 0x3132 = Switch Interface

    Β· 0x3133 = Request Online PIN

    AN

    R

    ///91

    var

    Issuer Authentication Data

    As defined in EMV Integrated Circuit Card Specifications for Payment Systems 4.3

    B

    O

    O

    Appendix B - API Walk Through

    CoreAPI Walk Trough

    The following walks through how to create instances of a device.

    • CoreAPI.createDevice Γ  IDevice

    • CoreAPI.getDeviceList Γ  List<IDevice>

    • CoreAPI.createPPSCRA Γ  MTPPSCRA

    These examples demonstrate methods for creating an IDevice to be used in the MagTek Universal SDK. This also shows how to establish a device specific API, which is not used with the MagTek Universal SDK.

    Here, a single of IDevice is established.

    // Access MMS with Universal SDK using createDevice()
    
    IDevice mtmms = CoreAPI.createDevice( 
        DeviceType.MMS, 
        ConnectionType.USB,
        "",
        "",
        "DynaFlex", "");
    mtmms.requestSignature(0xff);

    Here, a list of IDevice is established. The first device is accessed at index 0.

    Here the CoreAPI creates an instance of MTPPSCRA. The MTPPSCRANET is referenced and its library file is included in the application development project.

    The following walks through how to make use of IDevice.

    • Implement device events within the class to receive events.

    • CoreAPI --> IDevice.

    • IDevice --> subscribeAll().

    • IDevice --> other functions.

    • IDevice Γ  startTransaction().

    Example

    Application Main window may extent the IEventSubscriber Delegate, or events can be interfaced by a separate class. This example uses a separate class and demonstrates how to parse for the various event types.

    Example

    Various events are separately shown below.

    The following walks through how to make use of IDeviceControl.

    • IDevice Γ  IDeviceControl.

    • IDeviceControl Γ  open().

    • IDeviceControl Γ  other functions.

    • IDeviceControl Γ  close().

    Example

    The following walks through how to make use of ConnectionInfo.

    • IDevice --> ConnectionInfo.

    • ConnectionInfo --> getAddress()

    • ConnectionInfo --> getConnectionType()

    • ConnectionInfo --> getDeviceType() Example

    The following walks through how to make use of IDeviceCapabilities.

    Β· IDevice Γ  IDeviceCapabilities.

    Β· IDeviceCapabilities Γ  BatteryBackedClock() to check if date/time should be set.

    Β· IDeviceCapabilities Γ  PaymentMethods() to check card types supported.

    Β· IDeviceCapabilities Γ  other functions.

    The following walks through how to make use of IDeviceConfiguration.

    • IDevice Γ  getDeviceConfiguration().

    • IDeviceConfiguration Γ  updateFirmware().

    • IDeviceConfiguration Γ  getConfiguration().

    • IDeviceConfiguration Γ  setConfiguration().

    • IDeviceConfiguration Γ  other functions.

    Example

    Application Main window may extent the IConfigurationCallback Delegates or can be extended by a separate class. This example uses a separate class and demonstrates how to parse for the various events.

    Example

    IDevice Walk Through

    Handling Events

    IDeviceControl Walk Through

    ConnectionInfo Walk Through

    IDeviceCapabilities Walk Through

    IDeviceConfiguration Walk Through

    Handling Events

    // Acess MMS with Universal SDK using getDeviceList()
    
    List<IDevice> mtmms = CoreAPI.getDeviceList(DeviceType.MMS); 
    mtmms[0].requestSignature(0xff); 
    Using MTUSDKNET; 
    Using MTPPSCRANET;
    
    
    // Directly access PPSCRA with MTPPSCRANET by createPPSCRA()
    
    MTPPSCRANET.MTPPSCRA mtppscra = CoreAPI.createPPSCRA(); 
    mtppscra.openDevice("");
    mtppscra.requestSignature(30, 2, 0);
    Using MTUSDKNET;
    .
    // Extend the main window to receive events.
    public class MainWindow : IEventSubscriber, IConfigurationCallback
    {
     
    // Establish a device from CoreAPI.
    List<IDevice> deviceList = CoreAPI.getDeviceList(); 
    IDevice device = deviceList[0];
     
    /* For a list of a single device type. 
    DeviceType deviceType = DeviceType.MMS; 
    List<IDevice> deviceList = CoreAPI.getDeviceList(deviceType); 
    IDevice device = deviceList[0];
    */
     
    /* For a list of multiple device types. List<DeviceType> deviceTypes = null; deviceTypes.Add(DeviceType.MMS); 
    deviceTypes.Add(DeviceType.CMS);
    List<IDevice> deviceList = CoreAPI.getDeviceList(deviceTypes); 
    IDevice device = deviceList[0];
    */
     
    /* Suscribe to events sent from the device.
        These would be but not limited to: card inserted, card removed, connection state...
     
        Set MainWindow to receive the events. */ 
    bool return = device.unsubscribeAll(this); 
    bool return = device.subscribeAll(this);
     
    /* To handle events from some other class. 
    EventsVector eventsVector = new EventsVector() 
    bool return = device.unsubscribeAll(eventsVector); 
    bool return = device.subscribeAll(eventsVector);
    */
    
    // Assign parameters for the transaction. ITransaction transaction = new Transaction(); transaction.Amount = β€œ1.00”;
    transaction.CashBack = β€œ0.00”;
    transaction.EMVOnly = true;
    transaction.PaymentMethods = new List<PaymentMethod>(); transaction.PaymentMethods.Add(PaymentMethod.MSR); transaction.PaymentMethods.Add(PaymentMethod.Contact); transaction.PaymentMethods.Add(PaymentMethod.Contactless); transaction.QuickChip = false;
    
    // Start transaction.
    bool result = device.startTransaction(transaction);
    
    // Assign parameters for the transaction. ITransaction transaction = new Transaction(); transaction.Amount = β€œ1.00”;
    transaction.CashBack = β€œ0.00”;
    transaction.EMVOnly = true;
    transaction.PaymentMethods = new List<PaymentMethod>(); transaction.PaymentMethods.Add(PaymentMethod.MSR); transaction.PaymentMethods.Add(PaymentMethod.Contact); transaction.PaymentMethods.Add(PaymentMethod.Contactless); transaction.QuickChip = false;
    
    // Start transaction.
    bool result = device.startTransaction(transaction);
    // A class to handle events.
    public class EventsVector : IEventSubscriber
    {
            public void OnEvent(EventType eventType, IData data)
            {
                    switch (eventType)
                    {
    case EventType.ConnectionState:
    // Parse for the ConnectionState 
    ConnectionState value =
    ConnectionStateBuilder.GetValue(data.StringValue);
    
    break;
    case EventType.DeviceResponse:
    
    break;
    case EventType.DeviceExtendedResponse:
    
    break;
    case EventType.DeviceNotification:
    
    break;
    case EventType.CardData:
    
    break;
     case EventType.TransactionStatus:
    // Parse for the transaction status code and detail. 
    TransactionStatus status = 
    TransactionStatusBuilder.GetStatusCode(data.StringValue);
    
    string statusDetail = 
    TransactionStatusBuilder.GetStatusDetail(data.StringValue);
    
    break;
    case EventType.DisplayMessage: 
    
    string message;
    
    // Get the message.
    message = data.StringValue;
    
    break;
    case EventType.InputRequest:
    
    break;
     case EventType.AuthorizationRequest:
    
    // Forward ARQC to processor.
    /* data[0..1] – ARQC length
    data[2..n] – remainder contains the ARQC TLV object
    */
    
    IData ARQC = new BaseData(data.ByteArray);
    
    // App function to send the request to the processor.
    string ARPC = sendARQCToProcessorForApproval(ARQC.ByteArray);
    
    // Send authorization to device when not in QuickChip mode. IData ARPCTLV = new BaseData("");
    ARPCTLV.StringValue = "FF7413DFDF250742363243413546FA067004” + ARPC;
    
    if (transaction.QuickChip == false)
    {
    device.sendAuthorization(ARPCTLV);
    }
    
    break;
     case EventType.TransactionResult:
     
     /* data[0]– Signature Required
     data[1..2] – Batch Data length
     data[3..n] – remainder contains the Batch Data TLV object
    */
    
    // Parse the TLV from data[].
    // Abstract Approval status from TLV tag β€œDFDF1A”.
    // Abstract Signature Required status from TLV tag at data[0].
    break;
    case EventType.PINData:
    
    break;
    case EventType.Signature:
    
    break;
    case EventType.TransactionStatus:
    
    /*
    Transaction status enumeration is build from the TransactionStatusBuilder.
    */
    TransactionStatus status = TransactionStatusBuilder.GetStatusCode(data.StringValue);
    
    if (status == TransactionStatus.CardSwiped)
    {
    //
    }
    if (status == TransactionStatus.CardInserted)
    {
    //
    }
    if (status == TransactionStatus.TransactionApproved)
    {
    //
    }
    
    break;
    // Establish a device from CoreAPI.
    List<IDevice> deviceList = CoreAPI.getDeviceList(); 
    IDevice device = deviceList[0];
    
    // Establish a deviceControl from device.
    IDeviceControl deviceControl = device.getDeviceControl();
    
    // Open the device, then use the IDeviceControl functions. 
    deviceControl.open();
    
    . . .
    // Close the device. deviceControl.close();
    // Establish a device from CoreAPI.
    List<IDevice> deviceList = CoreAPI.getDeviceList(); 
    IDevice device = deviceList[0];
    
    // Establish a ConnectionInfo from device.
    ConnectionInfo connectionInfo = device.getConnectionInfo();
    
    // Retrieve address, connectionType, and deviceType. 
    string address = connectionInfo.getAddress();
    ConnectionType connectionType = connectionInfo.getConnectionType(); 
    DeviceType deviceType = connectionInfo.getDeviceType();
    // Establish a device from CoreAPI.
    List<IDevice> deviceList = CoreAPI.getDeviceList(); IDevice device = deviceList[0];
    
    // Establish a ConnectionInfo from device.
    ConnectionInfo connectionInfo = device.getConnectionInfo();
    
    // Retrieve address, connectionType, and deviceType. 
    string address = connectionInfo.getAddress();
    ConnectionType connectionType = connectionInfo.getConnectionType(); 
    DeviceType deviceType = connectionInfo.getDeviceType();
    // Establish a device from CoreAPI.
    List<IDevice> deviceList = CoreAPI.getDeviceList();
     IDevice device = deviceList[0];
     
    IDeviceConfiguration devConfig = device.getDeviceConfiguration();
    
    IDeviceControl devControl = device.getDeviceControl(); devControl.open();
     
    /* To handle events from some other class. ConfigCallBacks configCallBacks = new ConfigCallBacks();
    */
    
    // Update firmware.
    byte[] data = System.IO.File.ReadAllBytes(β€œfilepath”);
    int return = devConfig.updateFirmware(0x01, data, this);
     
    /* Get configuration.
                    Device-Driven Fallback OID = 1.2.1.1.1.1
                                    contructed OID = E2 08 E1 06 E1 04 E1 02 C1 00
                    Note: first digit of OID is ommited in the construction and instead is passed in the configType.
    */
    byte configType = 0x01;
    data = new byte[] {0xE2,0x08,0xE1,0x06,0xE1,0x04,0xE1,0x02,0xC1,0x00
    };
    byte[] response = devConfig.getConfigInfo(configType, data);
     
     
    /* Set configuation.
    Device-Driven Fallback OID is 1.2.1.1.1.1
    Disabled contructed OID = E2 09 E1 07 E1 05 E1 03 C1 01 00
    Enabled contructed OID = E2 09 E1 07 E1 05 E1 03 C1 01 01
    Note: first digit of OID is ommited in the construction and instead is passed in the configType.
    
    */
    data = new byte[]
    {0xE2,0x09,0xE1,0x07,0xE1,0x05,0xE1,0x03,0xC1,0x01,0x00 };
    // A class to handle configuration callback events.
    public class ConfigCallbacks : MTUSDKNET.IConfigurationCallback
    {
        public void OnProgress(int progress)
        {
            /* Handle progress.
            Progress is complete when progress = 100 */
        }
    public void OnResult(StatusCode status, byte[] data)
    {
        /* Handle result.
            A configuration process is complete when status = StatusCode.Success */
    }
        public IResult OnCalculateMAC(byte macType, byte[] data)
        {
            IResult result = new Result(StatusCode.UNAVAILABLE); 
            byte[] macBytes = null;
    
            DeviceType deviceType = 
                device.getConnectionInfo().getDeviceType();
    
            switch (deviceType)
            {
                case DeviceType.MMS:
                    macBytes = getDynaFlexMAC(macType, data); 
                    break;
            }
            
            if (macBytes != null)
            {
                result = new Result(StatusCode.SUCCESS); 
                result.Data = new BaseData(macBytes);
            }
    
            return result;
        }
    }

    Appendices

    Appendices

    Supplementary reference for the MagTek Universal SDK for .NET: the library status codes and supported-function list, a step-by-step walk-through of the main interfaces, flow charts and sample code for EMV transactions, and integration guidance for mobile-wallet value-added services (Apple VAS and Google Wallet Smart Tap).

    In This Section

    Reference Section

    Information Available

    The library status codes returned by the SDK, plus a supported-function list showing which API calls each device type supports.

    Sample code showing how to create a device through CoreAPI, subscribe to and handle events, and use IDevice, IDeviceControl, ConnectionInfo, IDeviceCapabilities, and IDeviceConfiguration in a typical integration.

    Flow charts and sample code for QuickChip, signature-capture, and full ARPC transactions, plus the MSR fallback flow for when a chip read fails.

    D: Apple VAS

    Configuring merchant ID and URL slots, declaring POS capabilities, and starting a transaction that reads Apple Wallet passes over contactless, including how to interpret the response.

    E: Google Wallet Smart Tap VAS

    Loading the Smart Tap key, configuring collector ID slots and POS capabilities, and starting a transaction that reads Google Wallet passes over contactless, including how to interpret the response.

    Need More Help

    Need Help?

    For additional support, please contact MagTek Support:

    Technical Support:

    • πŸ“§ Email: support@magtek.com

    • πŸ“ž Phone: 1-562-546-6800 (US)

    • πŸ• Hours: Monday-Friday, 5:30 AM - 5:00 PM Pacific

    Online Resources:

    • 🌐 Support Portal: developer.magtek.com

    • 🌐 Official Site:

    Documentation Feedback:

    Help us improve this documentation!

    A: Status Codes
    B: API Walk Through
    C: EMV Transaction Flow
    https://www.magtek.com
    feedback@magtek.com