Sambapos Script for Self Hosted HTTP Service and post data in URL

Thank you JRTech. While you encouraged me :slight_smile: today I have successfully tested and getting response. An image is attached here:

Now I am facing following issues.
How I can execute script regarding relevant bill information to be posted for getting response from web.service. Either 1st I have to query data and thereafter execute script. Objective is when cashier press print button of a specific ticket number, same could be posted and get response in a ticket with response (string) converted in qr code.
Regards

1 Like

Samba template will render qr from the numerical code.
You would want to use update ticket tag action and use the call function in the tag value field.
So in the rule when updating tag it runs script and uses returned tax id into ticket tag.

@JRTech yes, QRcode is not an issue…However my query is in image you can see. JSON data is a sample array, whereas in restaurant every bill is required to be posted in the web service to get response back…How a specif bill with return response can be printed.

As I said before look at my PMS topic, its all in there.
Your need to feed in the Ticket Number etc as variables.

You will call the script in update ticket tag action like
{CALL:FBR.getInvoice("{TICKET NUMBER}","{TICKET TOTAL}","{etc.}")}

Then in your script it would be;
function getInvoice(var1,var2,varEtc){ …etc…}

I would like more information about it to sent the gov
objects in JSON format.

1 Like