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:
"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.