Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
Nethram
Level 7

Roku scene graph Channelstore - How to get transaction id of a purchased item ?

             I have a beta channel and two " in channel products" and I can successfully subscribe channel products. 
subscription.xml

<ChannelStore id="billing"/>

subscription.brs
[size=100]sub init()[/size]

m.billing.ObserveField("orderStatus", "On_billing_purchaseResult")

end sub


sub On_billing_purchaseResult()
    if m.billing.orderStatus = invalid OR m.billing.orderStatus.status = invalid then
        ?"invalid purchase"
        return
    end if

    if m.billing.orderStatus.status = 1 then
        ? "Purchased RESULT : " ; m.billing.orderStatus
        end if
end sub



I want to log purchaseId after a successful subscription.
How can I get purchased Id using product id from content node "m.billing.orderStatus ". ?
0 Kudos
2 Replies
Valeriia
Level 7

Re: Roku scene graph Channelstore - How to get transaction id of a purchased item ?

I use roChannelStoreEvent.
0 Kudos
kartigas
Level 7

Re: Roku scene graph Channelstore - How to get transaction id of a purchased item ?

Hi Nethram
you can use event like param received of sub

sub On_billing_purchaseResult(event)
    if  event.getData().status = invalid
       ?"invalid purchase"
       return
    end if
    item = event.getData().GetChild(0)
    ? item " <-- check this ITEM PUCHASED "
    if event.getData().status = 1
       ? "Purchased RESULT : " ; event.getData().status
    end if
end sub
0 Kudos