Continuing the discussion from SambaPOS 5.1.60 Release:
Is sambapos now compatible with gloriafood 100%?
if so how will i be able to integrate it without using the delivery setup as i dont do delivery?
Continuing the discussion from SambaPOS 5.1.60 Release:
Is sambapos now compatible with gloriafood 100%?
if so how will i be able to integrate it without using the delivery setup as i dont do delivery?
I believe emre showed a basic gloriafood as an example.
As you can see from the demonstration yes it is 100% compatible but seeing how we have only a single solution submitted by Emre himself I would consider it experimental still. You can use what he started and create your own integration. He gave you the basic idea.[quote=āsid252uk, post:1, topic:11611ā]
if so how will i be able to integrate it without using the delivery setup as i dont do delivery?
[/quote]
Just dive in and start building your own setup how you need it to run. You will need to study up on how Emre was able to get it to work specifically the jscript side.
Hi guys
While testing the script, i followes emre instructions, but evrey time i placing an order with gloriafood, the app crash with this error:
mutation m{addEntity(entity:{
entityType:āCustomersā,name:ā999 9999 99ā,customData:[
{name:āFirst Nameā,value:āmyfirstnamelā},
{name:āLast Nameā,value:āmylastnameā},
{name:āAddressā,value:ānullā},
{name:āEMail",value:"myemail@gmail.comā}
])
{name}
}
mutation m{updateEntityState(entityTypeName:āCustomersā,entityName:ā999 9999 99ā,state:āUnconfirmedā,stateName:āCStatusā){name}}
C:\Users\user\Desktop\rest\script.js:457
getCustomer(data.addEntity.name, callback);
^
TypeError: Cannot read property ānameā of null
Someone have an idea?
TNX
Looks like address is null
Thats not the full error is it?
Thanks for the quik replay
But i tried also with an adress, still i got the same error
{isEntityExists(type:āCustomersā,name:ā999 9999 99ā)}
mutation m{addEntity(entity:{ entityType:"Customers",name:"999 9999 99",customData:[ {name:"First Name",value:"yuval"}, {name:"Last Name",value:"yuval"}, {name:"Address",value:"my streed, my city"}, {name:"EMail",value:"myemail@gmail.com"} ]) {name} }
mutation m{updateEntityState(entityTypeName:āCustomersā,entityName:ā999 9999 99ā,state:āUnconfirmedā,stateName:āCStatusā){name}}
C:\Users\user\Desktop\rest\SCRIPT.JS:457
getCustomer(data.addEntity.name, callback);
^
TypeError: Cannot read property ānameā of null
at C:\Users\user\Desktop\rest\SCRIPT.JS:457:39
at IncomingMessage. (C:\Users\user\Desktop\rest\SCRIPT.JS:30:13)
at emitOne (events.js:77:13)
at IncomingMessage.emit (events.js:169:7)
at IncomingMessage.Readable.read (_stream_readable.js:368:10)
at flow (stream_readable.js:759:26)
at resume (_stream_readable.js:739:3)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
I got the same error trying to modify the scriptā¦ I receive an order an automatically the script abortsā¦
still trying to find outā¦ LOL
G.
getCustomer(data.addEntity.name, callback);
^
TypeError: Cannot read property 'name' of null
getCustomer
is returning nullā¦ data.addEntity
is null, so it cannot read the .name
property.
After adding an Entity, you probably need to refresh the Cache first, before trying to āgetā the Entity you just added.
ant idea how to do it?
There is a GQL mutation to refresh the SambaPOS cache.
I donāt think Entities are cached. That might be something else.
That doesnāt look properly formatted to me?
Should there not be a } between the closing ] and )?.. entity:{ doesnt seem to be closedā¦
I am a little out of the loop on the GraphQL but also whats the {name}???
Is this potentially whats coming back null???
The format is correct.
The name your referring to is its return.
Yes, there is a formatting issue there.
I donāt know how it worked for me maybe a copy paste issue I donāt knowā¦
Can you try replacing this function?
function getAddCustomerScript(customer) {
return `
mutation m{addEntity(entity:{
entityType:"${customerEntityType}",name:"${customer.phone}",customData:[
{name:"First Name",value:"${customer.firstName}"},
{name:"Last Name",value:"${customer.lastName}"},
{name:"Address",value:"${customer.address}"},
{name:"EMail",value:"${customer.email}"}
]})
{name}
}`;
}
I dont want to use the delivery setup (we dont do delivery) which Emre uses for the integration of this API. Would the script work without the delivery setup or does it have to be modified? (im not very good with scripts yet)
I guessed thats what it might be but my thought was that maybe that missing bracket made it a value rather than a return and since it has no value maybe what was causing the error with null value due to the missing }
nope, still the same:
mutation m{addEntity(entity:{ entityType:"Customers",name:"999 9999 99",customData:[ {name:"First Name",value:"yuval"}, {name:"Last Name",value:"yuval"}, {name:"Address",value:"HARAV HALPERIN, HERZLIYA"}, {name:"EMail",value:"mm@gmaillamy.com"} ]}) {name} }
mutation m{updateEntityState(entityTypeName:āCustomersā,entityName:ā999 9999 99ā,state:āUnconfirmedā,stateName:āCStatusā){name}}
C:\Users\user\Desktop\rest\SCRIPT.JS:457
getCustomer(data.addEntity.name, callback);
^
TypeError: Cannot read property ānameā of null
at C:\Users\user\Desktop\rest\SCRIPT.JS:457:39