#Xadacka - Termina
1 messages · Page 1 of 1 (latest)
HI 👋
can you provide the docs you are working from and where exactly you are getting stuck?
absolutely, i'm just using the repo on github connected to the terminal backend with a wisepos e. everything works absolutely perfectly as stock, no issues, when i try and add code to run my command everything just falls apart. i don't really know nodejs well but can figure the basics out
what i want to do, if that helps, is have all this running on a pi (works fine) and then when a payment is approved run a command to play a video on the attached display. basically exec "cvlc -f file.mp4" once it gets the payment approved response from stripe
In the POS system your working on?
sorry? more context... we're a fundraising company for charities, we're basically setting up a system they can have at their fundraising events. a display, few buttons, and the card reader. they'll press a button (i.e. donate €10) which i'll use the pi gpio pins to capture, send the amount they selected to the terminal so it'll activate the terminal, and once they tap and their donation goes through it'll play a little video animation. all the rest is fine and no problem i just can't get node to exec the command for the video
Okay so the JS integration is basically a web app (server/client) where most of the Terminal integration takes part in the Frontend (client-side JS). At least that is how we have it documented here: https://stripe.com/docs/terminal/payments/setup-integration
The web app is your Point of Sale application (POS).
ah okay. well yes i've all that working, payments work, the terminal connects and works, no issues at all for the testing. it's that i need to add a terminal command into that demo but any time i try to the entire thing breaks, errors for exec not being defined even though i've called it, "exec not a function" popping up, lots of little things that i just don't know enough of js to figure out and can't seem to find any solutions online, was hoping someone here might know a quick and easy solution that can be plugged in without too much effort from anyone!
terminal command meaning the linux shell, sorry, probably confusing with the payments terminal also being involved
Okay so command line terminal fuction, yes?
yup!
Unfortunately that is going to be outside the scope of our expertise here. But a quick Google search showed me this, which might help:
https://stackabuse.com/executing-shell-commands-with-node-js/
With Node, we can run shell commands and process their I/O using JavaScript, instead of the shell scripting language. This makes the application easier to maintain and develop as we stay in the same environment.
no worries thought it was worth a shot, i've found and tried that article, works perfectly on an empty project but when adding the code to your code it breaks all your code so thought you might have seen something similar before or something. thanks anyway!
I am still unclear about which "Your code" you are talking about. The doc you linked didn't have explicit code snippets
that's the codebase i'm using and running and working with
That is purely used to simulate events and is in no way i ntended as a working template
It's desinged to show you the functions that get called and the data passed back and forth
oh i know just wanna get this part off the ground to demo to our partners and take it from there
I would recommend starting with the integration doc I linked earlier.
It will mean writing your own client and server application but it can all be run from a single machine
i’ll do that, that’s needed anyway just wanted to quickly get this off the ground quickly but that’s cool thanks for your help
great thank you
Take a look here. This is designed for a web-based credit card interface but it has the code to create a REST API that will generate Payment Intents