#.cooper4952

1 messages ยท Page 1 of 1 (latest)

gusty lanceBOT
tulip river
#

Hi Rubeus had to step out

#

What is the issue you are facing exactly?

limpid phoenix
#

Hi, Thank you

#

I am calling setReaderDisplay js function but it response this error that I shared

#

I am also curios how you can review my old message with @earnest hare

tulip river
#

I can read through it, but it will take some time

#

I am talking to some other users too

limpid phoenix
#

Thank you. Please help as soon as possible.

tulip river
#

Ok I read the thread. So to confirm you did this step as instructed?
You should be doing something like const displayResult = await terminalRef.current.setReaderDisplay(readerDisplayObj) and then looking inside displayResult to see if there's an error or not.

limpid phoenix
#

yes, so I am getting this error

#

"unable to parse request setReaderDisplay" error code: "reader_error"

tulip river
#

Gotcha. Let me see if a colleague can help you with this. I'm not as familiar with terminal as some

limpid phoenix
#

Thank you. Please

formal epoch
#

๐Ÿ‘‹

#

Can you show me your full code snippet here?

limpid phoenix
#

Hi @formal epoch

formal epoch
#

Hmmmm strange

#

Looks fine

#

Looking more

#

Can you log out terminalRef.current just before calling setReaderDisplay

limpid phoenix
#

I think it will be failed if it logged out

#

can I reconnect before setReaderDisplay?

formal epoch
#

You shouldn't need to reconnect? Not sure I understand what you are saying... terminalRef.current should be the instance of your Terminal JS SDK, no? And you should have already connected prior to this point?

#

Ah actually @limpid phoenix can you log out readerDisplayObj right before calling setReaderDisplay()

#

And by "log out" I mean console.log() ๐Ÿ™‚

limpid phoenix
#

yea, you are right

#

ok

#

Just a second

formal epoch
#

๐Ÿ‘

limpid phoenix
#

{
"type": "cart",
"cart": {
"currency": "usd",
"total": 302.8,
"tax": 5280,
"line_items": [
{
"amount": 12000,
"description": "TestTax",
"quantity": 1
},
{
"amount": 1000,
"description": "Coat Condition",
"quantity": 1
}
]
}
}

formal epoch
#

Yeah try changing the total to 3028

#

Or basically I think that decimal is your issue

#

Should just be an Int

#

Also I don't really think your cart adds up correctly ๐Ÿ˜