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?
QuoteOn my end all the permissions for the Declined are set to Not Allowed. Is that my issue?
what does this mean?
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?
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,
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!
in the plugin.. chk boxes for both
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.
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
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?
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
I very much appreciate your support. Unfortunately, I added the suggested code but we're still getting failed authorize.net orders set as pending. :(
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