Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sdornan
Visitor

Integrated Billing Sample Code

Is there any implementation documentation or sample code available for implementing in-app purchases - specifically subscriptions - within a channel?

Our team currently has some documentation that includes some example UI flows, but it would be great to have some sample code that we could use as a base for our own implementation.
0 Kudos
11 REPLIES 11
TheEndless
Channel Surfer

Re: Integrated Billing Sample Code

This might help: http://blog.roku.com/developer/2013/06/ ... -channels/
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
sdornan
Visitor

Re: Integrated Billing Sample Code

Thanks, that is helpful!

Another question: how would you go about making a PIN entry screen like the one shown in the UI guidelines?
0 Kudos
RokuJoel
Binge Watcher

Re: Integrated Billing Sample Code

The PIN entry screen is part of the firmware - it will automatically show when a user attempts to make a purchase, if they have a PIN set in their account. We also have a component:

http://sdkdocs.roku.com/display/sdkdoc/roPinEntryDialog

That can be used to enter a PIN if your channel needs to use one for its own purposes but it is not part of the Roku Billing Services purchasing process.

- Joel
0 Kudos
sdornan
Visitor

Re: Integrated Billing Sample Code

Thanks. It seems to work as you describe.

One more question:

I'm looking to validate an order on our server using the web API after the purchase has been made. However, to do this I need the order's transaction ID. What is the best way to retrieve this transaction ID? I assumed that DoOrder() would return the order's information, including the transaction ID, which I could then pass to our server. That doesn't seem to be the case though, as the method simply returns a boolean value indicating whether the purchase was successful.
0 Kudos
sdornan
Visitor

Re: Integrated Billing Sample Code

Now I see that the Roku receives a roChannelStoreEvent response after the purchase is complete that contains the items that were ordered. However, this response only contains information about the items that were ordered and doesn't provide the actual transaction ID of the order. Am I looking in the wrong place?
0 Kudos
RokuRobB
Streaming Star

Re: Integrated Billing Sample Code

The event that is fired after making a purchase contains an attribute called PurchaseID. This is how the BrightScript events sends the transaction id. It is a bit confusing that the names are different.
0 Kudos
fortscan
Visitor

Re: Integrated Billing Sample Code

"RokuRobB" wrote:
The event that is fired after making a purchase contains an attribute called PurchaseID. This is how the BrightScript events sends the transaction id. It is a bit confusing that the names are different.


Is it possible that legacy devices on the 3.1 firmware are filtering/ignoring the purchaseId attribute? It seems to happen even when testing locally with the store.FakeServer function using a valid purchaseId at the corresponding PlaceOrder.xml file inside csfake folder. It only happens in 3.1 fw. Perhaps the attribute is simply being ignored, but it would be possible to manually parse the response from the roChannelStoreEvent without relying on GetResponse()?
0 Kudos
RokuJoel
Binge Watcher

Re: Integrated Billing Sample Code

FYI in-channel purchases and subscriptions are not really supported on firmware 3.1, only purchase or subscription of the channel itself.

- Joel
0 Kudos
EnTerr
Roku Guru

Re: Integrated Billing Sample Code

"RokuJoel" wrote:
FYI in-channel purchases and subscriptions are not really supported on firmware 3.1, only purchase or subscription of the channel itself.

Wait, wat?
Could you explain more on this, please. Are you saying that roChannelStore is not in fw3 - or is there something else? I just checked and createObject returned me <Component: roChannelStore> on 2050 player.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.