6 how to debug the api, 7 how to send a transaction, How to debug the api – MagTek EC2000 99875713 User Manual

Page 9: How to send a transaction, 1 - introduction

Advertising
background image

1 - Introduction

ExpressCard 2000| Instant Issuance Card Personalization System | Programmer’s Reference (Windows SDK)

Page 9 of 21

1.6 How to Debug the API

To debug problems with sending transactions to a device, you can use the error logging function of the
ExpressCard Demo GUI software. With this option enabled, all errors returned from the device are
logged into log file named Demo.log in the ExpressCard Demo GUI installation folder.

1.7 How to Send a Transaction

The general sequence of function calls to create and send a transaction that produces a single card is:

1) Find the EC2000 device using MTECSDK_GetDevice.

2) Open the found device by calling using MTECSDK_OpenDevice.

3) Allocate memory to a string buffer that stores the XML to send to the device.

4) Use MTECSDK_SetValue to set each of the key-value pairs that define the card design, including

image files, text lines, magstripe data, embosser data, and so on. The key-value pairs are stored in the
buffer allocated previously.

5) Send the transaction to the device using MTECSDK_ProcessDoc.

6) Examine the return value from MTECSDK_ProcessDoc to determine if an error occurred. The

return values are documented in section 2.7 MTECSDK_ProcessDoc.

7) Examine the results of the transaction returned by the device by calling MTECSDK_GetValue to

retrieve key-value pairs from the transaction information returned in the pcDocInfo buffer passed by
MTECSDK_ProcessDoc

, which contains the transaction information and the device’s information.

The full list of return codes can be found in the appendices of 99875611 ExpressCard 2000
Programmer’s Reference (XML)
.

8) After all transactions have been sent, call MTECSDK_CloseDevice to close the connection to the

device.


Advertising