Payment terminal TIMAPI.DLL

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Payment terminal TIMAPI.DLL

Post by edk »

Hi.
There are differences in the operation of real EFT and the simulator. In the simulator, information about the card is always sent when the card status changes, in real EFT this is not the case, EFT sends information about the card regardless of the change in the card insertion status.
In this version of the class it should be OK.
TIMAPI-Class.7z
(49.57 KiB) Downloaded 454 times
As for changing the language, I have no way to check if it works. I don't have examples from AdvancedEcr.exe so I relied on .Net code
I didn't find a direct reference to ta_terminal_get_supported_languages, but found something like:

Code: Select all

				{ FeatureType.Enum.HardwareListSupportedDisplayLanguages, "hw:SupportedLanguages" },
In the simulator these values are returned:
feature_simulator.png
feature_simulator.png (140.93 KiB) Viewed 35811 times
, but in your EFT they are not. :!:
feature_EFT.png
feature_EFT.png (184.71 KiB) Viewed 35811 times
To read these values use the GetSupportedLanguages() method

For ta_terminal_change_language_for_request I found this: https://six-tim.github.io/timapi/doc/cs ... st_String_ , from the description it is a transaction time language change, based on this code

Code: Select all

using SIX.TimApi.Protocol;
using System;

namespace SIX.TimApi.Protocol.Sixml
{
	public class Notification_ChangeLanguage : SixmlMessage
	{
		private string m_FunctionGroup = null;

		private string m_Function = null;

		private string m_Language = null;

		public string Function
		{
			get
			{
				return this.m_Function;
			}
			set
			{
				this.m_Function = value;
			}
		}

		public string FunctionGroup
		{
			get
			{
				return this.m_FunctionGroup;
			}
			set
			{
				this.m_FunctionGroup = value;
			}
		}

		public string Language
		{
			get
			{
				return this.m_Language;
			}
			set
			{
				this.m_Language = value;
			}
		}

		public Notification_ChangeLanguage()
		{
			this.FunctionGroup = "Status";
			this.Function = "ChangeLanguage";
		}

		public Notification_ChangeLanguage(Notification_ChangeLanguage value) : base(value)
		{
			this.m_FunctionGroup = value.m_FunctionGroup;
			this.m_Function = value.m_Function;
			this.m_Language = value.m_Language;
		}

		public Notification_ChangeLanguage(XmlNode node)
		{
			if (base.xmlHasAttribute(node, "FunctionGroup"))
			{
				this.m_FunctionGroup = base.xmlGetAttribute(node, "FunctionGroup");
			}
			if (base.xmlHasAttribute(node, "Function"))
			{
				this.m_Function = base.xmlGetAttribute(node, "Function");
			}
			if (base.xmlHasChild(node, "sixml:Language"))
			{
				this.m_Language = base.xmlGetChild(node, "sixml:Language").getTextContent();
			}
		}

		public override string getFunction()
		{
			return this.m_Function;
		}

		public override string getFunctionGroup()
		{
			return this.m_FunctionGroup;
		}

		public override XmlNode toXmlNode()
		{
			XmlNode xmlNode = new XmlNode("sixml:Notification");
			base.xmlSetAttribute(xmlNode, "xmlns:sixml", "http://www.worldline.com/");
			if (this.m_FunctionGroup != null)
			{
				base.xmlSetAttribute(xmlNode, "FunctionGroup", this.m_FunctionGroup);
			}
			if (this.m_Function != null)
			{
				base.xmlSetAttribute(xmlNode, "Function", this.m_Function);
			}
			if (this.m_Language != null)
			{
				base.xmlAddChild(xmlNode, "sixml:Language", this.m_Language);
			}
			return xmlNode;
		}
	}
}
I built a language change notification ChangeLanguage ( cLangID ) but on the simulator I can't see it working. :?
Georg_BA
Posts: 108
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Re: Payment terminal TIMAPI.DLL

Post by Georg_BA »

Hi Edward

Great work again.

Your modification of the TIM_CardInfo function works 100%

GetSupportedLanguages() returns an empty array.
I created an array with values that are in SupportedLanguages {'de','en','sk'} and used that as a parameter of the ChangeLanguage ( oTIMAPI ) function.
However, the language change will not occur.

I noticed that the Login function also returns the language that is currently set on the terminal

Code: Select all

Response (XML):
<?xml version="1.0"?>
<sixml:Response xmlns:sixml="http://www.six-payment-services.com/" Function="SystemInformation" FunctionGroup="Status" SequenceNumber="3" ResultCode="0" TimeStamp="20230828T221300+0200 ">
<sixml:ConfigData>
<sixml:ReceiptHeader LineNum="1">adamSoft, p. r. o.</sixml:ReceiptHeader>
<sixml:ReceiptHeader LineNum="2">Vajnorská 84/22</sixml:ReceiptHeader>
<sixml:ReceiptHeader LineNum="3">831 04 Bratislava-Nové M</sixml:ReceiptHeader>
<sixml:Language>en</sixml:Language>
</sixml:ConfigData>
<sixml:NetworkInformation TerminalIp="192.168.1.17" TerminalIpMask="" TerminalIpGw="" TerminalIpDns="192.168.1.1"/>
</sixml:Response>

Best regards, Georg
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Payment terminal TIMAPI.DLL

Post by edk »

Yes, I know that the terminal returns the language set in the terminal when querying "SystemInformation". But how to force change this language?
In turn, sending the ChangeLanguage ( cLangID ) notification, according to this description:
The ChangeLanguage-notification changes the current cardholder language of the EFT.

It is intended as a way of changing the cardholder language during transactions or dialog interactions, e.g. if a cardholder uses a language selection mechanism of a unattended device.

This is a best effort function.

Language string is either two or five letter long. Two-Letter Format: The two letters are a ISO-639-1 language code. E.g. da, nl, ... Five-Letter Format: The five letters are a combination of a two letter language code, a dash, and a two letter uppercase country code as recommended by RFC 5646. E.g. de-CH, fr-BE.
, should change the language during the transaction. From what I understand, if the card has such a language selection mechanism :?:
From the logs you sent, your test card only has the language "en".
Can you try to read the information from your personal card and see if you have the language "sk"?
This is the next support question.
Georg_BA
Posts: 108
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Re: Payment terminal TIMAPI.DLL

Post by Georg_BA »

Hello Edward

You are right, the mentioned function is a help for the payment card holder.
My test cards also have the language localization listed on them.
After reading the card, the terminal communicates in the given language.
It is about confirmation of the transaction, request to remove the card, thank you.
It will then revert to the language currently set on the terminal.

Georg
Georg_BA
Posts: 108
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Re: Payment terminal TIMAPI.DLL

Post by Georg_BA »

Answer from support to set the language on the terminal.

Language setting is on our site.
I can change it in our system and after initialization it will be changed on terminal.
Should I set the Slovakian language?
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Payment terminal TIMAPI.DLL

Post by edk »

Georg, in that case I will implement the possibility of changing the transaction language after reading the data from the card (We will have to disable the condition of checking whether the given language location is from the hw:SupportedLanguages list). Could you also check if you have payment cards with more than one localization language defined? I don't think it should be, but I want to make sure. If several languages are defined, how are they sent back from the terminal, as separate sections, e.g.

Code: Select all

<sixml:CardData (...) >
<sixml:Language>de</sixml:Language>
<sixml:Language>sk</sixml:Language>
</sixml:CardData>
or rather as one section with comma-separated values, e.g.:

Code: Select all

<sixml:CardData (...) >
<sixml:Language>de, sk</sixml:Language>
</sixml:CardData>
:?:
Georg_BA
Posts: 108
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Re: Payment terminal TIMAPI.DLL

Post by Georg_BA »

Hi Edward
Thank you for your suggestions.
The payment card always has only one location.
When I chose the language, it was the default communication with the terminal, which can be set manually Menu-Settings-Trm language.
This value always switched to English after initialization.
They wrote back to me from the support that it is set by WorldLLine.

Support: "For our clients we always setup “merchant country” language."

I would not change the language during the transaction. It is not a problem if it communicates in the customer's language and then returns to the merchant's language

Georg
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Payment terminal TIMAPI.DLL

Post by edk »

But is it possible to programmatically change the language of the terminal (as you mentioned, it returns to "en" after initialization)?
"Change Language" only works per transaction.
It's a pity that support gives perfunctory answers.
The following administrator functions are available:
Login,
Logout,
Reconfig,
Reboot,
SoftwareUpdate,
Activate,
Deactivate,
CounterRequest,
Reconciliation,
Balance,
OpenDialogMode,
CloseDialogMode,
TransmitLog,
StartReaderCleaning,
DccRates,
ChangeSettings,
ReceiptRequest,
CloseReader,
OpenReader,
EjectCard,
OpenMaintenanceWindow,
CloseMaintenanceWindow,
ActivateServiceMenu,
MobileTopupIssuerInfo

Analyzing the .Net code, it seems to me that it will be the ChangeSettings function, but I don't see a description for it in the documentation.
I made a few changes:
- ChangeLanguage function changes the language to the one read from the cardholder.
Try the following steps:
1. "Initialize TIMAPI class"
2. "Activate"
3. insert card in terminal
4. "Change language"

- new function HardwareInformation reads hardware data, there is a list of configurations.
- new ChangeSettings function, for now only for testing, I think it should change the language of the terminal.

Try the following steps:
1. "Initialize TIMAPI class"
2. "Hardware Information", after connecting and logging in, you should read the hardware information, in the settings list, one of them indicates the language of the terminal ( <sixml:Setting SettingType="Language">en</ sixml:Setting> )
3. "Change Settings (lang.)" (I have hard-coded the language: sk)
4. Read the "Hardware Information" again and check if the language has changed to "sk".
Attachments
TIM_APIClass.7z
(62.06 KiB) Downloaded 459 times
Georg_BA
Posts: 108
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Re: Payment terminal TIMAPI.DLL

Post by Georg_BA »

Hi Edward

This version has a bug.
Unable to connect.

TIMAPI class initialized.
Error: -5 Description: Terminal not found or not responding!

The error appears on both the simulator and the real terminal

Georg
Attachments
ver230830.jpg
ver230830.jpg (109.29 KiB) Viewed 35668 times
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Payment terminal TIMAPI.DLL

Post by edk »

Sorry, I probably wrongly and unnecessarily suggested you to re-initialize the class when the connection to the terminal was already established.
This reset the hTIM_CFG [ "Connected" ] flag.
There is no error in the class itself, but I added in the initialization function to check if there is a connection to the terminal and force disconnection at reinitialization.
Initialization is only needed at the beginning and then it is not required again, but since we are testing various terminal behaviors and API, I left the option to reinitialize the class.
If there are still problems with establishing a connection, send me the log in a private message.

If I find some free time tomorrow, I will try to prepare the functionality of creating a payment transaction printout form. When configuring the parameters:

Code: Select all

oTIMApi:hTIM_CFG [ "PrintOptionsMerchant" ] [ "PrintFormat" ] := "FieldsOnly"
oTIMApi:hTIM_CFG [ "PrintOptionsCardholder" ] [ "PrintFormat" ] := "FieldsOnly"
the terminal returns, instead of a ready printout, fields with values. Using this data, you can build your own printouts and/or store them for future use.
Attachments
TIM_APIClass_2.7z
(62.31 KiB) Downloaded 459 times
Post Reply