我无法解决这个问题,我被困在这里试图弄清楚发生了什么,我安装了支付扩展,当我尝试用信用卡支付产品时,一切正常,我的支付服务器确认交易和OpenCart 向卖家和客户发送电子邮件,问题是,完成交易后,OpenCart 没有向卖家和客户添加订单历史记录,我尝试查看扩展源代码,但对我来说一切都很好. 我问其他人,没有人对这个扩展有问题。日志文件只是输出:
2017-08-19 4:50:29 - FEE5D6-AF8F438F43BD-F004C9EFA444-E7BD05
这是付款扩展中的一段js,它调用该函数来确认付款:
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');
}
});
});
和目录/控制器/扩展/付款处的控制器:
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']);
}
}
}