Tutorial: Roku In-App Purchases
For Roku in-app purchases to be connected to Cleeng's system, the following steps must be completed:
- Create a Roku customer account
- Enroll as a Roku developer
- Register for Roku Partner Payouts Program
Note: Each Roku Product ID should match its Cleeng Offer ID with one minor exception–– becasue the
_(underscore) character is not supported, you must use a
Cleeng Offer ID Roku Product ID S123123123_US S123123123-US
Set your Roku push notification URL to this Cleeng endpoint:
Contact Cleeng to finalize Roku in-app purchase setup.
This tutorial assumes that the user is already authenticated and has a
customerToken stored in the app. For reference see our authentication tutorial.
The Roku channel app is responsible for displaying the “buy" button to initiate the payment. Once successful payment is completed through Roku Billing, the Cleeng receipt endpoint must be notified.
In order to register a transaction in Cleeng, the receipt data returned from Roku Billing must be passed to the secure Cleeng endpoint for validation. The endpoint accepts a POST request of a JSON payload containing following fields:
paymentEvent- this should be set to "new"
offerId- the Cleeng offer ID (e.g.
rokuTransactionId- the transaction ID of the purchase returned by Roku
customerToken- token identyfing customer account on Cleeng (e.g.
Payment processing is asynchronous and may take up to 1-2 minutes between purchase and validation in Cleeng. Because of this, the app should grant temporary access to the user while the transaction is processed. However, every time after the inital purchase, the middleware will be the source of truth to check the user's access status.
- Note: If this is not completed within 1-2 minutes, the app should assume that the payment failed and notify the user.
End User Registration and In-App Purchase Diagram