I am using a bill acceptor for my kiosk app.I used a python library to use the acceptor and get the value of the currency. I want to return the jsonString variable when the getCash() method is called.
export const getCash = () => {
var jsonString;
var process = spawn('python', [
'./src/renderer/actions/Python-RS-232-master/main.py',
]);
process.stdout.on('data', function (data: any) => {
// var amount = data.toString();
// console.log(amount);
var obj: any = new Object();
obj.amount = await data.toString();
jsonString = JSON.stringify(obj);
});
};