e.preventDefault(); // Prevent form submission input.blur(); // remove focus input.value = ""; // optional: clear the input

How to implement an In-App purchase in Roku Channels?

These days most of the Roku channels provide In-app Purchases for their users. In-app Purchases are basically the products that are shown to the users when the channel is running and they can buy/subscribe to the products accordingly.

This article will help you to navigate through the 8 simple steps required for the implementation of in-app purchases.

Steps for storing, fetching, and ordering a purchase are given below

Storing

Step 1: Create a roChannelStore object and a roMessagePort object for fetching and store channel data locally.

In_App_purchase_in_Roku_Channels_01

Step 2: Create roAssociativeArray for storing channel products and already purchased products.

Step 3: Call setMessagePort function for the roChannelStore object.

Fetching

Step 4: Use GetPurchases() associated with roChannelStore object for fetching users purchased products. Use while loop along with the message port for getting “roChannelStoreEvent” and message response as roList of roAssociativeArray.

Step 5: Use GetCatalog() with the associated roChannelStore object for fetching products associated with the current channel. Use while loop along with the message port for getting “roChannelStoreEvent ” and message response as roList of roAssociativeArray.

Step 6: Use GetuserData() before making purchases for a valid user account and information checking.

Ordering

Step 7: Use SetOrder(Order as roList of roAssocativeArray) and DoOrder() with the associated roChannelStore variable for setting order into the cart and on confirm go to the payment method respectively. (Note: It’s a good practise to call clearOrder() before adding to cart)

In_App_purchase_in_Roku_Channels_02

Step 8: Use RequestPartnerOrder(orderInfo as roAssociativeArray,ProductID as string) and ConfirmPartnerOrder(confirmOrderInfo as roAssociativeArray,ProductID as string) for checking and confirming of user billing and transaction process.(Note: orderInfo will Contain priceDisplay and price keys with string values for the price displayed and the price charged, respectively. The currency symbol may not be included in the price or priceDisplay values.)

The coding part for in-app purchases implementation is now completed, you can now publish this build after this go to the developer dashboard in roku.developer.com.

Select: Manage My In-Channel Products -> “Add a New Product” set the channel you want that product to be added and fill up all the required fields.

For testing the in-app purchases as a test user and billing testing of $0.00 transaction: Add a test user in Manage Test users, and designate a channel in “Manage my channels” as a billing testing.

For more references, you can also visit here.

https://developer.roku.com/en-ot/docs/references/brightscript/interfaces/ifchannelstore.md

https://developer.roku.com/en-ot/docs/developer-program/roku-pay/roku-pay-and-in-channel-purchasing.md

Related Posts

Latest Posts

  • All Posts
  • Generative AI
  • manufacturing
  • News
  • Portfolio
    •   Back
    • Android
    • iOS
    • Java
    • PHP
    • MEAN
    • Ruby
    • DotNet
    • IoT
    • Cloud
    • Testing
    • Roku
    • CMS
    • Python

India

Plot No. 11/2, Phase 3, Hinjewadi Rajiv Gandhi Infotech Park, Pune, India – 411057.
info@tudip.com
+91-96-8990-0537

United States

1999 S. Bascom Ave Suite 700, Campbell CA. 95008, USA.
info@tudip.com
+1-408-216-8162

Canada

64 Caracas Road North York, Toronto Ontario M2K 1B1, Canada.
info@tudip.com

Mexico

Calle Amado Nervo #785 Interior B Colonia Ladron De Guevara 44600 Guadalajara, Jalisco, Mexico.
info@tudip.com

Colombia

Cra. 9 # 113-53 Of. 1405 Bogotá D.C., Colombia.
info@tudip.com

UAE

Tudip Information Technologies L.L.C Office No 109, ABU HAIL BUILDING 13, Abu Hail, Dubai, UAE.
info@tudip.com

Nigeria

22 Kumasi Crescent, Wuse 2, Abuja, Nigeria.
info@tudip.com