News:

Support the VirtueMart project and become a member

Main Menu

Paybox payments

Started by jefcomp, September 26, 2018, 17:39:10 PM

Previous topic - Next topic

jefcomp

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.

corenbla

Hello,

This post might be old, but I appear to have exactly the same problem.

Is there any insight on how to fix this?

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

corenbla

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)?

corenbla

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

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation