Smart COMM VB6

1. Driver installation.

The terminals are connected to POS through USB port, it is necessary to install the corresponding drivers since Windows needs them to detect the device. To install the device drivers it is necessary to unzip the file USBDriver_V2.22_20180726.zip, run the installer USBDriver.exe and follow the instructions on the screen.

Once the drivers installation are done, Windows will detect our Smart Pin Pad device and assign it to a working serial port. To watch the assigned serial port, it can be viewed on Control Panel, in the Hardware Devices section, under the Ports (COM & LPT) menu.

1206

2. POS demo.

There is a Demo POS to simulate the transactions of Sale, Cancellation and Reprint.

Download the Demo “vb6-connector-demo-dev.zip” from the drive unzip make the references to the dll and tlb depending x64 or x86 architecture as indicated in point [ 3.- Component installation.](https://docs.netpay.com.mx/docs/smart-comm-vb6#3-instalación-e-integración-de -components)

1175

3. Installation and integration of components.

3.1 Installation of components.

To integrate with the terminal, the following files are included, which must be imported into th POS project. The DLLs have as Target .NET 3.5 Framework or higher.

NetPayConnect.dll (Connector for Smart PinPad DEV terminal).

NetpayConnect.tlb (Library required for Visual 6.0).

The dll files can be downloaded from the following drive folder “NetpayConnect_v1.1”:

📘

Note.

Depending on the type of development, it is necessary to verify if it is in x64 or x86 architecture since the corresponding dll must be added.

Steps for the installation of the components.

Open Windows Command Prompt (CMD) in Administrator mode

Execute the line --> cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 (Path where the netframework is installed)

Followed by --> RegAsm.exe "C:\Utilities\NetPayConnect.dll" /tlb:NetPayConnect.tlb /codebase

Where C:\ Is the path where the necessary files to install (dll and tlb) are located.

📘

Note.

If for some reason the assignment of the .tlb file does not work, a new one can be generated by locating the .dll file with the following commands:
Execute the line --> cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 (Path where the netframework is installed)
Followed by -> RegAsm.exe "C:\Utilities\NetPayConnect.dll" /tlb /codebase

3.2 Component integration.

The NetpayConnect.dll component is a library that can be integrated into any Windows-based development language that supports this type of library. Currently the library is compiled for x86 platforms in order to work on x86 (32-bit) and x64 (64-bit) platforms, depending on the case.

Reference DLL to Visual Basic6.

Open the Project Tab and click on References. On the References screen, click on the browse option and search for the file with the tlb extension once added, select the NetPayConnect Reference from the list.

532 517 525

4. Library integration.

The SmartPinPad DEV application already contains the functionality by default or Method SendData()
The library contains a class called Operator which is used to call the methods.
The SendData() method makes or processes Visa, MasterCard and American Express branded credit and debit card payments.

📘

Note.

In the general class the line is added to be able to use the dll. In the case of Visual Studio 6, the .tlb is integrated

Example of how to use the dll once it is referenced and installed on windows:

Dim conector As NetPayConnect.Operator 
Set conector = New NetPayConnect.Operator

The parameters received by the Operator method are listed below (It defines the type of transaction to execute, it can receive the following values):

FieldDescription
setAmount()The amount to be collected is assigned. Receives a value of type Double (only accepts 2 decimal places).
setMSI()The number of months without interest is assigned at the time of processing the transaction.
By default, the value 0 (without months) is sent.
Possible values that it accepts: 3, 6, 9, 12, 18.
setFolio()The personalized folio to be used in the Ticket is assigned.
sendData()Once the minimum amount has been assigned, this method is called to process the transaction on the PinPad.
sendPrint()Reprint a transaction (requires orderId). To perform a test transaction we must use at least the setAmount() method to place the amount to be charged and process the transaction with the sendData() method.
ReceiveData()After executing a send type method, the ReceiveData() type is activated, which activates the reading of the port. This returns a reply message in text.

4.1 Reading the authorization request response.

After executing the SendData() method, the connector will send the transaction to the Smart PinPad DEV which processes the transaction and will return the parameters that show the result of the operation.

To read the transaction response, the component returns a boolean value indicating true if everything was processed successfully and false otherwise.

The process for processing a transaction is as follows:

  1. The point of sale assigns the necessary parameters, SetAmount.
  2. The point of sale executes the SendData() method.
  3. The connector activates communication with the Pinpad device and requests that the customer's card be swiped, inserted or contactless on the Pinpad.
  4. Upon receipt of the card data the PinPad processes the transaction.
  5. The point of sale reads the transaction return variables by calling the RecieveData() method.
  6. The GetResponse() method is given, which returns an object of type data:

The variables that can be read when the GetResponse() event is executed, will obtain a response type object which contains an idReport property and another object which contains all the properties of the sale.

idReport: Contains the type of object that can be the following:

EARRING

Example of code to obtain the data of the sale:

Dim conector As NetPayConnect.Operator 
 Dim ResponseData As NetPayConnect.Response 
 Set conector = New NetPayConnect.Operator 
      conector.SetAmount CDbl(Val(txtAmount.Text))
      conector.SetTip CDbl(Val(txtTip.Text))
      conector.SetFolio (txtFolio.Text)
      conector.SetMSI (Val(cmbMsi.Text))
     Text1.Text = ""
     lblResult.Text = ""
    Dim resultRead As String
    resultRead = conector.sendData()

Set ResponseData = conector.GetResponse() if ResponseData is Nothing Then Exit Sub  	if ResponseData.idReport = 1 then  
 	 	‘ obtiene datos de la venta 
 	Else if ResponseData.idReport = -1 then 
 	 	‘ ocurrió un error en la venta 	 
 	End if   	 
  	 
End if

Response data

IdField nameDescriptionDatatype
1affiliationIt contains the affiliation number assigned by the bank to a store which must be printed on the transaction receipt.VARCHAR2(50 BYTE)
2applicationLabelInformation on card reading.VARCHAR2(100 BYTE)
3arqcIt contains a cryptogram that must be printed on the customer's receipt, as long as a CHIP card is read.VARCHAR2(250 BYTE)
4aidInformation on card reading.VARCHAR2(50 BYTE)
5amountTotal amount of the transaction with everything and tip.NUMBER(15,2)
6authCodeValue generated by the authorization authority for an approved transaction.VARCHAR2(7 BYTE)
7bankNameName of the financial institution issuing the card.VARCHAR2(250 BYTE)
8cardExpDateCard expiration date in MM/YY format.VARCHAR2(5 BYTE)
9cardTypeCard type identifier. Debit (D), credit (C).VARCHAR2(20 BYTE)
10cardTypeNameRepresents the name of the card brand type, Visa, Master Card, etc.VARCHAR2(250 BYTE)
11cityNameCity with which the trade was registered.VARCHAR2(150 BYTE)
12responseCodeIt contains a two position code that indicates if a transaction was authorized or declined, if the value is 00 the transaction was authorized, any other value than 00 is considered a declined transaction.VARCHAR2(2 BYTE)
13folioNumberTransaction identification number that can be sent in the sale request.VARCHAR2(250 BYTE)
14hasPinReturns a boolean value which indicates if it requires a signature or is by pin.false o true
15hexSignEncrypted autograph signature only in the event that the card does not have a PIN.VARCHAR2(4000 BYTE)
16internalNumberNetPay internal folio.VARCHAR2(20 BYTE)
17isQpsIndicates the amount charged by quick payment serviceVARCHAR2(1 BYTE)
18messageMessage indicating the status of the transaction. You can indicate if it was accepted or declined and for what reason.
Example: Approved, Declined, Insufficient Funds.
VARCHAR2(200 BYTE)
19moduleChargeInternal identifier.VARCHAR2(20 BYTE)
20moduleLoteInternal identifier.NUMBER (9)
21customerNameName of the cardholder.VARCHAR2(100 BYTE)
22terminalIdTerminal serial number.VARCHAR2(20 BYTE)
23orderIdTransaction number identifier. It can be used later in reprint and cancellation.VARCHAR2(36 BYTE)
24preAuthPre-authorization.NUMBER (9)
25preStatusPre-authorization.NUMBER(15,2)
26promotionIndicates the number of months without interest in which a transaction was partialized.VARCHAR2(20 BYTE)
27rePrintDateIndicates the version of the application.VARCHAR2(100 BYTE)
28rePrintMarkInternal identifier.VARCHAR2(100 BYTE)
29reprintModuleInternal identifier.VARCHAR2(1 BYTE)
30cardNumberIt contains the last four digits of the card that must be displayed on the customer's receipt.VARCHAR2(50 BYTE)
31storeNameName of the trade registered.VARCHAR2(60 BYTE)
32streetNameRegistered business address.VARCHAR2(150 BYTE)
33ticketDateDate and time of the transaction.VARCHAR2(100 BYTE)
34tipAmountIndicate the amount for tip, if sent.NUMBER
35tipLessAmountIndicates the amount less tip.NUMBER(15,2)
36transDateDate and time of the transaction.DATE
37transTypeIndicates the type of operation performed. Sale (A), Cancellation (V).VARCHAR2(5 BYTE)
38transactionCertificateInformation on card reading.VARCHAR2(50 BYTE)

4.2 Transaction Refund Request

Message to cancel a sale (Auth) made on the same day. Only the orderId parameter is used and the sendCancel() method is called

Dim conector As NetPayConnect.Operator  
Set conector = New NetPayConnect.Operator  
conector.sendCancel(orderId)

4.3 Transaction Reprint Request.

Message to reprint a sale, only the orderId parameter is used and the *sendPrint() method is called:

Dim conector As NetPayConnect.Operator  
Set conector = New NetPayConnect.Operator  
conector.sendPrint(orderId)

4.4 Port Display Available

You can ask the dll which port the pinpad is connected to.

Dim conector As NetPayConnect.Operator 
 Set conector = New NetPayConnect.Operator 
Dim texto As String 
 Texto = conector.findPortByDescription()

4.5 Version request message

Message requesting the version of the dll.

Dim conector As NetPayConnect.Operator 
 Set conector = New NetPayConnect.Operator 
Dim texto As String 
 Texto = conector.Version()

4.6 Receiving Response.

Way of receiving the response: Extract information from the object manually.

textBox4.Text += System.Environment.NewLine + "Afiliacion: " + connectorPAX.getAffiliation();
                textBox4.Text += System.Environment.NewLine + "ApplicationLabel: " + connectorPAX.getApplicationLabel();
                textBox4.Text += System.Environment.NewLine + "ARQC: " + connectorPAX.getARQC();
                textBox4.Text += System.Environment.NewLine + "AID: " + connectorPAX.getAID();
                textBox4.Text += System.Environment.NewLine + "Amount: " + connectorPAX.getAmount();
                textBox4.Text += System.Environment.NewLine + "AuthCode: " + connectorPAX.getAuthCode();
                textBox4.Text += System.Environment.NewLine + "BankName: " + connectorPAX.getBankName();
                textBox4.Text += System.Environment.NewLine + "CardExpDate: " + connectorPAX.getCardExpDate();
                textBox4.Text += System.Environment.NewLine + "CardType: " + connectorPAX.getCardType();
                textBox4.Text += System.Environment.NewLine + "CardTypeName: " + connectorPAX.getCardTypeName();
                textBox4.Text += System.Environment.NewLine + "CityName: " + connectorPAX.getCityName();
                textBox4.Text += System.Environment.NewLine + "ResponseCode: " + connectorPAX.getResponseCode();
                textBox4.Text += System.Environment.NewLine + "HasPin: " + connectorPAX.getHasPin();
                textBox4.Text += System.Environment.NewLine + "HexSign: " + connectorPAX.getHexSign();
                textBox4.Text += System.Environment.NewLine + "IsQps: " + connectorPAX.getIsQPS();
                textBox4.Text += System.Environment.NewLine + "Message: " + connectorPAX.getMessage();
                textBox4.Text += System.Environment.NewLine + "ModuleCharge: " + connectorPAX.getModuleCharge();
                textBox4.Text += System.Environment.NewLine + "ModuleLote: " + connectorPAX.getModuleLote();
                textBox4.Text += System.Environment.NewLine + "CustomerName: " + connectorPAX.getCustomerName();
                textBox4.Text += System.Environment.NewLine + "TerminalId: " + connectorPAX.getTerminalId();
                textBox4.Text += System.Environment.NewLine + "OrderId: " + connectorPAX.getOrderId();
                textBox4.Text += System.Environment.NewLine + "PreAuth: " + connectorPAX.getPreAuth();
                textBox4.Text += System.Environment.NewLine + "PreStatus: " + connectorPAX.getPreStatus();
                textBox4.Text += System.Environment.NewLine + "Promotion: " + connectorPAX.getPromotion();
                textBox4.Text += System.Environment.NewLine + "RePrintDate: " + connectorPAX.getRePrintDate();
                textBox4.Text += System.Environment.NewLine + "RePrintMark: " + connectorPAX.getRePrintMark();
                textBox4.Text += System.Environment.NewLine + "ReprintModule: " + connectorPAX.getReprintModule();
                textBox4.Text += System.Environment.NewLine + "CardNumber: " + connectorPAX.getCardNumber();
                textBox4.Text += System.Environment.NewLine + "StoreName: " + connectorPAX.getStoreName();
                textBox4.Text += System.Environment.NewLine + "StreetName: " + connectorPAX.getStreetName();
                textBox4.Text += System.Environment.NewLine + "TicketDate: " + connectorPAX.getTicketDate();
                textBox4.Text += System.Environment.NewLine + "TipAmount: " + connectorPAX.getTipAmount();
                textBox4.Text += System.Environment.NewLine + "TipLessAmount: " + connectorPAX.getTipLessAmount();
                textBox4.Text += System.Environment.NewLine + "TransDate: " + connectorPAX.getTransDate();
                textBox4.Text += System.Environment.NewLine + "TransType: " + connectorPAX.getTransType();
                textBox4.Text += System.Environment.NewLine + "TransactionCertificate: " + connectorPAX.getTransactionCertificate();
                textBox4.Text += System.Environment.NewLine + "FolioId: " + connectorPAX.getFolioNumber();

Example:

Afiliacion: 7389108
ApplicationLabel: VISA CREDITO
ARQC: 103426BD75921F19
AID: A0000000031010
Amount: 10.0
AuthCode: 222222
BankName: BANORTE
CardExpDate: 01/21
CardType: C
CardTypeName: VISA
CityName: Guadalupe NUEVO LEON
ResponseCode: 00
HasPin: False
HexSign: 00000100000001DA0000009E000000040800031CFF02FF02D300A765326D2D0CBD4D9EDC98BA66222EA38BE00018815E50F59690AD9333263380FF021DF3C9146D3985ACCC16DE2FFB173F34E1A1655AEF8F1B10F2C9E5AEE831827C42DB2284F64D87CE62FF020583DCA4E7C4BD12FB3AFDFF0018647662396A7BD59338D300BBF6FCFF0083DD89FF02FF02BE8680FF02FF027CFF02C980FF02FF02FF02FF02D44BD5210821BAD6436612BCE2A5A1D47833E91135BECB91FF00A23DA163F76063C7FE139DC7A4EB00D3B60440FF024426EEF94C927D83DAE60B2F9F47682E46D1E369F3BABDE3C482E8FF022454EACA221BB3E133FCA4F7784A23FF0033BE4FB1BFF8BE6DAA84D08655C16196F452FF02FF02FF02E43E60FF02FF02E4D4FF0248FF02DE40FF02D9C680FF02B7D7E5E1DDDC393446BF26CACF9072B562F9578CDC735212BC38116AE744F32913000582A1B66919DF3BCF9009F464C60A4A4C86530280FF02307B9C9D73621860874A5065B5744EB87DEF2121F161FA96C8DFF10FDD99D354FF024B6B7D20133A6DA9F20C4EE33C88C91950043BDAB4393413F8FF02FF02FF02FF02FF02FF02FF02FF02FF02F9BE3DB62932870EC93902F01F921CDD0747E110BE1ED8A229800C8843E5C90B5FFDEEE350B7DB2C8E3FD699BC5B7D0016D316173176FF026CFD6CE500486F49A3FAFE377B717706D3CF158B7EB9D2678ED9A81E58FC2232AAC8FF0200DAC008EAAEDD90FF02FF02FF02
IsQps: 0
Message: Transacción exitosa
ModuleCharge: 37
ModuleLote: 1
CustomerName: TREJO PECINA/AGUSTIN      
TerminalId: 1490293930
OrderId: 201011080753-1490293930
PreAuth: 0
PreStatus: 0
Promotion: 00
RePrintDate: 1.2.4_20201008
RePrintMark: VISA
ReprintModule: C
CardNumber: 8425
StoreName: CICAP
StreetName: AVE PABLO LIVAS 7200
TicketDate: OCT. 11, 20 08:07:53 
TipAmount: 0.0
TipLessAmount: 10.0
TransDate: 2020-10-11 08:07:54.CDT
TransType: A
TransactionCertificate: B50599631D57FC5D
FolioId: 1