An update into the progress.
First JTRTech I have to say Well Done on your work for that intergration and from someone who learns the same as you it was remarkable.
Back to me lol
I have gone for the easier option for me at the moment by using Graphql.
refreshing the main pos wa achieved with
mutation m6{postTicketRefreshMessage
(id:0) {
id
}}
So that did the job very well of updating the main pos.
I have managed to create a terminal, create tickets, add line items to tickets, close the ticket, refresh and close the terminal.
All that went pretty straight forward.
The original point I wanted to get was finding out when the ticket was paid to update the other software. The work around at the moment is to call all tickets for the day that are paid and match the ID to the UID and check status. Once we see its paid then update the status in the other software.
Its a bit long winded and could have been done a lot easier if we knew the actual ticket id. We could just call that ticket id and check status.
Its my understanding that the ticket id is not created until the close funtion is run but it would be super cool if we had a return statement option on that mutation that would return it but there is nothing, Not sure if there are still requests for features on the Graphql side but I will look and see if I can submit one.
I cant see any other way in gql of returning the ticket id from the UID that the terminal creates, maybe that would be a better feature request or both. Search ticket on UID or ID.
I can see how this could be done in scripting and call the script on ticket close but its just a learning curve and speed is of the essence as they say.
I kept running into syntax errors trying to figure out the language and I dont seem to be able to find examples of scripting using the helpers and functions. All data grabbing seems to be sql queries (again not my strongest points lol) instead of the Data.get . I may have run into the same issues.
The simplist thing I could think of was again to use the web.postJson or web.postData as suggested.
Passing the paid status over via one of those methods would have been easy on the other side but again I could not find any examples to help me.
Im not sure how the ticketID is passed into the Script. I am assuming via the handler but again guessing really else how does the script know as to what ticket it is refering to.
I followed up because there is nothing worse than finding a post and it having no resoltion although Im not done with the scripting as I would like to know how to do it in there.
If anyone has any good examples of scripting I would love to read through and pick it back up,
Thanks