VikR0001
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018
04:29 PM
DoOrder() Error, "min 1 max 2 items in order"?
I'm getting an error on a call to DoOrder():
Here's the code that calls DoOrder():
I have confirmed that "PAID.099" is the *Identifier/internal reference number" of an in-channel product in this channel. It has purchase type of "One Time Purchase, Consumable - Quantity 1".
How can I correct this error?
Thanks very much in advance to all for any info!
FailureCode -4,
Msg: "min 1 max 2 items in order".
Here's the code that calls DoOrder():
m.channelStore.SetMessagePort(port)
m.channelStore.ClearOrder()
m.channelStore.SetOrder([{
guid : "PAID.099"
qty : 1
}])
m.channelStore.DoOrder()
msg = invalid
while type(msg) <> "roChannelStoreEvent"
msg = Wait(0, port)
end while
I have confirmed that "PAID.099" is the *Identifier/internal reference number" of an in-channel product in this channel. It has purchase type of "One Time Purchase, Consumable - Quantity 1".
How can I correct this error?
Thanks very much in advance to all for any info!
3 REPLIES 3

speechles
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018
05:24 PM
Re: DoOrder() Error, "min 1 max 2 items in order"?
myOrder = CreateObject("roSGNode", "ContentNode")
myFirstItem = myOrder.createChild("ContentNode")
myFirstItem.addFields({ "guid": "PAID.099", "qty": 1})
m.channelStore.order = myOrder
Order isn't an roarray, it is a content node with children, like above.
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018
05:36 PM
Re: DoOrder() Error, "min 1 max 2 items in order"?
"speechles" wrote:
Order isn't an roarray, it is a content node with children, like above.
I don't know about that. I think the problem is he should be using code, not guid. Here's how I do it (leaving out the SG stuff):
channelStore = CreateObject("roChannelStore")
code = "mycode"
port = CreateObject("roMessagePort")
channelStore.SetMessagePort(port)
order = [{code: code, qty: 1}]
channelStore.SetOrder(order)
result = channelStore.DoOrder()
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
VikR0001
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018
06:56 PM
Re: DoOrder() Error, "min 1 max 2 items in order"?
renojim:
That was it. Thanks very much!
I think the problem is he should be using code, not guid.
That was it. Thanks very much!