Umesh
Umesh

Reputation: 193

How to find response after payment process complete in joomla virtuemart?

I am using virtuemart in joomla for ecommerce purpose. It's working fine. But after checkout from cart it redirect to paypal ( or other payment system). After completion of payment process, paypal again redirects to my website. It's working all stuff smoothly. But problem is that how to know that payment process is complete successfully or not from my website? Is virtuemart automatic does this or not ? if yes then, which file is responsible for this ?

Upvotes: 4

Views: 817

Answers (1)

Camden Narzt
Camden Narzt

Reputation: 2013

It's not automatic, but it's also not hard (aside from VM's terrible documentation), here's a skeleton of the plugin you want to write:

<?php
defined('_JEXEC') or die('Restricted access');
if (!class_exists('vmCustomPlugin')){
    require(JPATH_VM_PLUGINS . '/vmcustomplugin.php');
}
class plgVmcustomAfterOrderConfirmedHook extends vmCustomPlugin {
      function plgVmConfirmedOrder($cart, $order){
           $db = JFactory::getDBO();
           $db->setQuery($db->getQuery(true)
             ->select('order_status')
             ->from('#__virtuemart_orders')
             ->where('virtuemart_order_id = '.intval($order['details']['BT']->virtuemart_order_id)));
           if($db->loadResult() === 'C'){
             blah();
           }
      }
}
?>

Upvotes: 1

Related Questions