Testing a Roku Pay app
Verifying no entitlement without a Roku Pay subscription
To verify that a customer cannot be entitled to content without a subscription purchased through Roku Pay, follow these steps:
-
Launch app and select content behind paywall.
-
Send the getAllPurchases command. Verify that it does not return any active subscription products.
-
Call the roRegistrySection.read() function on the device registry section for the app. Verify that it does not return an access token from device registry.
-
Send the getChannelCred command. Verify that it does not return an access token from Roku cloud.
Verifying Roku Pay purchase workflow
To verify that a customer can purchase a subscription product and upgrade/downgrade their plan through Roku Pay, follow these steps:
-
Send the getCatalog command. Verify that the SceneGraph components used to display in-app products are populated with product metadata.
-
Select a subscription product. Verify that the getUserData command is sent and the request for information (RFI) screen is displayed.
-
Press Continue on the RFI screen. Verify that the order is created and the doOrder command is executed.
-
Verify that the order confirmation screen displays any free trial offers or discounts included with the subscription product.
-
Confirm the order of the subscription product. Verify that the
orderStatusfield confirms that the order was successfully completed. -
Verify that an access token is generated in the publisher's backend system and passed into:
a. The storeChannelCredData command to store the access token in the Roku cloud.
b. The roRegistrySection.write() function to store the access token in the device registry.
-
If your app includes a product group, select another in-app product that is in the same product group as the previously ordered one. Verify that the "You're already subscribed" dialog is displayed.
-
Call the validate-transaction API with purchase ID included in the
orderStatusfield. Verify that theisEntitledflag is set to "true". -
If your app includes multiple subscription plans, upgrade or downgrade the subscription plan, and then do the following:
a. Verify that the
order.actionfield is set to the correct string.b. Call the
validate-transactionAPI with purchase ID included in theorderStatusfield. Confirm the following:-
The
purchase_typeis set toUPGRADEorDOWNGRADE. -
The
cancelled_transaction_idsfield is set to the transaction ID of the original subscription purchase. -
The
purchase_statusfield is set toactive.
-
-
Close the app.
Verifying Roku Pay entitlement workflow
To verify that a customer is entitled to content after purchasing a subscription through Roku Pay, follow these steps:
-
Re-launch app.
-
Send the getAllPurchases command. Verify that it returns the purchased subscription product.
-
Call the validate-transaction API with purchase ID included in the
purchasesfield. Verify that theisEntitledflag is set to "true". -
Call the roRegistrySection.read() function on the device registry section for the app. Verify that it returns an access token from the device registry.
-
Send the getChannelCred command. Verify that it returns an access token from Roku cloud.
-
To test that customers are not entitled to subscription products after a free trial ends, do the following:
a. Order a subscription product that has a 1-day free trial.
b. After the trial expires the next day, cancel the subscription.
c. Complete steps 1-3. Verify that the
isEntitledflag is set to "false".
Updated 2 months ago
