News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Authorize.net declined card but Virtuemart marked as pending

Started by sean_nwfs, October 15, 2018, 17:51:47 PM

Previous topic - Next topic

sean_nwfs

I am having trouble figuring out what is wrong with my store. We get occasional credit card orders on Authorize.net that are declined but Virtuemart marks them as pending. I already have set my Order status parameters so that only "Order Status for Approved Payments" should be marked as "Pending." Transactions declined and held for review should be marked as Declined. What should the permissions be on the "Declined" order status? On my end all the permissions for the Declined are set to Not Allowed. Is that my issue? If not, why are declined cards getting marked as Pending?
Joomla 3.9.12
VM 3.6.4 10187

GJC Web Design

QuoteOn my end all the permissions for the Declined are set to Not Allowed. Is that my issue?

what does this mean?
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

sean_nwfs

In Virtuemart, if you go to Configuration > Order Statuses > Decline > Permissions, all the listed "Calculated Settings" are set to Not Allowed (Inherited).  Does the Order Status need to be set to Allowed or would something else cause my order status to always show as Pending, even if a credit card is declined?
Joomla 3.9.12
VM 3.6.4 10187

GJC Web Design

Do u mean ACL permissions?

These are just what members of different Joomla user groups can do -- nothing to do with VM functionality

If not then I don't know where u are talking about.. screenshot?

have u switched on debugging and logging to see what is happening in the plugin?
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

sean_nwfs

GJC,
I have not turned on debugging. Do you have any guidance on where to turn on debugging and what I might look for with authorize.net on a declined order to VM?

Thanks for your patience and help!
Joomla 3.9.12
VM 3.6.4 10187

GJC Web Design

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

sean_nwfs

I have collected logs and have received an order as pending when the card was declined.

This is what I see in the logs:
Authorize.net log
2018-10-18 19:25:05 MESSAGE _handleResponse PAYMENT DECLINED: There was an error while processing your transaction: This transaction has been declined. (2)<br />
2018-10-18 19:29:29 DEBUG plgVmConfirmedOrder: before store

com_virtuemart log
2018-10-18 19:25:04 ERROR vmError: TableUserinfos COM_VIRTUEMART_VIRTUEMART_USER_ID in record is missing ! Can't save the record with no COM_VIRTUEMART_VIRTUEMART_USER_ID.
Joomla 3.9.12
VM 3.6.4 10187

GJC Web Design

plugins\vmpayment\authorizenet\authorizenet.php

function plgVmConfirmedOrder(VirtueMartCart $cart, $order)  ~ line 574

if ($this->error) {
$new_status = $this->_currentMethod->payment_declined_status;
$this->_handlePaymentCancel($order['details']['BT']->virtuemart_order_id, $html);
return; // will not process the order
} else {
if ($this->approved) {
$this->_clearAuthorizeNetSession();
$new_status = $this->_currentMethod->payment_approved_status;
} else {
if ($this->declined) {
vRequest::setVar('html', $html);
$new_status = $this->_currentMethod->payment_declined_status;
$this->_handlePaymentCancel($order['details']['BT']->virtuemart_order_id, $html);
return;
} else {
if ($this->held) {
$this->_clearAuthorizeNetSession();
$new_status = $this->_currentMethod->payment_held_status;
}
}
}
}
$modelOrder = VmModel::getModel('orders');
$order['order_status'] = $new_status;
$order['customer_notified'] = 1;
$order['comments'] = '';
$modelOrder->updateStatusForOneOrder($order['details']['BT']->virtuemart_order_id, $order, TRUE);



hmmm ..  I don't think the return should be there -- it never reaches the 

$modelOrder->updateStatusForOneOrder($order['details']['BT']->virtuemart_order_id, $order, TRUE);

you could try commenting it out

//return;

but I would recommend to test immediately
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

sean_nwfs

When I commented that line out I had a customer who called to say that they were getting an "Invalid data entered" error when trying to process an order. I put Authorize.net in sandbox mode and tried to make an order and saw the same thing. Once I put the return; back in it seems to have gone away. I can't be sure that the customer was entering their information correctly or not but I wouldn't be surprised if they were doing something wrong. I had several orders over the weekend that seemed to have worked just fine.  If I pay for support through Virtuemart, is this something they can help resolve?
Joomla 3.9.12
VM 3.6.4 10187

GJC Web Design

Yes -- normally you buy a membership

but first try adding


$modelOrder = VmModel::getModel('orders');
$order['order_status'] = $new_status;
$order['customer_notified'] = 1;
$order['comments'] = '';
$modelOrder->updateStatusForOneOrder($order['details']['BT']->virtuemart_order_id, $order, TRUE);



just before the return;  we discussed and keep the return there

this will hopefully set the status to declined b4 returning
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

sean_nwfs

I very much appreciate your support. Unfortunately, I added the suggested code but we're still getting failed authorize.net orders set as pending.  :(
Joomla 3.9.12
VM 3.6.4 10187

GJC Web Design

you need to set up some repeatable test install where you can POST returns and debug what is happening

otherwise add some of your own logging to see what happens ..

guessing is never going to do it...

see - https://www.gjcwebdesign.com/joomla-virtuemart-tips/802-php-log-anything.html
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