PaymentResponseReceived(); $this->ShipmentResponseReceived(); } /** * ResponseReceived() * From the payment page, the user returns to the shop. The order email is sent, and the cart emptied. * */ function PaymentResponseReceived() { if (!class_exists('vmPSPlugin')) require(JPATH_VM_PLUGINS . DS . 'vmpsplugin.php'); vPluginHelper::importPlugin('vmpayment'); $return_context = ""; $dispatcher = vDispatcher::getInstance(); $html = ""; $paymentResponse = vmText::_('COM_VIRTUEMART_CART_THANKYOU'); $returnValues = $dispatcher->trigger('plgVmOnPaymentResponseReceived', array( 'html' => &$html,&$paymentResponse)); $view = $this->getView('vmplg', 'html'); $layoutName = vRequest::getVar('layout', 'default'); $view->setLayout($layoutName); $view->assignRef('paymentResponse', $paymentResponse); $view->assignRef('paymentResponseHtml', $html); // Display it all $view->display(); } /** * */ function ShipmentResponseReceived() { // TODO: not ready yet if (!class_exists('vmPSPlugin')) require(JPATH_VM_PLUGINS . DS . 'vmpsplugin.php'); vPluginHelper::importPlugin('vmshipment'); $return_context = ""; $dispatcher = vDispatcher::getInstance(); $html = ""; $shipmentResponse = vmText::_('COM_VIRTUEMART_CART_THANKYOU'); $dispatcher->trigger('plgVmOnShipmentResponseReceived', array( 'html' => &$html,&$shipmentResponse)); } /** * PaymentUserCancel() * From the payment page, the user has cancelled the order. The order previousy created is deleted. * The cart is not emptied, so the user can reorder if necessary. * then delete the order * */ function pluginUserPaymentCancel() { if (!class_exists('vmPSPlugin')) require(JPATH_VM_PLUGINS . DS . 'vmpsplugin.php'); if (!class_exists('VirtueMartCart')) require(VMPATH_SITE . DS . 'helpers' . DS . 'cart.php'); $cart = VirtueMartCart::getCart (); $cart->prepareCartData(); if (!empty($cart->couponCode)) { if (!class_exists('CouponHelper')) require(VMPATH_SITE . DS . 'helpers' . DS . 'coupon.php'); CouponHelper::setInUseCoupon($cart->couponCode, false); } vPluginHelper::importPlugin('vmpayment'); $dispatcher = vDispatcher::getInstance(); $dispatcher->trigger('plgVmOnUserPaymentCancel', array()); // return to cart view $view = $this->getView('cart', 'html'); $layoutName = vRequest::getCmd('layout', 'default'); $view->setLayout($layoutName); // Display it all $view->display(); } /** * Attention this is the function which processs the response of the payment plugin * * @return success of update */ function pluginNotification() { if (!class_exists('vmPSPlugin')) require(JPATH_VM_PLUGINS . DS . 'vmpsplugin.php'); if (!class_exists('VirtueMartCart')) require(VMPATH_SITE . DS . 'helpers' . DS . 'cart.php'); if (!class_exists('VirtueMartModelOrders')) require( VMPATH_ADMIN . DS . 'models' . DS . 'orders.php' ); vPluginHelper::importPlugin('vmpayment'); $dispatcher = vDispatcher::getInstance(); $returnValues = $dispatcher->trigger('plgVmOnPaymentNotification', array()); } /** * Alias for task=pluginNotification * * @return success of update */ function notify () { $this->pluginNotification(); } } //pure php no Tag