Hi,
I have a problem with Paybox payments
When a customer makes a payment attempt refused by Paybox (often because of a card number entry error), the status of the order changes to 'Canceled'
When the customer makes their 2nd attempt, which this time is correct, the payment is accepted, the customer receives the confirmation ticket from Paybox, but the status remains on 'Canceled' instead of going to 'Confirmed' which creates problems with customers.
Has anyone ever had this problem?
Thank you in advance for your help.
Hello,
This post might be old, but I appear to have exactly the same problem.
Is there any insight on how to fix this?
the code in the plugin will need rewriting
the return from Paybox when cancelled goes to function plgVmOnUserPaymentCancel()
this in turn calls function handlePaymentUserCancel ($virtuemart_order_id)
which sets the order to cancelled
// set the order to cancel , to handle the stock correctly
$modelOrder = VmModel::getModel ('orders');
$order['order_status'] = 'X';
$order['virtuemart_order_id'] = $virtuemart_order_id;
$order['customer_notified'] = 0;
$order['comments'] = vmText::_ ('COM_VIRTUEMART_PAYMENT_CANCELLED_BY_SHOPPER');
$modelOrder->updateStatusForOneOrder ($virtuemart_order_id, $order, TRUE);
the function plgVmOnUserPaymentCancel() needs rewriting to set the order to P or have a config in the plugin to choose how to handle this
Hey, thanks for the quick answer !
I think I see your point, but wouldn't rewritting plgVmOnUserPaymentCancel() change the behavour on all canceled payments? I don't want truly canceled payment to stay on P.
Is there a way to change the state of the payment to P if paybox return an error code of '00004' (This is the error I get when credentials are incorrect)?
Alright, I made an edit that seem to do the trick!
In plugins\vmpayment\paybox\paybox\helpers\paybox.php , on the method updateOrderStatus($paybox_data, $order, $payments), add at the top
if ($paybox_data['E'] == '00004') {
return NULL;
}
Thanks for unblocking me, this bug took way too much time for me to fix ;D
Quotebut wouldn't rewritting plgVmOnUserPaymentCancel() change the behavour on all canceled payments?
no -- it is only called within paybox.php by a cancel call from the payment gateway