Page 1 of 8
Payment terminal TIMAPI.DLL
Posted: Thu Jul 20, 2023 11:36 am
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
Re: Payment terminal TIMAPI.DLL
Posted: Tue Jul 25, 2023 10:30 pm
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
Re: Payment terminal TIMAPI.DLL
Posted: Thu Jul 27, 2023 5:37 am
by serge_girard
Perhaps Edward can help?
Re: Payment terminal TIMAPI.DLL
Posted: Thu Jul 27, 2023 9:35 am
by Georg_BA
I was hoping that KDJ would help, but he was last here a year ago
Re: Payment terminal TIMAPI.DLL
Posted: Fri Jul 28, 2023 7:22 am
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
Re: Payment terminal TIMAPI.DLL
Posted: Fri Jul 28, 2023 10:58 am
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
Re: Payment terminal TIMAPI.DLL
Posted: Sat Jul 29, 2023 12:18 pm
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
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
Re: Payment terminal TIMAPI.DLL
Posted: Sun Jul 30, 2023 12:06 am
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"

Re: Payment terminal TIMAPI.DLL
Posted: Sun Jul 30, 2023 11:26 pm
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
Re: Payment terminal TIMAPI.DLL
Posted: Tue Aug 01, 2023 4:39 pm
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