Author Topic: Paybox payments  (Read 672 times)

jefcomp

  • Beginner
  • *
  • Posts: 2
Paybox payments
« on: September 26, 2018, 17:39:10 pm »
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

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: Paybox payments
« Reply #1 on: September 24, 2019, 14:31:01 pm »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9230
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Paybox payments
« Reply #2 on: September 24, 2019, 14:56:21 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

corenbla

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: Paybox payments
« Reply #3 on: September 24, 2019, 15:40:50 pm »
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

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: Paybox payments
« Reply #4 on: September 24, 2019, 16:00:16 pm »
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
Code: [Select]
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9230
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Paybox payments
« Reply #5 on: September 24, 2019, 17:28:26 pm »
Quote
but 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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation