示例#1
0
 /**
  * This shows the plugin for choosing in the payment list of the checkout process.
  *
  * @author Valerie Cartan Isaksen
  */
 public function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn)
 {
     if ($this->getPluginMethods($cart->vendorId) === 0) {
         if (empty($this->_name)) {
             $app = JFactory::getApplication();
             $app->enqueueMessage(vmText::_('COM_VIRTUEMART_CART_NO_' . strtoupper($this->_psType)));
             return false;
         } else {
             return false;
         }
     }
     $html = array();
     $method_name = $this->_psType . '_name';
     VmConfig::loadJLang('com_virtuemart', true);
     vmJsApi::jCreditCard();
     $htmla = '';
     $html = array();
     foreach ($this->methods as $_currentMethod) {
         $this->_currentMethod = $_currentMethod;
         if ($this->checkConditions($cart, $this->_currentMethod, $cart->cartPrices)) {
             $cartPrices = $cart->cartPrices;
             $methodSalesPrice = $this->setCartPrices($cart, $cartPrices, $this->_currentMethod);
             $this->_currentMethod->{$method_name} = $this->renderPluginName($this->_currentMethod);
             $sandbox = $this->_currentMethod->sandbox;
             $html = $this->getPluginHtml($this->_currentMethod, $selected, $methodSalesPrice);
             if ($selected == $this->_currentMethod->virtuemart_paymentmethod_id && $this->hasBillingAddress($cart)) {
                 $html .= $this->displayForm($cart, $sandbox);
             }
             $htmla[] = $html;
         }
     }
     $htmlIn[] = $htmla;
     return true;
 }
示例#2
0
    /**
     * This shows the plugin for choosing in the payment list of the checkout process.
     *
     * @author Valerie Cartan Isaksen
     */
    function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn)
    {
        //JHTML::_ ('behavior.tooltip');
        if ($this->getPluginMethods($cart->vendorId) === 0) {
            if (empty($this->_name)) {
                $app = JFactory::getApplication();
                $app->enqueueMessage(vmText::_('COM_VIRTUEMART_CART_NO_' . strtoupper($this->_psType)));
                return FALSE;
            } else {
                return FALSE;
            }
        }
        $html = array();
        $method_name = $this->_psType . '_name';
        JHTML::script('vmcreditcard.js', 'components/com_virtuemart/assets/js/', FALSE);
        VmConfig::loadJLang('com_virtuemart', true);
        vmJsApi::jCreditCard();
        $htmla = '';
        $html = array();
        foreach ($this->methods as $this->_currentMethod) {
            if ($this->checkConditions($cart, $this->_currentMethod, $cart->cartPrices)) {
                $methodSalesPrice = $this->setCartPrices($cart, $cart->cartPrices, $this->_currentMethod);
                $this->_currentMethod->{$method_name} = $this->renderPluginName($this->_currentMethod);
                $html = $this->getPluginHtml($this->_currentMethod, $selected, $methodSalesPrice);
                if ($selected == $this->_currentMethod->virtuemart_paymentmethod_id) {
                    $this->_getAuthorizeNetFromSession();
                } else {
                    $this->_cc_type = '';
                    $this->_cc_number = '';
                    $this->_cc_cvv = '';
                    $this->_cc_expire_month = '';
                    $this->_cc_expire_year = '';
                }
                if (empty($this->_currentMethod->creditcards)) {
                    $this->_currentMethod->creditcards = self::getCreditCards();
                } elseif (!is_array($this->_currentMethod->creditcards)) {
                    $this->_currentMethod->creditcards = (array) $this->_currentMethod->creditcards;
                }
                $creditCards = $this->_currentMethod->creditcards;
                $creditCardList = '';
                if ($creditCards) {
                    $creditCardList = $this->_renderCreditCardList($creditCards, $this->_cc_type, $this->_currentMethod->virtuemart_paymentmethod_id, FALSE);
                }
                $sandbox_msg = "";
                if ($this->_currentMethod->sandbox) {
                    $sandbox_msg .= '<br />' . vmText::_('VMPAYMENT_AUTHORIZENET_SANDBOX_TEST_NUMBERS');
                }
                $cvv_images = $this->_displayCVVImages($this->_currentMethod);
                $html .= '<br /><span class="vmpayment_cardinfo">' . vmText::_('VMPAYMENT_AUTHORIZENET_COMPLETE_FORM') . $sandbox_msg . '
		    <table border="0" cellspacing="0" cellpadding="2" width="100%">
		    <tr valign="top">
		        <td nowrap width="10%" align="right">
		        	<label for="creditcardtype">' . vmText::_('VMPAYMENT_AUTHORIZENET_CCTYPE') . '</label>
		        </td>
		        <td>' . $creditCardList . '</td>
		    </tr>
		    <tr valign="top">
		        <td nowrap width="10%" align="right">
		        	<label for="cc_type">' . vmText::_('VMPAYMENT_AUTHORIZENET_CCNUM') . '</label>
		        </td>
		        <td>
				<script type="text/javascript">
				//<![CDATA[  
				  function checkAuthorizeNet(id, el)
				   {
				     ccError=razCCerror(id);
					CheckCreditCardNumber(el.value, id);
					if (!ccError) {
					el.value=\'\';}
				   }
				//]]> 
				</script>
		        <input type="text" class="inputbox" id="cc_number_' . $this->_currentMethod->virtuemart_paymentmethod_id . '" name="cc_number_' . $this->_currentMethod->virtuemart_paymentmethod_id . '" value="' . $this->_cc_number . '"    autocomplete="off"   onchange="javascript:checkAuthorizeNet(' . $this->_currentMethod->virtuemart_paymentmethod_id . ', this);"  />
		        <div id="cc_cardnumber_errormsg_' . $this->_currentMethod->virtuemart_paymentmethod_id . '"></div>
		    </td>
		    </tr>
		    <tr valign="top">
		        <td nowrap width="10%" align="right">
		        	<label for="cc_cvv">' . vmText::_('VMPAYMENT_AUTHORIZENET_CVV2') . '</label>
		        </td>
		        <td>
		            <input type="text" class="inputbox" id="cc_cvv_' . $this->_currentMethod->virtuemart_paymentmethod_id . '" name="cc_cvv_' . $this->_currentMethod->virtuemart_paymentmethod_id . '" maxlength="4" size="5" value="' . $this->_cc_cvv . '" autocomplete="off" />

			<span class="hasTip" title="' . vmText::_('VMPAYMENT_AUTHORIZENET_WHATISCVV') . '::' . vmText::sprintf("VMPAYMENT_AUTHORIZENET_WHATISCVV_TOOLTIP", $cvv_images) . ' ">' . vmText::_('VMPAYMENT_AUTHORIZENET_WHATISCVV') . '
			</span></td>
		    </tr>
		    <tr>
		        <td nowrap width="10%" align="right">' . vmText::_('VMPAYMENT_AUTHORIZENET_EXDATE') . '</td>
		        <td> ';
                $html .= shopfunctions::listMonths('cc_expire_month_' . $this->_currentMethod->virtuemart_paymentmethod_id, $this->_cc_expire_month);
                $html .= " / ";
                $html .= '
				<script type="text/javascript">
				//<![CDATA[  
				  function changeDate(id, el)
				   {
				     var month = document.getElementById(\'cc_expire_month_\'+id); if(!CreditCardisExpiryDate(month.value,el.value, id))
					 {el.value=\'\';
					 month.value=\'\';}
				   }
				//]]> 
				</script>';
                $html .= shopfunctions::listYears('cc_expire_year_' . $this->_currentMethod->virtuemart_paymentmethod_id, $this->_cc_expire_year, NULL, 2022, " onchange=\"javascript:changeDate(" . $this->_currentMethod->virtuemart_paymentmethod_id . ", this);\" ");
                $html .= '<div id="cc_expiredate_errormsg_' . $this->_currentMethod->virtuemart_paymentmethod_id . '"></div>';
                $html .= '</td>  </tr>  	</table></span>';
                $htmla[] = $html;
            }
        }
        $htmlIn[] = $htmla;
        return TRUE;
    }
示例#3
0
 * Copyright (C) 2004-2014 Virtuemart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
 *
 * http://virtuemart.net
 */
defined('_JEXEC') or die;
$ccData = $viewData['ccData'];
JHTML::_('behavior.tooltip');
JHTML::script('vmcreditcard.js', 'components/com_virtuemart/assets/js/', false);
VmConfig::loadJLang('com_virtuemart', true);
vmJsApi::jCreditCard();
vmJsApi::jQuery();
vmJsApi::chosenDropDowns();
$doc = JFactory::getDocument();
$doc->addScript(JURI::root(true) . '/plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/js/site.js');
$doc->addStyleSheet(JURI::root(true) . '/plugins/vmpayment/realex_hpp_api/realex_hpp_api/assets/css/realex.css');
$attribute = '';
if ($viewData['dccinfo']) {
    $attribute = ' readonly ';
}
?>
<div class="realex remote_cc_form" id="remote_cc_form">

<h3 class="order_amount"><?php 
echo $viewData['order_amount'];
?>
    /**
     * plgVmDisplayListFEPayment
     * This event is fired to display the pluginmethods in the cart (edit shipment/payment) for exampel
     *
     * @param object  $cart Cart object
     */
    public function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn)
    {
        if ($this->getPluginMethods($cart->vendorId) === 0) {
            if (empty($this->_name)) {
                $app = JFactory::getApplication();
                $app->enqueueMessage(vmText::_('COM_VIRTUEMART_CART_NO_' . strtoupper($this->_psType)));
                return FALSE;
            } else {
                return FALSE;
            }
        }
        $html = array();
        $method_name = $this->_psType . '_name';
        VmConfig::loadJLang('com_virtuemart', true);
        vmJsApi::jCreditCard();
        $htmla = '';
        $html = array();
        foreach ($this->methods as $this->_currentMethod) {
            $methodSalesPrice = $this->setCartPrices($cart, $cart->cartPrices, $this->_currentMethod);
            $this->_currentMethod->{$method_name} = $this->renderPluginName($this->_currentMethod);
            $html = $this->getPluginHtml($this->_currentMethod, $selected, $methodSalesPrice);
            $states = Helper::getTPStates();
            //$this->getTPStates();
            $states_html = '<select name="tp_states" id="tp_states">';
            foreach ($states as $city => $code) {
                $states_html .= '<option value="' . $code . '">' . $city . '</option>';
            }
            $states_html .= '</select>';
            $html .= '<br /><br />
			<table border="0" cellspacing="0" cellpadding="0" width="100%">
			<tr valign="top" style="border:none">
			<td nowrapalign="left" >
			<img src="' . JURI::root() . 'plugins/vmpayment/todopago/logo.jpg" />
			<br /><br />
			<label for="cc_type">Elige la provincia</label>
			' . $states_html . '</td>
			</tr>
			</table><br />';
            $htmla[] = $html;
        }
        $htmlIn[] = $htmla;
        return TRUE;
    }
示例#5
0
    /**
     * This shows the plugin for choosing in the payment list of the checkout process.
     *
     * @author Valerie Cartan Isaksen
     */
    function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn)
    {
        JHTML::_('behavior.tooltip');
        if ($this->getPluginMethods($cart->vendorId) === 0) {
            if (empty($this->_name)) {
                $app = JFactory::getApplication();
                $app->enqueueMessage(JText::_('COM_VIRTUEMART_CART_NO_' . strtoupper($this->_psType)));
                return false;
            } else {
                return false;
            }
        }
        $html = array();
        $method_name = $this->_psType . '_name';
        JHTML::script('vmcreditcard.js', 'components/com_virtuemart/assets/js/', false);
        JFactory::getLanguage()->load('com_virtuemart');
        vmJsApi::jCreditCard();
        $htmla = '';
        $html = array();
        foreach ($this->methods as $method) {
            if ($this->checkConditions($cart, $method, $cart->pricesUnformatted)) {
                $methodSalesPrice = $this->calculateSalesPrice($cart, $method, $cart->pricesUnformatted);
                $method->{$method_name} = $this->renderPluginName($method);
                $html = $this->getPluginHtml($method, $selected, $methodSalesPrice);
                if ($selected == $method->virtuemart_paymentmethod_id) {
                    if (!empty($authorizeSession->cc_type)) {
                        $this->_cc_type = $authorizeSession->cc_type;
                    }
                    if (!empty($authorizeSession->cc_number)) {
                        $this->_cc_number = $authorizeSession->cc_number;
                    }
                    if (!empty($authorizeSession->cc_cvv)) {
                        $this->_cc_cvv = $authorizeSession->cc_cvv;
                    }
                    if (!empty($authorizeSession->cc_expire_month)) {
                        $this->_cc_expire_month = $authorizeSession->cc_expire_month;
                    }
                    if (!empty($authorizeSession->cart_cc_expire_year)) {
                        $this->_cc_expire_year = $authorizeSession->_cc_expire_year;
                    }
                } else {
                    $this->_cc_type = '';
                    $this->_cc_number = '';
                    $this->_cc_cvv = '';
                    $this->_cc_expire_month = '';
                    $this->_cc_expire_year = '';
                }
                $creditCards = $method->creditcards;
                $creditCardList = '';
                if ($creditCards) {
                    $creditCardList = $this->_renderCreditCardList($creditCards, $this->_cc_type, $method->virtuemart_paymentmethod_id, false);
                }
                $sandbox_msg = "";
                if ($method->sandbox) {
                    $sandbox_msg .= '<br />' . JText::_('VMPAYMENT_AUTHORIZENET_SANDBOX_TEST_NUMBERS');
                }
                $cvv_images = $this->_displayCVVImages($method);
                $html .= '<br /><span class="vmpayment_cardinfo">' . JText::_('VMPAYMENT_AUTHORIZENET_COMPLETE_FORM') . $sandbox_msg . '
		    <table border="0" cellspacing="0" cellpadding="2" width="100%">
		    <tr valign="top">
		        <td nowrap width="10%" align="right">
		        	<label for="creditcardtype">' . JText::_('VMPAYMENT_AUTHORIZENET_CCTYPE') . '</label>
		        </td>
		        <td>' . $creditCardList . '</td>
		    </tr>

		    <tr valign="top">
		        <td nowrap width="10%" align="right">
		        	<label for="cc_type">' . JText::_('VMPAYMENT_AUTHORIZENET_CCNUM') . '</label>
		        </td>
		        <td>
		        <input type="text" class="inputbox" id="cc_number_' . $method->virtuemart_paymentmethod_id . '" name="cc_number_' . $method->virtuemart_paymentmethod_id . '" value="' . $this->_cc_number . '"    autocomplete="off"   onchange="ccError=razCCerror(' . $method->virtuemart_paymentmethod_id . ');
	CheckCreditCardNumber(this . value, ' . $method->virtuemart_paymentmethod_id . ');
	if (!ccError) {
	    this.value=\'\';}" />
		        <div id="cc_cardnumber_errormsg_' . $method->virtuemart_paymentmethod_id . '"></div>
		    </td>
		    </tr>
		    <tr valign="top">
		        <td nowrap width="10%" align="right">
		        	<label for="cc_cvv">' . JText::_('VMPAYMENT_AUTHORIZENET_CVV2') . '</label>
		        </td>
		        <td>
		            <input type="text" class="inputbox" id="cc_cvv_' . $method->virtuemart_paymentmethod_id . '" name="cc_cvv_' . $method->virtuemart_paymentmethod_id . '" maxlength="4" size="5" value="' . $this->_cc_cvv . '" autocomplete="off" />

			<span class="hasTip" title="' . JText::_('VMPAYMENT_AUTHORIZENET_WHATISCVV') . '::' . JText::sprintf("VMPAYMENT_AUTHORIZENET_WHATISCVV_TOOLTIP", $cvv_images) . ' ">' . JText::_('VMPAYMENT_AUTHORIZENET_WHATISCVV') . '
			</span></td>
		    </tr>
		    <tr>
		        <td nowrap width="10%" align="right">' . JText::_('VMPAYMENT_AUTHORIZENET_EXDATE') . '</td>
		        <td> ';
                $html .= shopfunctions::listMonths('cc_expire_month_' . $method->virtuemart_paymentmethod_id, $this->_cc_expire_month);
                $html .= " / ";
                $html .= shopfunctions::listYears('cc_expire_year_' . $method->virtuemart_paymentmethod_id, $this->_cc_expire_year, null, null, "onchange=\"var month = document.getElementById('cc_expire_month_'.{$method->virtuemart_paymentmethod_id}); if(!CreditCardisExpiryDate(month.value,this.value, '.{$method->virtuemart_paymentmethod_id}.')){this.value='';month.value='';}\" ");
                $html .= '<div id="cc_expiredate_errormsg_' . $method->virtuemart_paymentmethod_id . '"></div>';
                $html .= '</td>  </tr>  	</table></span>';
                $htmla[] = $html;
            }
        }
        $htmlIn[] = $htmla;
        return true;
    }