While the user is in purchase screen and before the products load, if the user hits the back button, the user is taken back to Main screen but after few seconds redirects to success page. The user did not even started the purchase but they are taken to the success page.
The issue here is once the back button is clicked before the products are loaded, screen is closed for roListScreenEvent but roChannelStoreEvent still continues to go forward with its task which results in redirecting the screen to purchase page.
if (type(msg) = "roListScreenEvent") if (msg.isListItemSelected()) index = msg.GetIndex() this.MakePurchase(index) else if msg.isScreenClosed() then ' takes the user back to main screen return endif else if (type(msg) = "roChannelStoreEvent") if msg.IsRequestSucceeded() then print msg.GetResponse() ShowParagraphScreen() 'displays the success screen else if msg.IsRequestFailed() then print msg.isRequestFailed(); "------------" else if msg.isRequestInterrupted() then print "interrupted" end if end if
Is there any option to stop roChannelStoreEvent along side roListScreenEvent once the screen is closed or back button is pressed? Or am I doing something wrong here? Let me know if you need the whole code sample to test.