I'm readying a channel with two In-Channel Products:
A Monthly Subscription with a 7-Day Free Trial
A Yearly Subscription, no free trial
I can't seem to locate any recommended steps or processes for developing or testing around in-channel transactions and their specific intricacies such as subscription expiration dates, trials, or renewals. The closest piece of documentation I can find is the list of Web API services which can be called for retrieving this data: https://sdkdocs.roku.com/display/sdkdoc/Web+Service+API But are there any best practices that you may use when implementing new subscriptions or in-channel products into your Roku app to ensure that these products are behaving as intended? I suppose my first question would be, once I have my Private Channel & Test Development Users set up. If I purchase the Monthly Subscription, how can I then mimic the 7-day trial expiration? The Monthly expiration? A renewal? etc. I should note that my channel is integrated with an external database for keeping records of all users and their subscriptions/purchases. Thank you, -Mikey
Basically, you don't really need to keep track of subscriptions/renewals yourself. roChannelStore will return current subscription status. Once a subscription is cancelled (I believe there's no choice but to have a subscription auto-renew, so the only way for it to "expire" is for it to have been cancelled), it will no longer be returned from roChannelStore as a current purchase once the renewal date is reached. There isn't any way to get historical purchases (that I'm aware of), so if no purchases are returned, the subscription has either never been purchased or it has been cancelled.
I'm guessing a free trial period would work similarly, but I think the only way to test it is to set up a test channel and wait for a week to pass to see what happens. Have you looked at the difference between the response from roChannelStore for a subscription with and without a free trial period? What's the expiration date (or renewal date) for a subscription with a one week trial period?
This won't currently help for the past, but for future transactions you could send two calls - one to the channel store and one to your own server, and then between the two it should be able to get the transaction id of the original signup or purchase, or use push notifications - I haven't tried either of those yet but I'll have to soon.