title: Confirm order button missing from opencart 2.0 checkout flow
body: <p>I have created a payment gateway module previously for 1.5 version it works perfectly, now i have upgraded to 2.x so i started to work with my modules, everything works fine except the final confirm order is missing.</p>
  
  <p><strong>here is the image link</strong>
  <a href="http://i.stack.imgur.com/Ak4B1.png" rel="nofollow">http://i.stack.imgur.com/Ak4B1.png</a></p>
  
  <p>i replaced the old code with my new code but still it does not works and the big issue its not even showing an error so that i can get any idea</p>
  
  <p><strong>Here is my old code</strong></p>
  
  <pre><code>&lt;form action="&lt;?php echo $action; ?&gt;" method="post" id="payment"&gt;
  
  &lt;/form&gt;
  &lt;div class="buttons"&gt;
    &lt;div class="right"&gt;&lt;a id="button-confirm" class="button" onclick="$('#payment').submit();"&gt;&lt;span&gt;&lt;?php echo $button_confirm; ?&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>New Code</strong></p>
  
  <pre><code> &lt;form action="&lt;?php echo $action; ?&gt;" method="post" id="payment"&gt;
  
      &lt;/form&gt;
       &lt;div class="buttons"&gt;
          &lt;div class="pull-right"&gt;
            &lt;input type="submit" value="&lt;?php echo $button_confirm; ?&gt;" class="btn btn-primary" id="button-confirm" /&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  </code></pre>
  
  <p><strong>controller file code</strong></p>
  
  <pre><code>&lt;?php
  class ControllerPaymentIcicipg extends Controller {
  
      protected function index() {
  
          $this-&gt;load-&gt;language('payment/icicipg');
          $data['action'] = $this-&gt;url-&gt;link('payment/icicipg/send', '', 'SSL');
          $data['button_confirm'] = $this-&gt;language-&gt;get('button_confirm');
  
          if (file_exists(DIR_TEMPLATE . $this-&gt;config-&gt;get('config_template') . '/template/payment/icicipg.tpl')) {
              $this-&gt;template = $this-&gt;config-&gt;get('config_template') . '/template/payment/icicipg.tpl';
          } else {
              $this-&gt;template = 'default/template/payment/icicipg.tpl';
          }
  
          $this-&gt;render();
  
      }
  
      public function send() {
  
          include("Sfa/BillToAddress.php");
          include("Sfa/CardInfo.php");
          include("Sfa/Merchant.php");
          include("Sfa/MPIData.php");
          include("Sfa/ShipToAddress.php");
          include("Sfa/PGResponse.php");
          include("Sfa/PostLibPHP.php");
          include("Sfa/PGReserveData.php");
  
          $this-&gt;load-&gt;model('checkout/order');
  
          $order_id = $this-&gt;session-&gt;data['order_id'] ;
  
          $order_info = $this-&gt;model_checkout_order-&gt;getOrder($this-&gt;session-&gt;data['order_id']);
  
          $MID = $this-&gt;config-&gt;get('icicipg_MID');
          $cust_ip = $order_info['forwarded_ip'];
          $RedirectURL = $this-&gt;config-&gt;get('icicipg_RedirectURL');
  
          if ($this-&gt;currency-&gt;getCode()=='INR'){
             $amount = $order_info['total'];
          } else {
             $amount = $this-&gt;currency-&gt;convert($order_info['total'], $this-&gt;currency-&gt;getCode(), 'INR') ;
          }
          $amount = round((float)$amount,2);
  
          $bCustomerId = $order_info['customer_id'];
          $bCustomerName = html_entity_decode($order_info['payment_firstname'] . " " . $order_info['payment_lastname'], ENT_QUOTES, 'UTF-8');
          $bAddrLine1 = html_entity_decode($order_info['payment_address_1'], ENT_QUOTES, 'UTF-8');
          $bAddrLine2 = html_entity_decode($order_info['payment_address_2'], ENT_QUOTES, 'UTF-8');
          $bAddrLine3 = "";
          $bCity = html_entity_decode($order_info['payment_city'], ENT_QUOTES, 'UTF-8');
          $bState = html_entity_decode($order_info['payment_zone'], ENT_QUOTES, 'UTF-8');
          $bZip = html_entity_decode($order_info['payment_postcode'], ENT_QUOTES, 'UTF-8');
          $bCountryAlpha = $order_info['payment_iso_code_3'];
          $bEmail = html_entity_decode($order_info['email'], ENT_QUOTES, 'UTF-8');
  
  
          if ($this-&gt;cart-&gt;hasShipping()) {
              $sAddrLine1 = html_entity_decode($order_info['shipping_address_1'], ENT_QUOTES, 'UTF-8');
              $sAddrLine2 = html_entity_decode($order_info['shipping_address_2'], ENT_QUOTES, 'UTF-8');
              $sAddrLine3 = "";
              $sCity = html_entity_decode($order_info['shipping_city'], ENT_QUOTES, 'UTF-8');
              $sState = html_entity_decode($order_info['shipping_zone'], ENT_QUOTES, 'UTF-8');
              $sZip = html_entity_decode($order_info['shipping_postcode'], ENT_QUOTES, 'UTF-8');
              $sCountryAlpha = $order_info['shipping_iso_code_3'];
              $sEmail = html_entity_decode($order_info['email'], ENT_QUOTES, 'UTF-8');
          } else {
              $sAddrLine1 = html_entity_decode($order_info['payment_address_1'], ENT_QUOTES, 'UTF-8');
              $sAddrLine2 = html_entity_decode($order_info['payment_address_2'], ENT_QUOTES, 'UTF-8');
              $sAddrLine3 = "";
              $sCity = html_entity_decode($order_info['payment_city'], ENT_QUOTES, 'UTF-8');
              $sState = html_entity_decode($order_info['payment_zone'], ENT_QUOTES, 'UTF-8');
              $sZip = html_entity_decode($order_info['payment_postcode'], ENT_QUOTES, 'UTF-8');
              $sCountryAlpha = $order_info['payment_iso_code_3'];
              $sEmail = html_entity_decode($order_info['email'], ENT_QUOTES, 'UTF-8');
          }
  
          $oMPI           =   new MPIData();
          $oCI            =   new CardInfo();
          $oPostLibphp    =   new PostLibPHP();
          $oMerchant      =   new Merchant();
          $oBTA           =   new BillToAddress();
          $oSTA           =   new ShipToAddress();
          $oPGResp        =   new PGResponse();
          $oPGReserveData =   new PGReserveData();
  
          $oMerchant-&gt;setMerchantDetails($MID,$MID,$MID,$cust_ip,$order_id,$order_id,$RedirectURL,"POST","INR",$order_id,"req.Sale",$amount,"","Ext1","true","Ext3","Ext4","New PHP");
  
          //$oBTA-&gt;setAddressDetails ("CID","Tester","Aline1","Aline2","Aline3","Pune","A.P","48927489","IND","tester@soft.com");
          $oBTA-&gt;setAddressDetails ($bCustomerId, $bCustomerName,$bAddrLine1, $bAddrLine2, $bAddrLine3,$bCity, $bState, $bZip, $bCountryAlpha, $bEmail);
  
          //$oSTA-&gt;setAddressDetails ("Add1","Add2","Add3","City","State","443543","IND","sad@df.com");
          $oSTA-&gt;setAddressDetails ($sAddrLine1, $sAddrLine2, $sAddrLine3, $sCity, $sState, $sZip, $sCountryAlpha,$sEmail);
  
          #$oMPI-&gt;setMPIRequestDetails("1245","12.45","356","2","2 shirts","12","20011212","12","0","","image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)");
  
          $oPGResp=$oPostLibphp-&gt;postSSL($oBTA,$oSTA,$oMerchant,$oMPI,$oPGReserveData);
  
          function redirect($url) {
              if(headers_sent()){
              ?&gt;
                  &lt;html&gt;&lt;head&gt;
                      &lt;script language="javascript" type="text/javascript"&gt;
                          window.self.location='&lt;?php print($url);?&gt;';
                      &lt;/script&gt;
                  &lt;/head&gt;&lt;/html&gt;
              &lt;?php
                  exit;
              } else {
                  header("Location: ".$url);
                  exit;
              }
          }       
  
          if($oPGResp-&gt;getRespCode() == '000'){
              $url    =$oPGResp-&gt;getRedirectionUrl();
              #$url =~ s/http/https/;
              #print "Location: ".$url."\n\n";
              #header("Location: ".$url);
              redirect($url);
          }else{
              print "Error Occured.&lt;br&gt;";
              print "Error Code:".$oPGResp-&gt;getRespCode()."&lt;br&gt;";
              print "Error Message:".$oPGResp-&gt;getRespMessage()."&lt;br&gt;";
          }
  
      }
  
  
      public function callback() {
  
          include("Sfa/EncryptionUtil.php");
  
          $strMerchantId=$this-&gt;config-&gt;get('icicipg_MID');
          $astrFileName=substr(DIR_SYSTEM,0,strlen(DIR_SYSTEM)-7) . 'Sfa/' . $strMerchantId . '.key';
          $astrClearData;
          $ResponseCode = "";
          $Message = "";
          $TxnID = "";
          $ePGTxnID = "";
          $AuthIdCode = "";
          $RRN = "";
          $CVRespCode = "";
          $Reserve1 = "";
          $Reserve2 = "";
          $Reserve3 = "";
          $Reserve4 = "";
          $Reserve5 = "";
          $Reserve6 = "";
          $Reserve7 = "";
          $Reserve8 = "";
          $Reserve9 = "";
          $Reserve10 = "";
  
          $this-&gt;language-&gt;load('checkout/success');
          $this-&gt;load-&gt;language('payment/icicipg');
  
          if($_POST &amp;&amp; $_POST['DATA']!=null){
  
              if($_POST['DATA']==null){
                  print "null is the value";
              }
               $astrResponseData=str_replace("&amp;amp;", "&amp;", $_POST['DATA']);
               $astrDigest = str_replace("&amp;amp;", "&amp;", $_POST['EncryptedData']);
               $oEncryptionUtilenc =  new EncryptionUtil();
               $astrsfaDigest  = $oEncryptionUtilenc-&gt;getHMAC($astrResponseData,$astrFileName,$strMerchantId);
  
              if (strcasecmp($astrDigest, $astrsfaDigest) == 0) {
                  parse_str($astrResponseData, $output);
                  if( array_key_exists('RespCode', $output) == 1) {
                      $ResponseCode = $output['RespCode'];
                  }
                  if( array_key_exists('Message', $output) == 1) {
                      $Message = $output['Message'];
                  }
                  if( array_key_exists('TxnID', $output) == 1) {
                      $TxnID=$output['TxnID'];
                  }
                  if( array_key_exists('ePGTxnID', $output) == 1) {
                      $ePGTxnID=$output['ePGTxnID'];
                  }
                  if( array_key_exists('AuthIdCode', $output) == 1) {
                      $AuthIdCode=$output['AuthIdCode'];
                  }
                  if( array_key_exists('RRN', $output) == 1) {
                      $RRN = $output['RRN'];
                  }
                  if( array_key_exists('CVRespCode', $output) == 1) {
                      $CVRespCode=$output['CVRespCode'];
                  }
              }
  
              $Order_Id = $TxnID;
  
              $this-&gt;load-&gt;model('checkout/order');
  
              //$order_info = $this-&gt;model_checkout_order-&gt;getOrder($Order_Id);
              if(trim($TxnID)!=""){
                  if((int)$ResponseCode == 0) { 
                      $this-&gt;document-&gt;setTitle('Payment Transaction Successful');
                      $data['heading_title'] = sprintf($this-&gt;language-&gt;get('text_order_success'),$TxnID);
                      $order_status_id = $this-&gt;config-&gt;get('icicipg_success_status_id');
                      $this-&gt;model_checkout_order-&gt;confirm($Order_Id, $order_status_id);
                      if ($this-&gt;customer-&gt;isLogged()) {
                          $data['text_message'] = sprintf($this-&gt;language-&gt;get('text_customer'), $this-&gt;url-&gt;link('account/account', '', 'SSL'), $this-&gt;url-&gt;link('account/order', '', 'SSL'), $this-&gt;url-&gt;link('account/download', '', 'SSL'), $this-&gt;url-&gt;link('information/contact'));
                      } else {
                          $data['text_message'] = sprintf($this-&gt;language-&gt;get('text_guest'), $this-&gt;url-&gt;link('information/contact'));
                      }
                      if (isset($this-&gt;session-&gt;data['order_id'])) {
                          $this-&gt;cart-&gt;clear();
  
                          unset($this-&gt;session-&gt;data['shipping_method']);
                          unset($this-&gt;session-&gt;data['shipping_methods']);
                          unset($this-&gt;session-&gt;data['payment_method']);
                          unset($this-&gt;session-&gt;data['payment_methods']);
                          unset($this-&gt;session-&gt;data['guest']);
                          unset($this-&gt;session-&gt;data['comment']);
                          unset($this-&gt;session-&gt;data['order_id']);    
                          unset($this-&gt;session-&gt;data['coupon']);
                          unset($this-&gt;session-&gt;data['reward']);
                          unset($this-&gt;session-&gt;data['voucher']);
                          unset($this-&gt;session-&gt;data['vouchers']);
                      }   
                      $data['button_continue'] = $this-&gt;language-&gt;get('button_continue');
  
                      $data['continue'] = $this-&gt;url-&gt;link('common/home');
  
                      //$this-&gt;redirect($this-&gt;url-&gt;link('checkout/success'));
                  } else {
                      $this-&gt;document-&gt;setTitle('Payment Transaction Failed');
                      $data['heading_title'] = sprintf($this-&gt;language-&gt;get('text_order_failed'),$TxnID);
                      $data['text_message'] = sprintf($this-&gt;language-&gt;get('text_icicipg_eorror_message'), $this-&gt;url-&gt;link('information/contact'),$Message);
                      $data['button_continue'] = $this-&gt;language-&gt;get('button_continue');
                      $data['continue'] = $this-&gt;url-&gt;link('common/home');
                      $order_status_id = $this-&gt;config-&gt;get('icicipg_failed_status_id');
                      $this-&gt;model_checkout_order-&gt;confirm($Order_Id, $order_status_id);
                  }
              } else {
                  $this-&gt;document-&gt;setTitle('Payment Transaction Failed');
                  $data['heading_title'] = $this-&gt;language-&gt;get('text_icicipg_error');
                  $data['text_message'] = sprintf($this-&gt;language-&gt;get('text_icicipg_eorror_message'), $this-&gt;url-&gt;link('information/contact'),'Unspecified');
                  $data['button_continue'] = $this-&gt;language-&gt;get('button_continue');
                  $data['continue'] = $this-&gt;url-&gt;link('common/home');            
              }
  
          } else {
              $this-&gt;document-&gt;setTitle('Payment Transaction Failed');
              $data['heading_title'] = $this-&gt;language-&gt;get('text_icicipg_error');
              $data['text_message'] = sprintf($this-&gt;language-&gt;get('text_icicipg_eorror_message'), $this-&gt;url-&gt;link('information/contact'),'Unspecified');
              $data['button_continue'] = $this-&gt;language-&gt;get('button_continue');
              $data['continue'] = $this-&gt;url-&gt;link('common/home');
  
  
  
          }
          //$data['text_message'] = $astrDigest . '&lt;br/&gt;' .  $astrsfaDigest . '&lt;br/&gt;&lt;pre&gt;' . print_r($_POST ,1) . '&lt;/pre&gt;';
  
          $data['breadcrumbs'] = array();
          $this-&gt;children = array(
              'common/column_left',
              'common/column_right',
              'common/content_top',
              'common/content_bottom',
              'common/footer',
              'common/header'
          );
  
          $data['column_left'] = $this-&gt;load-&gt;controller('common/column_left');
                  $data['column_right'] = $this-&gt;load-&gt;controller('common/column_right');
                  $data['content_top'] = $this-&gt;load-&gt;controller('common/content_top');
                  $data['content_bottom'] = $this-&gt;load-&gt;controller('common/content_bottom');
                  $data['footer'] = $this-&gt;load-&gt;controller('common/footer');
                  $data['header'] = $this-&gt;load-&gt;controller('common/header');
  
          if (file_exists(DIR_TEMPLATE . $this-&gt;config-&gt;get('config_template') . '/template/common/success.tpl')) {
                      $this-&gt;response-&gt;setOutput($this-&gt;load-&gt;view($this-&gt;config-&gt;get('config_template') . '/template/common/success.tpl', $data));
                  } else {
                      $this-&gt;response-&gt;setOutput($this-&gt;load-&gt;view('default/template/common/success.tpl', $data));
                  }
  
      }
  }
  ?&gt;
  </code></pre>