I'm developing a new custom payment gateway, but running into a brick wall here. After selecting my payment gateway option and entering credit card details, clicking continue takes me back to the same checkout page with the error message "Please select a payment method for your order.". I have debugged this message and followed the trace to the following core file:

/includes/classes/payment.php, payment function, c. line 200 (I have added some debugging lines that send info through a socket, so I can't give the precise line). Line is as follows:

if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {

That line - in a core file - is causing the error, as the conditional fails. I've checked $this->selected_module, and that seems to be empty. Does anyone with any experience of ZenCart know why this has not been set? I've never used Zencart before, but this module is needed ASAP!

Any help would be brilliant. Thank you.