title: OpenCart not adding order history 3.0.1.1
body: <p>I'm not able of solve this problem, I'm stuck here trying figure out what is happening, i installed a payment extension, and when i try pay the product with a credit card, everything works, my payment server confirms the transation and the OpenCart sends email both to seller and to costumer, the problem is, after finish the transation, OpenCart is not adding the order history, to seller and to the costumer, I tryed look on the extension source code, but everything looks fine to me. i ask about it to other people and no one have problems with this extension. the log files just output:</p>
  
  <pre><code>2017-08-19 4:50:29 - FEE5D6-AF8F438F43BD-F004C9EFA444-E7BD05
  </code></pre>
  
  <p>and this is the piece of js at payment extension whitch call the function to confirm the payment:</p>
  
  <pre><code>PagSeguroDirectPayment.createCardToken({
              cardNumber: $('input#numero-cartao').val(),
              brand: $('input#bandeira').val(),
              cvv: $('input#cvv').val(),
              expirationMonth: expiration[0],
              expirationYear: expiration[1],
              success: function(data) {
                  $.ajax({
                      url: 'index.php?route=extension/payment/pagseguro_cartao/transition',
                      data: 'creditCardToken=' + data.card.token + '&amp;senderHash=' + PagSeguroDirectPayment.getSenderHash() + '&amp;installmentQuantity=' + $('select#parcelas option:selected').attr('data-value') + '&amp;installmentValue=' + $('select#parcelas').val() + '&amp;creditCardHolderName=' + $('input#nome').val() + '&amp;creditCardHolderCPF=' + $('input#cpf').val() + '&amp;creditCardHolderBirthDate=' + $('input#data-nascimento').val() + '&amp;creditCardHolderPhone=' + $('input#telefone').val(),
                      type: 'POST',
                      dataType: 'JSON',
                      success: function(data){
                          if (data.error) {
                              $('#warning').html( getError(data.error.code, data.error.message) ).show();
                          } else {
                              $('#button-confirm').attr('disabled');
  
                              $.ajax({
                                  url: 'index.php?route=extension/payment/pagseguro_cartao/confirm',
                                  data: 'status=' + data.status,
                                  type: 'POST',
                                  success: function() {
                                      /*location.href = '{{ continue }}'*/
                                  }
                              });
                          }
                      },
                      complete: function(data) {
                          $('#button-confirm').button('reset');
                      }
                  });
              },
              error: function(data) {
                  console.log(data);
                  var html = '&lt;ul&gt;';
                  $.each(data.errors, function(i,e){
                      html += '&lt;li&gt;' + getError(i,e) + '&lt;/li&gt;';
                  });
                  html += '&lt;/ul&gt;';
  
                  $('#warning').html(html).show();
  
                  $('#button-confirm').button('reset');
              }
          });
      });
  </code></pre>
  
  <p>and the controller at catalog/controller/extension/payment:</p>
  
  <pre><code>public function confirm() {
          $this-&gt;load-&gt;model('checkout/order');
  
          switch ($this-&gt;request-&gt;post['status']) {
              case 1:
                  $status = $this-&gt;config-&gt;get('payment_pagseguro_aguardando_pagamento');
                  break;
              case 2:
                  $status = $this-&gt;config-&gt;get('payment_pagseguro_analise');
                  break;
              case 3:
                  $status = $this-&gt;config-&gt;get('payment_pagseguro_paga');
                  break;
              case 4:
                  $status = $this-&gt;config-&gt;get('payment_pagseguro_disponivel');
                  break;
              case 5:
                  $status = $this-&gt;config-&gt;get('payment_pagseguro_disputa');
                  break;
              case 6:
                  $status = $this-&gt;config-&gt;get('payment_pagseguro_devolvida');
                  break;
              case 7:
                  $status = $this-&gt;config-&gt;get('payment_pagseguro_cancelada');
                  break;
              default: 
                  $status = $this-&gt;config-&gt;get('payment_pagseguro_aguardando_pagamento');
                  break;
          }
  
          $this-&gt;model_checkout_order-&gt;addOrderHistory($this-&gt;session-&gt;data['order_id'], $status);
  
          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['comment']);
              unset($this-&gt;session-&gt;data['coupon']);
              unset($this-&gt;session-&gt;data['pagseguro_desconto']);
              unset($this-&gt;session-&gt;data['pagseguro_acrescimo']);
          }
      }
  }
  </code></pre>