Forum Discussion

shahjad's avatar
shahjad
Channel Surfer
5 years ago

Roku TVOD channel transaction errors:

HI There,

I have added the TVOD Channel Template example in my code which working fine in my local device in developer mode testing but when i publish it to Non-certified or Public it is not working ,like when do start the payemnt transaction process , it start with progress dialog and then just goes to error dialog. i am adding mycodes for your reference below:

 

sub makePurchase()

m.pdialogCheckSubs.title = "Processing.."
m.top.getScene().dialog = m.pdialogCheckSubs


m.pdialogCheckSubs = CreateObject("roSGNode", "ProgressDialog")
m.orderRequest = CreateObject("roSGNode", "ContentNode")
m.orderRequest.title = "example title"
m.orderRequest.priceDisplay = "1.99"
m.orderRequest.price = "1.99"

m.orderRequest.addField("code", "string", false)
m.orderRequest.code = "The Room (Purchase)"

m.store.requestPartnerOrder = m.orderRequest

? "Issuing RequestPartnerOrder Command"
? "-- code: ", m.store.requestPartnerOrder.code
? "-- priceDisplay: ", m.store.requestPartnerOrder.priceDisplay
? "-- price: ", m.store.requestPartnerOrder.price
m.store.command = "requestPartnerOrder"
end sub

 

sub confirmPurchase()
m.confirmRequest = CreateObject("roSGNode", "ContentNode")
m.confirmRequest.title = m.orderRequest.title
m.confirmRequest.priceDisplay = m.orderRequest.priceDisplay
m.confirmRequest.price = Mid(m.store.requestPartnerOrderStatus.total, 2)
m.confirmRequest.orderID = m.store.requestPartnerOrderStatus.orderID

m.confirmRequest.addField("code", "string", false)
m.confirmRequest.code = m.orderRequest.code

m.store.confirmPartnerOrder = m.confirmRequest

? "Issuing ConfirmPartnerOrder Command"
? "-- code: ", m.store.confirmPartnerOrder.code
? "-- title: ", m.store.confirmPartnerOrder.title
? "-- priceDisplay: ", m.store.confirmPartnerOrder.priceDisplay
? "-- price: ", m.store.confirmPartnerOrder.price
? "-- orderID: ", m.store.confirmPartnerOrder.orderID
m.store.command = "confirmPartnerOrder"
end sub

function displayOrderStatusDialog(response as Object) as Void
m.pdialogCheckSubs = CreateObject("roSGNode", "ProgressDialog")

m.dialog = CreateObject("roSGNode", "Dialog")
m.dialog.title = "Order Status"
m.dialog.optionsDialog = true

m.dialog.buttons = ["OK"]
m.succes = false
m.message = "Your purchase of " + m.orderRequest.title
? "m.store.requestPartnerOrderStatus: "; m.store.requestPartnerOrderStatus
if response <> invalid and response.status = "Success"
m.PaymentUpdatingTask = CreateObject("roSGNode", "PaymentUpdatingTask")
? "response.purchaseId:"; response.purchaseId

m.message = m.message + " for " + m.store.requestPartnerOrderStatus.total

m.dialog.message = m.message

m.message = m.message + " succeeded"
m.succes = true


m.dialog.observeField("wasClosed", "orderStatusDialogButtonSelected")
m.dialog.observeField("buttonSelected", "orderStatusDialogButtonSelected")

? "SHOWING ORDER STATUS DIALOG WITH MESSAGE: "; m.message
m.top.getScene().dialog = m.dialog


m.message = m.message + " succeeded"
m.succes = true
else
?"m.store.requestPartnerOrderStatus:";m.store.requestPartnerOrderStatus
m.message = m.message + " failed with errorMessage: "

if m.store.requestPartnerOrderStatus.errorMessage<>invalid then
m.message+=m.store.requestPartnerOrderStatus.errorMessage
end if
if m.store.requestPartnerOrderStatus.status<>invalid then
m.message+= " status: "+m.store.requestPartnerOrderStatus.status
end if
if m.store.requestPartnerOrderStatus.errorCode<>invalid then
m.message += " errorCode: "+m.store.requestPartnerOrderStatus.errorCode
end if


m.dialog.message = m.message
m.dialog.observeField("wasClosed", "orderStatusDialogButtonSelected")
m.dialog.observeField("buttonSelected", "orderStatusDialogButtonSelected")

? "SHOWING ORDER STATUS DIALOG WITH MESSAGE: "; m.message
m.top.getScene().dialog = m.dialog
end if
end function

 

 

 

  • is you m.store only created once? it should have only one reference through out the life cycle.

    • shahjad's avatar
      shahjad
      Channel Surfer

      Yes, there is only one instance for whole life cycle for it I am using. The same issue happen with TVOD channel template from roku git example, when I deploy it in my roku account with my Roku channel product name the same issue happen.

      • gomad's avatar
        gomad
        Roku Guru

        OK then I am not sure, just to make sure, yours is TVOD only channel and based on the Roku docs:

        "Contact your partner manager to get the requestPartnerOrder and confirmPartnerOrder commands enabled for your channel." 

        This is also done?