EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2016
02:31 AM
roChannelStore/billing docs = ancient & incorrect
After trying to use it, turns out the docs on Roku Billing Services are years behind the implementation. Which is out-of-this-world, because if an API is un/under/wrong-documented, it is unusable. How can dev.blog recently promote Roku's billing services with a straight face?!
Most problematic is ifChannelStore, talking about non-existing fields like SDPosterUrl, HDPosterUrl, description - while missing others. Neighboring pages also have issues, e.g. roChannelStore has an old version of "Web Service API" shoveled into it - but now there is a separate page named "Web Service API" (i did not scrutinize these but is confusing to have 2 different sources for the same info and i bet one of them is less correct).
To lend a hand in (hopefully) fixing that page - and as note-to-self - here is what different functions (async)return in real world these days:
Also note that doOrder():
(^) I am rather unclear about freeTrialQuantity, freeTrialType, purchaseDate, qty - as to why they are in the catalog and what the meaning might be. The presence of the "red items" seems questionable altogether
(^^) freeTrialQuantity value jumps seemingly randomly - smell of corrupted memory (uninitialized/overflow/dangling pointer?)
(^^^) Notice there is a bug in the `cost` returned by getPurchases() - it does not show the actual amount paid (e.g. test user pays 0 but it will still show $1.99) nor does it show the price at the time of purchase. Instead it shows the current price. E.g. say customer purchased item before for $5 but today it's on sale for $1; getPurchases() will show the past transaction with today's $1 price.
Most problematic is ifChannelStore, talking about non-existing fields like SDPosterUrl, HDPosterUrl, description - while missing others. Neighboring pages also have issues, e.g. roChannelStore has an old version of "Web Service API" shoveled into it - but now there is a separate page named "Web Service API" (i did not scrutinize these but is confusing to have 2 different sources for the same info and i bet one of them is less correct).
To lend a hand in (hopefully) fixing that page - and as note-to-self - here is what different functions (async)return in real world these days:
"freeTrialQuantity: 0 ' ^
freeTrialType: "None"
name: "blah de blah"
productType: "NonConsumable"
purchaseDate: "0001-01-01T00:00:00"
qty: 1
}]
"freeTrialQuantity: 29
qty: 1
}]
"amount: "$1.99"
code: "raga-no-ads"
description: "blah de blah"
freeTrialQuantity: 232 'NB. value varies, seems random!
name: "blah de blah"
qty: 1
total: "$1.99"
}]
"freeTrialQuantity: 1644301318 'NB. value varies!^^
purchaseId: "xxxxxxxx-cc06-46dc-8b75-a63azzzzzzzz"
qty: 1
total: "$0.00"
}]
"
[{
code: "raga-no-ads"
cost: "$1.99" ' buggy ^^^
freeTrialQuantity: 0
freeTrialType: "None"
name: "blah de blah"
productType: "NonConsumable"
purchaseDate: "2016-07-05T07:32:14"
purchaseId: "xxxxxxxx-cc06-46dc-8b75-a63azzzzzzzz"
qty: 1
}]
Also note that doOrder():
- when user-canceled, returns a misleading roChannelStoreEvent, as if it were completed okay
- doOrder() on already purchased item shows "Item has already been purchased. This item has already been purchased for this account.", then returns false and event.getResponse() = [ ]
- doOrder() on already purchased qty:1, this time for qty:2 shows "Order Problem. There was a problem placing your order (error code 006).", then returns false and event.getResponse() = [ ]
(^) I am rather unclear about freeTrialQuantity, freeTrialType, purchaseDate, qty - as to why they are in the catalog and what the meaning might be. The presence of the "red items" seems questionable altogether
(^^) freeTrialQuantity value jumps seemingly randomly - smell of corrupted memory (uninitialized/overflow/dangling pointer?)
(^^^) Notice there is a bug in the `cost` returned by getPurchases() - it does not show the actual amount paid (e.g. test user pays 0 but it will still show $1.99) nor does it show the price at the time of purchase. Instead it shows the current price. E.g. say customer purchased item before for $5 but today it's on sale for $1; getPurchases() will show the past transaction with today's $1 price.
5 REPLIES 5
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2016
11:52 AM
Re: roChannelStore/billing docs = ancient & incorrect
Here is one more problematic spot:
From my experience using the API so far, there are 2 issues in that statement, which i highlighted:
(^^) There is no way to "respond" to a roChannelStoreEvent. As worded it may leave wrong impression txn is not completed until app consumes the event. Not the case - it's just there is an event "clogging" the port - and also it's generally expected one to check details from the txn.
(^) There will be an event waiting regardless if doOrder() returns true or false. So that event has to be "drained" from the queue or you'll run out-of-sync with the next roChannelStore operation (e.g. getPurchases())
"doOrder()" wrote:
... If the user approves the order, this function returns true. Otherwise it returns false. In the case that the user approves^, the channel should wait for and respond to^^ the roChannelStoreEvent.isRequestSucceeded event to get the details of the completed transaction.
From my experience using the API so far, there are 2 issues in that statement, which i highlighted:
(^^) There is no way to "respond" to a roChannelStoreEvent. As worded it may leave wrong impression txn is not completed until app consumes the event. Not the case - it's just there is an event "clogging" the port - and also it's generally expected one to check details from the txn.
(^) There will be an event waiting regardless if doOrder() returns true or false. So that event has to be "drained" from the queue or you'll run out-of-sync with the next roChannelStore operation (e.g. getPurchases())

Community Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2016
10:00 AM
Re: roChannelStore/billing docs = ancient & incorrect
Hi Enterr, we introduced a SceneGraph ChannelStore node in OS 7.2 which is a bit of a refresh on roChannelStore. Why don't you take a look and let us know what you think?
Docs: https://sdkdocs.roku.com/display/sdkdoc/ChannelStore
Overview blog post: https://blog.roku.com/developer/2016/07 ... ing-guide/
Docs: https://sdkdocs.roku.com/display/sdkdoc/ChannelStore
Overview blog post: https://blog.roku.com/developer/2016/07 ... ing-guide/
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2016
11:35 AM
Re: roChannelStore/billing docs = ancient & incorrect
"RokuTomC" wrote:
Hi Enterr, we introduced a SceneGraph ChannelStore node in OS 7.2 which is a bit of a refresh on roChannelStore. Why don't you take a look and let us know what you think?
Hey RokuTomC - welcome to the forum!
Afraid i am not in position to take the "SG" pill on this. I am doing a hybrid (w/NDK) app and SG is not going to go well with that, now would it?
Thinking of it, there being 3 distinct interfaces to billing ("classic" roChannelStore, via NDK and now the "du jour" Node) - these are just thin veneers over the web services, right. So i imagine you are keeping them cohesive/coherent?
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2016
02:25 PM
Re: roChannelStore/billing docs = ancient & incorrect
Meanwhile, seems the latest&greatest "ChannelStore" SG is DoA (dead-on-arrival), have a look at https://forums.roku.com/viewtopic.php?f=34&t=96119
bosborne
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2016
04:21 PM
Re: roChannelStore/billing docs = ancient & incorrect
Oof, It would be really great if Roku could make sure the docs are updated, especially for something as critical as billing APIs.