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:
2017-08-19 4:50:29 - FEE5D6-AF8F438F43BD-F004C9EFA444-E7BD05
and this is the piece of js at payment extension whitch call the function to confirm the payment:
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 + '&senderHash=' + PagSeguroDirectPayment.getSenderHash() + '&installmentQuantity=' + $('select#parcelas option:selected').attr('data-value') + '&installmentValue=' + $('select#parcelas').val() + '&creditCardHolderName=' + $('input#nome').val() + '&creditCardHolderCPF=' + $('input#cpf').val() + '&creditCardHolderBirthDate=' + $('input#data-nascimento').val() + '&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 = '<ul>';
$.each(data.errors, function(i,e){
html += '<li>' + getError(i,e) + '</li>';
});
html += '</ul>';
$('#warning').html(html).show();
$('#button-confirm').button('reset');
}
});
});
and the controller at catalog/controller/extension/payment:
public function confirm() {
$this->load->model('checkout/order');
switch ($this->request->post['status']) {
case 1:
$status = $this->config->get('payment_pagseguro_aguardando_pagamento');
break;
case 2:
$status = $this->config->get('payment_pagseguro_analise');
break;
case 3:
$status = $this->config->get('payment_pagseguro_paga');
break;
case 4:
$status = $this->config->get('payment_pagseguro_disponivel');
break;
case 5:
$status = $this->config->get('payment_pagseguro_disputa');
break;
case 6:
$status = $this->config->get('payment_pagseguro_devolvida');
break;
case 7:
$status = $this->config->get('payment_pagseguro_cancelada');
break;
default:
$status = $this->config->get('payment_pagseguro_aguardando_pagamento');
break;
}
$this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $status);
if (isset($this->session->data['order_id'])) {
$this->cart->clear();
unset($this->session->data['shipping_method']);
unset($this->session->data['shipping_methods']);
unset($this->session->data['payment_method']);
unset($this->session->data['payment_methods']);
unset($this->session->data['comment']);
unset($this->session->data['coupon']);
unset($this->session->data['pagseguro_desconto']);
unset($this->session->data['pagseguro_acrescimo']);
}
}
}