Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Nethram
Visitor

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 2
Valeriia
Channel Surfer

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

I use roChannelStoreEvent.
0 Kudos
kartigas
Newbie

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