Payment terminal TIMAPI.DLL

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

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

Payment terminal TIMAPI.DLL

Post by Georg_BA »

Hello everyone
I would need to integrate the program's cooperation with the payment terminal. These are WORLDLine terminals. There is a TIMAPI SDK for this with libraries for Java, .NET, Swift, JavaScript, C
more at the link
https://six-tim.github.io/timapi/doc/c/guide.html#setup
Has anyone solved it?

Thanks for help
Best regards, 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 »

Hello everyone
As far as I can see, no one has implemented payment terminals yet.
So please help with the C library.
In the attachment there is a complete SDK in C with source code.
I have a problem with the declaration of variables and reading the return values

source code in C language

Code: Select all

ta_object_t terminal = ta_object_invalid;
ta_object_t settings = ta_object_invalid;

// create terminal settings instance
ta_terminal_settings_create(&settings);

// add wanted guides (with bitwise or)
ta_terminal_settings_set_guides(settings, ta_c_guide_retail | ta_c_guide_dialog);

// create terminal
ta_terminal_create(&terminal, settings);

// release terminal settings
ta_object_release(settings);
I created a function that calls parts from the DLL library

Code: Select all

function a_timcres
local vr:=''

if file(cesta1+'timapi.dll')
   
   vr:=HMG_CallDLL ( 'timapi.dll',  , 'ta_terminal_settings_create','&settings')
   //ta_terminal_settings_create(&settings);
endif
msgbox(vr,'a_timcres')
return(vr)
after calling my function the program freezes

when I call the function that returns the current version of the API, everything goes fine

Code: Select all

ltim_ver:='TIMapi: '+HB_VALTOSTR(HMG_CallDLL ( 'timapi.dll',  , 'ta_terminal_get_tim_api_version'))
I know that the problem is in the declaration of objects and their subsequent reading.
my knowledge of C is weak and I cannot adapt it to the needs of HMG

Thank you for your help
Attachments
timsdk_C.ZIP
(21.62 MiB) Downloaded 831 times
tim_toolsTools.zip
(19.85 MiB) Downloaded 783 times
User avatar
serge_girard
Posts: 3309
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Payment terminal TIMAPI.DLL

Post by serge_girard »

Perhaps Edward can help?
There's nothing you can do that can't be done...
Georg_BA
Posts: 108
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Re: Payment terminal TIMAPI.DLL

Post by Georg_BA »

I was hoping that KDJ would help, but he was last here a year ago
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Payment terminal TIMAPI.DLL

Post by AUGE_OHR »

hi,

i have look into your Upload and found that *.DLL also have a LIB in same Folder

---

when use a *.DLL 1st, Step is to "loadLibrary"

Code: Select all

   nDLL := HMG_CallDLL( "Kernel32.dll",, "LoadLibrary", "Everything32.dll" )
   IF nDLL > 0
when got a handle you must use it for all HMG_CallDLL()

Code: Select all

      nRet := DllCall( nDLL,, "Everything_SetRequestFlags", hb_BitOr
( EVERYTHING_REQUEST_PATH, EVERYTHING_REQUEST_FILE_NAME, EVERYTHING_REQUEST_SIZE ) )
---

other Way is to use a "Import" LIB. those LIB in ZIP Files seem to be for it
when have a "Import" LIB you can use all Function like usual without "call" it

but you need it for MinGW / HMG

there is a Tool called LIB2A which you can try to "convert" *-LIB to *.A
please search here in Forum

---

i´m NOT a "C" User so i can´t help with "C" Code
have fun
Jimmy
Georg_BA
Posts: 108
Joined: Fri Apr 07, 2017 5:31 pm
DBs Used: DBF

Re: Payment terminal TIMAPI.DLL

Post by Georg_BA »

Thanks for help
I'll try and let you know how.
I also think that creating lib.a would be the easiest.

Best regards, 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 »

Hello everyone
My next attempts
1)
I found a library of type a in the supplied SDK
\C\TimApi\Libraries\Unix\32bit-Static\libtimapi.a
I copied it to the HMG344\lib directory
I added the mentioned library to the IDE-configuration

Code: Select all

libs=timapi
for the test I call the function
msgbox(ta_terminal_get_tim_api_version())
it gives me an error message during compilation
undefined reference to `HB_FUN_TA_TERMINAL_GET_TIM_API_VERSION'

2)
I tried to create library type .a from DLL
I used utilities from MINIGW

gendef timapi.dll <-- generates timapi.def

dlltool.exe -d timapi.def -D timapi.dll -l libtimapi.a

but the created file has zero size

3)
the conversion using LIB2A ends when the DEF file is created
.\bin\reimp.exe: out of memory

Best regards, Georg
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Payment terminal TIMAPI.DLL

Post by AUGE_OHR »

hi,
Georg_BA wrote: Sat Jul 29, 2023 12:18 pm I found a library of type a in the supplied SDK
\C\TimApi\Libraries\Unix\32bit-Static\libtimapi.a
you can´t use a UNIX LIB for Windows
Georg_BA wrote: Sat Jul 29, 2023 12:18 pm dlltool.exe -d timapi.def -D timapi.dll -l libtimapi.a
where you got the Syntax of dlltool.exe :?:
it seems not to display help file

---

are those LIB for "C++" or "C" :?:
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2625
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Payment terminal TIMAPI.DLL

Post by danielmaximiliano »

hola, yo uso la sintaxis https://sourceware.org/binutils/docs/bi ... ltool.html

Code: Select all

dlltool --dllname timapi.dll --def timapi.def --output-lib libtimapi.a
ver las funciones dentro del .dll https://www.alternate-tools.com/pages/c_dllanalyzer.php
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
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 daniel
I also tried your command syntax, I think they work the same way, but the "a" type library is not created

could someone try to create the given library if someone has another tool for that

Best regards, Georg
Attachments
timapi32bit.zip
(2.67 MiB) Downloaded 837 times
Post Reply