Our channel contains in-channel one-time purchases. we have implemented code for Roku pay in our app, and tested it via side loading and by pushing it to beta channel.
Issue is that the static analysis throws error every time that says:
“According to the Monetization channel properties page, your channel is offering in-channel purchases, but no Roku Pay BrightScript code was found in your channel.”
I have got code help from https://github.com/rokudev/channelstore-node-tvod-sample. We also tested this repo app by packaging this repo and uploading package to my beta channel that also shows same error. we are getting late due to this issue. So kindly help us with this problem solving so we can publish our app asap.
here is code of payment that we are using
function CheckSubscriptionAndStartGame(order_title as string, order_identifier as string, order_price as string)
m.order_title = order_title
m.order_identifier = order_identifier
m.order_price = order_price
’ m.global.store = createObject(“roSGNode”, “channelStore”)
m.global.store.observeField(“requestPartnerOrderStatus”, “requestPartnerOrderStatusChanged”)
m.global.store.observeField(“confirmPartnerOrderStatus”, “confirmPartnerOrderStatusChanged”)
m.global.store.command = “getUserData”
m.global.store.observefield(“userData”, “on_user_data”)
print “>> Getting Products (Catalog and Purchases)”
m.global.store.ObserveField(“catalog”, “On_billing_catalog”)
’ m.global.store.command = “getStoreCatalog”
’ m.global.store.observefield(“storeCatalog”, “OnStoreCatalog”)
end function
sub On_billing_catalog()
if m.global.store.catalog = invalid OR m.global.store.catalog.status = invalid then
print “false”
return
end if
if m.global.store.catalog.status = 1 then
print "calling onPurchaseStart > " m.global.store.catalog.getChild(0)
onPurchaseStart()
else
print “false”
end if
end sub
sub on_user_data()
?" user Data > " m.global.store.userData
if m.global.store.userData <> invalid
m.global.store.command = “getCatalog”
end if
end sub
function onPurchaseStart() as void
print “Calling makePurchase()”
makePurchase()
end function
function statusDialogButtonSelected() as void
m.dialog.close = true
end function
function ShowPurchaseStatus(params as object) as void
msg = “Your purchase of " + params.title + " for " + params.priceDisplay
if (params.status = 1)
msg = msg + " succeeded!”
else
msg = msg + " failed"
end if
m.dialog = createObject(“RoSGNode”, “Dialog”)
m.dialog.title = m.order_title + “Purchase Status”
m.dialog.message = msg
m.buttons = [“OK”]
m.dialog.buttons = m.buttons
m.dialog.observeField(“buttonSelected”, “statusDialogButtonSelected”)
m.top.dialog = m.dialog
end function
sub makePurchase()
m.orderInfo = createObject(“roSGNode”, “contentNode”)
m.orderInfo.priceDisplay = m.order_price
m.orderInfo.price = m.order_price
m.orderInfo.addField(“code”, “string”, false)
m.orderInfo.code = m.order_identifier
m.global.store.requestPartnerOrder = m.orderInfo
m.global.store.command = “requestPartnerOrder”
end sub
sub requestPartnerOrderStatusChanged()
? "RequestPartnerOrderStatusChanged "; m.global.store.requestPartnerOrderStatus
if m.global.store.requestPartnerOrderStatus.status = “Success”
print “valid”
confirmPurchase()
else
print “invalid”
displayOrderStatusDialog(m.global.store.requestPartnerOrderStatus)
end if
end sub
sub confirmPurchase()
m.confirmRequest = CreateObject(“roSGNode”, “ContentNode”)
m.confirmRequest.title = m.order_title
m.confirmRequest.priceDisplay = m.order_price
m.confirmRequest.price = Mid(m.global.store.requestPartnerOrderStatus.total, 2)
m.confirmRequest.orderID = m.global.store.requestPartnerOrderStatus.orderID
m.confirmRequest.addField(“code”, “string”, false)
m.confirmRequest.code = m.order_identifier
m.global.store.confirmPartnerOrder = m.confirmRequest
? “Issuing ConfirmPartnerOrder Command”
? "-- code: ", m.global.store.confirmPartnerOrder.code
? "-- title: ", m.global.store.confirmPartnerOrder.title
? "-- priceDisplay: ", m.global.store.confirmPartnerOrder.priceDisplay
? "-- price: ", m.global.store.confirmPartnerOrder.price
? "-- orderID: ", m.global.store.confirmPartnerOrder.orderID
? "-- contentKey : ", m.global.store.confirmPartnerOrder.contentKey
m.global.store.command = “confirmPartnerOrder”
end sub
sub confirmPartnerOrderStatusChanged()
? "ConfirmPartnerOrderStatusChanged "; m.global.store.confirmPartnerOrderStatus
displayOrderStatusDialog(m.global.store.confirmPartnerOrderStatus)
end sub
function orderStatusDialogButtonSelected()
if m.top.dialog.buttonSelected = 0
m.top.dialog.close = true
else
print “cancel button pressed”
end if
end function
function displayOrderStatusDialog(response as object) as void
dialog = CreateObject(“roSGNode”, “Dialog”)
dialog.title = “Order Status”
dialog.buttons = [“OK”]
message = “Your purchase of " + m.order_title
if response <> invalid and response.status = “Success”
message = message + " for " + m.global.store.requestPartnerOrderStatus.total
message = message + " succeeded”
else
message = message + " failed"
end if
dialog.message = message
dialog.observeField(“buttonSelected”, “orderStatusDialogButtonSelected”)
? "SHOWING ORDER STATUS DIALOG WITH MESSAGE: "; message
m.top.dialog = dialog
end function