B4J Question Trying to figure "way" of connection?

Magma

Expert
Licensed User
Longtime User
Well...

Hi guys... the government and tax authorities want to connect ERP to POS and of course they have a declaration of compliance...

all these must be done from 10/4 ~ 15/5... Yes... we need to be sure 100% that all EFT-POS of our market will connect with our ERP's !!! :) - funny? not so... but if not do that all customers of small companies will go to big companies ! This is our country...

Also there is no API availiable (no example - exactly) - how will do that... for sure is not something completed... some companies of EFT-POS only have Cloud APIs that offer their Docs... and some will go with Common API TCP v3 (that is the name - but nothing to know more)

For the History: Before 2 months all known ECRs (cashiers) in Greece must connected with EFT-POS - well until now - the 30% is only real connected and working... That's because of the same API described before...

So tried 3-4 different ways to connected... at Common API TCP v3 - because CLOUD API is totally different for every EFT-POS Company !!! :-(

But yet nothing - i am attaching the links and some files found from EFT-POS companies providing some info but they are in total-chaos and not sharing much... if someone can understand something will be helpful... if I can make it - I am gonna make it Open-Source and Command-Line utility to help all Developers (because this needed and for companies/programmers from other countries selling ERPs-Invoicing programs to Greece) - so i think is an opportunity to make B4X bigger.. and ofcourse help me again one more time :)

Links with INFO for ECRs and ERPs<>EFT-POS (AADE is our Tax Authorities, like IRS)
AADE-1
AADE-2

ofcourse all in Greek - only some notes in English... :-(
GOOGLE DRIVE LINK: Here some extra - that can help...

What I ve understand until know for Common API TCP v3 - How it works..
1) First EFT-POS - if enabled for using at AADE (and lock keybord of POS - yes thats right) - will automatically get with VAT/TAX-info of user a "MasterKey" needed for Security - an AES key...
2) ECR's having a serial number and VAT/TAX-Info so enabling AADE - will get a "Masterkey" (AES - to encode requests and responses) needed to communicate with any EFT-POS locally (local lan) and send to it the amount for transactions.. But for ERPs.. no serial number - so this is a problem not explained by AADE ! - yet !
3) after that EFT-POS can't connected with other ERP or ECR the same time... and all transactions must come with requests from ERP-ECR

What is missing from all that - the most important - what not shared public (yet-13/4/2024)
is the whole procedure-API and a SandBox to get those masterkeys for Demo Apps from the side of ERPs (for EFT-POS - Softpos... viva has a demo apk and at xls in Google Drive Link added there is an eft-pos emulator - that may be not need to encode data to test... maybe)
* * * ERPs.. not having serial number at TAX Authorities - so this is a problem not explained by AADE ! - yet !

The main problem as you understand is the TIME (not possible to do all that until 17/5/2024) and also the LITTLE information coming from AUTHORITIES

Tried to use websocketclient v2 with eft-pos emulator - but not having any luck... actually not sure if i must use websocket - that's why created this question - to figure what to use... and then analyse it more... if someone want...
B4X:
'those at at main - not sure if needed:

#AdditionalJar: jserver/jetty-webapp-11.0.9.jar
#PackagerProperty: AdditionalModuleInfoString = provides org.slf4j.spi.SLF4JServiceProvider with org.eclipse.jetty.logging.JettyLoggingServiceProvider;
#PackagerProperty: IncludedModules = jdk.charsets, jdk.crypto.ec


...


Private Sub B4XPage_Created (Root1 As B4XView)

    Root = Root1
    Root.LoadLayout("MainPage")

    ws.Initialize("ws")
    'accept all trust manager
    SetAcceptAll(ws)
    
    ws.Connect("wss://127.0.0.1:8888")
    Wait For ws_Connected
    Log("connected")
    


End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.

Private Sub Button1_Click
    
    ws.SendTextAsync("X/")
    
End Sub


Sub ws_Closed (Reason As String)
    Log("closed: " & Reason)
End Sub

Sub ws_TextMessage (Message As String)
    Log("message: " & Message)
    ws.Close
End Sub




Private Sub SetAcceptAll (WebSocket As WebSocketClient)
    Dim ssl As JavaObject
    ssl.InitializeNewInstance("org.eclipse.jetty.util.ssl.SslContextFactory.Client", Array(True))
    Dim ClientConnector As JavaObject
    ClientConnector.InitializeNewInstance("org.eclipse.jetty.io.ClientConnector", Null)
    ClientConnector.RunMethod("setSslContextFactory", Array(ssl))
    Dim Infos As JavaObject
    Infos.InitializeArray("org.eclipse.jetty.io.ClientConnectionFactory$Info", Array())
    Dim HttpTransport As JavaObject
    HttpTransport.InitializeNewInstance("org.eclipse.jetty.client.dynamic.HttpClientTransportDynamic", Array(ClientConnector, Infos))
    Dim HttpClient As JavaObject
    HttpClient.InitializeNewInstance("org.eclipse.jetty.client.HttpClient", Array(HttpTransport))
    Dim jo As JavaObject = WebSocket
    Dim wsc As JavaObject
    wsc.InitializeNewInstance("org.eclipse.jetty.websocket.client.WebSocketClient", Array(HttpClient))
    jo.SetField("wsc", wsc)
End Sub

...Not having luck yet... tried also post (at httpjob, json, xml, text) - nothing...
 

Magma

Expert
Licensed User
Longtime User
Try to use tools like Postman or create a B4J API client using okHttpUtils2 library to call the API.
did you see any API ?

I am not saying about Masterkey that there is no way - to get Masterkey from AADE / because of no SERIALNO/saved/FOR ERPs - but for the local connection of ERP/ECR<>EFT-POS...

no api... but some commands scattered
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
I did find this, it refers to aade and Greece near the bottom. Maybe a dig around here, as they may have the answers you are looking for.
https://github.com/Dolibarr/dolibarr
Thanks but ...

probably you are saying for this line:
"Greece fetch customer vat details from AADE, all invoice types, MyData(external free module)"

Those are just some other old API's already created before 4-5 years / not for getting payments from EFT-POS - is very specific and belongs to different API... The only info is that i attached as links and google drive folder having some pdf and xls with links to companies of EFT-POS having some extra / not common protocols for communications... and to be more specific that will work for all.. is only common protocol TCP v3 -not sure how works..
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Similar to our case here in Malaysia implementing e-invoicing by integration to POS,
we need to study the API i.e read the documentation several times to understand the requirements;
which fields are already available (e.g tax number, company registration number);
which fields need to be generated (e.g invoice running number, invoice date).
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Similar to our case here in Malaysia implementing e-invoicing by integration to POS,
we need to study the API i.e read the documentation several times to understand the requirements;
which fields are already available (e.g tax number, company registration number);
which fields need to be generated (e.g invoice running number, invoice date).
The problem here is not enough information
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
The problem here is not enough information
I understand the frustration.
The government department here promised to release the SDK by end of last year but end up release a beta version at Feb but lack of registration of client id. Sometimes we need to contact them and wait patiently for the answers. Keep continue the communication until you get enough information is provided.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Hi there...

I have some information that the "Common Protocol API TCP v3" will not be compatible with "Software" ERP/Invoice APPS because will not have Serial NOs (That i was telling) - this information coming for ECR Cashier Manufacturers...

So that Means that I must go (and all ERP Programmers) and make all API Connections with EFT-POS and test about 150 EFT-POS Hardware with all these protocols (~8) in about 19days from now... 🤪 and sign the declaration of compliance...

piece of cake
 
Upvote 0
Top