Forum Discussion
11 Replies
- cocotowerRoku Guru
The proper way I make sure my billing code is working as well as the associated products or subscriptions is to write the channel as it will be in its final form, with no billing "testing" code, fake store, etc. It needs to be the actual package you plan to publish. Create another channel on the site with a different name, something like "My Channel TEST". Upload the package and enter any details required to just get you by for testing. Publish it as Not Public, so that it will be a non-certified channel you can have pushed back to your Roku device as an installed channel from Roku. Once you publish a non-certified channel make sure you add it using the vanity link, and it should be pushed to your Roku device within minutes or seconds.
On the site, under in-channel products, click on the product name in the list and it will bring up all the channels that can use the product. Click on the channel selector and add your new "My Channel TEST" channel. Do this for all products that this channel can use.
What I haven't seen published anywhere can drive you crazy if you're not aware.... when you add a new product, or assign a new channel to an existing product, it can take up to one hour for Roku to actually allow the product to be purchased. That is, your channel will most likely crash when you call the purchase method, and your Roku will reboot. If your Roku crashes when trying to purchase a product for real or for testing, give Roku more time.
Under test users you always want to add your Roku e-mail address so that you won't accidentally get billed when you're designing a channel with products. The purchase of course will go through but no charge will be made to you.
Once your TEST channel is working as you want it, upload the same package to your original channel and republish it.
So, to recap. Forget trying to test billing using the fake store/products from a side-loaded channel. It's much quicker, but you'll just have to remove that code in the final channel, no?
- streetcreditChannel Surfer
Great advice. What got from Roku was that my channel does not have a trial period option in billing, which causes some of the code to not execute. Not sure why Roku would not have it built into the template a way for developers who don't want the trial option available to still offer subscriptions. Looking to modify the template code to reflect this. Any ideas?
- RokuJonathanDCommunity Moderator
If you are running the sample without any modifications, then yes, you do need to have at least one in-channel product with a free trial per the doc: https://developer.roku.com/videos/courses/rsg/subscriptions.md#sample-channel-notes.
But feel free to modify the code to fit your product catalog. For example, maybe you can try removing lines 104-105 from the subscription logic file (https://github.com/rokudev/scenegraph-master-sample/blob/master/DeepLinking/components/UILogic/SubscriptionLogic.brs). That way the code is not looking for products with a free trial.
I think you pretty much hit this on the head, the real question is how exactly is a working version of the subscription logic written in its final form. Per Roku, we have only ever seen this done in a sample form, and the documentation doesn't build on that sample in any way. Rather difficult to adapt to with no clear guidance.
- RokuJonathanDCommunity Moderator
- streetcreditChannel Surfer
The channel name is Street Credit TV and the channel ID I believe is "6d4bd5be36c92c1d8f573ee133b87b26" since my channel URL is https://channelstore.roku.com/details/6d4bd5be36c92c1d8f573ee133b87b26/
Thanks for the reply!