check weather the check box is ticked for online to put in the online transaction id
function processTransaction($online, $onlinePaymentId) { if ($online) { if (empty($onlinePaymentId)) { // Handle error } // Process online payment } else { // Process offline payment } }