Пример #1
0
 /**
  * When a customer chooses Firstdatae4 on Checkout/Payment page
  *
  */
 public function redirectAction()
 {
     if ($this->getRequest()->getPost()) {
         $session = Mage::getSingleton("core/session");
         $session->setData("fde4-recurring", $this->getRequest()->getPost('recurring'));
         $session = Mage::getSingleton('checkout/session');
         $this->create($this->getRequest()->getPost('recurring'));
         $session->setFirstdatae4StandardQuoteId($session->getQuoteId());
         $this->getResponse()->setBody($this->getLayout()->createBlock('firstdatae4/standard_redirect')->toHtml());
         $session->unsQuoteId();
     } else {
         $recurring = new Varien_Data_Form();
         $recurring->setAction(Mage::getBaseUrl() . 'firstdatae4/standard/redirect/')->setId('recurring-profiles')->setName('recurring-profiles')->setMethod('POST')->setUseContainer(true);
         $model = Mage::getModel('firstdatae4/plans');
         $plans = $model->toOptionArray();
         foreach ($plans as $key => $value) {
             $radio = 'rp_' . $key;
             $config = Mage::getStoreConfig('firstdatae4/config/' . $radio, Mage::app()->getStore());
             if ($config != '0') {
                 $recurring->addField($radio, 'radio', array('name' => 'recurring', 'value' => $config, 'label' => $value));
             }
         }
         $recurring->addField('none', 'radio', array('name' => 'recurring', 'value' => 0, 'label' => Mage::helper('firstdatae4')->__("I do not want any plan at this time")));
         $recurring->addField('submit', 'submit', array('name' => 'button', 'value' => 'Submit'));
         $html = '<html>' . '<style>' . ' *{ margin: 0; padding:0 ; font-family: Arial; } #top-box{ background-color: #166700; padding: 10px; color: #fff; }' . ' #content { padding: 10px; } input { margin-right: 7px; }' . ' #submit { background: none repeat scroll 0 0 #738d00; border: 0 none; border-radius: 3px; box-shadow: none;  color: #fff; filter: none; line-height: 22px; outline: medium none; padding: 9px 20px; text-shadow: none; transition: background 0.2s linear 0s, color 0.2s linear 0s; white-space: normal; cursor: pointer; display: inline-block; font-size: 14px; font-weight: normal;  margin-top: 20px; }' . '</style>' . '<body>';
         $html .= '<div id="top-box">Habitos Saludables</div>';
         $html .= '<div id="content">' . $this->__('If you want to automatically repeat this purchases, please select the type of profiles you want:');
         $html .= $recurring->toHtml();
         $html .= '</div>';
         $html .= '<script type="text/javascript">document.getElementById("none").checked = true;</script>';
         $html .= '<style>.field-row{ display:block; } .field-row input { float: left;white-space:nowrap;}</style>';
         $html .= '</body></html>';
         echo $html;
     }
 }
    protected function _toHtml()
    {
        $standard = Mage::getModel('BoletoBancario/standard');
        //recupera dados da compra
        $order_id = Mage::getSingleton('checkout/session')->getLastOrderId();
        $order = Mage::getModel('sales/order')->load($order_id);
        $a = $order->getBillingAddress();
        //envia e-mail com a segunda via do boleto
        /*
        $to = $a->getEmail();
        $from = $this->getStandard()->getConfigData('MarchentEmailID');
        $subject = "Boleto Bancário - 2? via";
        $body = '<a href="' . Mage::getUrl("BoletoBancario/standard/view/order_id/$order_id") . '" target="boleto">Clique aqui para exibir a 2? via do boleto</a>';
        
        $this->getStandard()->sendHTMLemail($body, $from, $to, $subject);
        */
        $form = new Varien_Data_Form();
        $form->setAction($standard->getBoletoBancarioUrl())->setId('BoletoBancario_standard_checkout')->setName('BoletoBancario_standard_checkout')->setMethod('POST')->setTarget('boleto')->setUseContainer(true);
        foreach ($standard->getStandardCheckoutFormFields($order) as $field => $value) {
            $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
        }
        $home_url = $this->getSkinUrl('images/boleto/boleto.png');
        $carregando = $this->getSkinUrl('images/boleto/boletocarregando.gif');
        $html = '<html><body>';
        $html .= $this->__('<p align="center"><strong>Estamos gerando o seu Boleto.</strong></p>
		<p align="center"><strong>Aguarde...</strong></p>
			<p align="center">
			<img src="' . $carregando . '" width="169" height="70" /><br /><br />
			<input type="image" src="' . $home_url . '" value="Gerando o Boleto" width="128" height="128"/>
			</p>');
        $html .= $form->toHtml();
        $html .= '<script type="text/javascript">setTimeout(function(){document.getElementById("BoletoBancario_standard_checkout").submit()}, 2000);</script>';
        $html .= '</body></html>';
        return $html;
    }
Пример #3
0
    protected function _toHtml()
    {
        $ccavenuepay = Mage::getModel('ccavenuepay/method_ccavenuepay');
        $form = new Varien_Data_Form();
        $form->setAction($ccavenuepay->getCcavenuepayUrl())->setName('redirect')->setMethod('post')->setUseContainer(true);
        foreach ($ccavenuepay->getStandardCheckoutFormFields('redirect') as $field => $value) {
            $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
        }
        $html = '<html>
				<body style="text-align:center;">';
        $html .= $this->__('You will be redirected to Ccavenuepay in a few seconds.<br /><center>');
        $html .= '<img src="' . $this->getSkinUrl('ccavenue/ccavenue_bz.jpg') . '" border="1" alt="Logo" width="185px" height="70px" /><br /><br />';
        $html .= '<img src="' . $this->getSkinUrl('ccavenue/ajax-loader.gif') . '" alt="ajax-loader" align="center" width="128px" height="15px" /><br /></center>';
        $html .= $this->__('Copyright bluezeal.in');
        $html .= $form->toHtml();
        $html .= '<script type="text/javascript">
	   			  function formsubmit()
				  {
				  	document.redirect.submit();	
				  }
					setTimeout("formsubmit()", 3000);
	            </script>';
        $html .= '</body></html>';
        return $html;
    }
Пример #4
0
 protected function _toHtml()
 {
     try {
         $form = new Varien_Data_Form();
         $form->setAction($this->_getSageSession()->getAcsurl())->setId('sagepaydirectpro_3dsecure')->setName('sagepaydirectpro_3dsecure')->setMethod('POST')->setUseContainer(true);
         $params = array('_secure' => true, 'storeid' => Mage::app()->getStore()->getId());
         $_shipSessData = Mage::getSingleton('checkout/type_onepage')->getQuote()->getShippingAddress()->getShippingMethod();
         if ($_shipSessData) {
             $params['shipmethod'] = $_shipSessData;
         }
         $postUrl = Mage::getModel('core/url')->addSessionParam()->getUrl('sgps/directPayment/callback3d', $params);
         $form->addField('PaReq', 'hidden', array('name' => 'PaReq', 'value' => $this->_getSageSession()->getPareq()));
         $form->addField('MD', 'hidden', array('name' => 'MD', 'value' => $this->_getSageSession()->getEmede()));
         #$form->addField('TermUrl', 'hidden', array('name'=>'TermUrl', 'value' => Mage::getUrl('sgps/directPayment/callback3d', array('_secure' => true))));
         $form->addField('TermUrl', 'hidden', array('name' => 'TermUrl', 'value' => $postUrl));
         $html = '<html><body>';
         $html .= '<code>' . $this->__('Loading 3D secure form...') . '</code>';
         $html .= $form->toHtml();
         $html .= '<script type="text/javascript">document.getElementById("sagepaydirectpro_3dsecure").submit();</script>';
         $html .= '</body></html>';
         Sage_Log::log($html, null, 'SagePaySuite_REQUEST.log');
     } catch (Exception $e) {
         Ebizmarts_SagePaySuite_Log::we($e);
     }
     return $html;
 }
Пример #5
0
 protected function _toHtml()
 {
     $standard = Mage::getModel('bradesco/standard');
     $form = new Varien_Data_Form();
     $scopusTipo = $standard->getScopusTipo();
     $form->setAction($standard->getBradescoUrl($bradesco_tipo))->setId('bradesco_standard_checkout')->setName('bradesco_standard_checkout')->setMethod('POST')->setUseContainer(true);
     $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
     $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
     $bradesco = Mage::getModel('bradesco/bradesco')->setUrlBradesco($order->getId(), $standard->getBradescoUrl($bradesco_tipo));
     foreach ($standard->getStandardCheckoutFormFields() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $html = '<html>';
     $html .= '<head>';
     $html .= '<meta http-equiv="Content-Type" content="text/html; " /></head>';
     $html .= '<body>';
     $html .= $this->__('Você será redirecionado para o Bradesco em alguns instantes.');
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("bradesco_standard_checkout").submit();</script>';
     $html .= '</body></html>';
     // echo '<pre>';
     // print_r($form->toHtml());
     // die();
     return $html;
 }
 protected function _toHtml()
 {
     $session = Mage::getSingleton('checkout/session');
     $order = Mage::getModel('sales/order')->loadbyIncrementId($session->getLastRealOrderId());
     // Prevent ugly errors
     $data = $order->getData();
     if (empty($data) || !is_object($order) || !is_object($order->getBillingAddress())) {
         return "<h3>Please refresh the page</h3>";
     }
     $order->addStatusToHistory(Mage_Sales_Model_Order::STATE_HOLDED, 'Customer redirected to NETBANX payment page, awaiting payment confirmation from NETBANX', true);
     $order->save();
     // Construct the redirection form
     $form = new Varien_Data_Form(array('id' => 'netbanx_iframe', 'action' => $this->payment_url(), 'name' => 'netbanx_iframe', 'method' => 'POST'));
     $form->setUseContainer(true);
     $form->addField("clickhere", 'submit', array('name' => "clickhere", 'value' => "click here", 'label' => 'If it\'s taking too long'));
     // Add all the NETBANX parameters
     foreach ($this->craft_parameters($order) as $name => $value) {
         $form->addField($name, 'hidden', array('name' => $name, 'value' => $value));
     }
     // Craft the HTML and return
     $html = $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("netbanx_iframe").submit();</script>';
     if (Mage::getStoreConfig('payment/Netbanx/iframe')) {
         $html = '<html><body>' . $this->__('Please wait whilst you\'re taken to the secure NETBANX page.') . '<br><br>' . $html . '</body></html>';
     }
     return $html;
 }
Пример #7
0
 public function createRedirectForm()
 {
     $form = new Varien_Data_Form();
     $form->setAction($this->getBancoUrl())->setId('debitobb_checkout')->setName('pagamento')->setMethod('POST')->setUseContainer(true);
     $fields = $this->getCheckoutFormFields();
     foreach ($fields as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $submit_script = 'document.getElementById(\'debitobb_checkout\').submit();';
     $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
     $html .= '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="pt-BR">';
     $html .= '<head>';
     $html .= '<meta http-equiv="Content-Language" content="pt-br" />';
     $html .= '<meta name="language" content="pt-br" />';
     $html .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />';
     $html .= '<style type="text/css">';
     $html .= '* { font-family: Arial; font-size: 16px; line-height: 34px; text-align: center; color: #222222; }';
     $html .= 'small, a, a:link:visited:active, a:hover { font-size: 13px; line-height: normal; font-style: italic; }';
     $html .= 'a, a:link:visited:active { font-weight: bold; text-decoration: none; }';
     $html .= 'a:hover { font-weight: bold; text-decoration: underline; color: #555555; }';
     $html .= '</style>';
     $html .= '</head>';
     $html .= '<body onload="' . $submit_script . '">';
     $html .= 'Você será redirecionado ao <strong>Banco do Brasil</strong> em alguns instantes.<br />';
     $html .= '<small>Se a página não carregar, <a href="#" onclick="' . $submit_script . ' return false;">clique aqui</a>.</small>';
     $html .= $form->toHtml();
     $html .= '</body></html>';
     return utf8_decode($html);
 }
 /**
  * @param Varien_Data_Form_Element_Abstract $element
  * @return string
  */
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     /** @var Mage_SalesRUle_Model_Rule $salesRuleModel */
     $salesRuleModel = Mage::getModel('salesrule/rule');
     /** @var Mage_Widget_Block_Adminhtml_Widget_Options $widgetOptions */
     $widgetOptions = $element->getForm()->getParent();
     $widgetValues = $widgetOptions->getWidgetValues();
     if ($widgetValues && isset($widgetValues['rule'])) {
         $rules = unserialize(base64_decode($widgetValues['rule']));
         $salesRuleModel->loadPost($rules);
         $salesRuleModel->getConditions()->setJsFormObject('rule_conditions_fieldset');
         $salesRuleModel->getActions()->setJsFormObject('rule_actions_fieldset');
     }
     $form = new Varien_Data_Form();
     $form->setHtmlIdPrefix('rule_');
     /** @var Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset $renderer */
     $renderer = Mage::getBlockSingleton('adminhtml/widget_form_renderer_fieldset')->setTemplate('rapidcampaign/fieldset.phtml')->setNewChildUrl($this->getUrl('*/promo_quote/newConditionHtml/form/rule_conditions_fieldset'));
     $fieldset = $form->addFieldset('conditions_fieldset', array())->setRenderer($renderer);
     $fieldset->addField('conditions', 'text', array('name' => 'conditions', 'label' => Mage::helper('salesrule')->__('Conditions'), 'title' => Mage::helper('salesrule')->__('Conditions'), 'required' => true))->setRule($salesRuleModel)->setRenderer(Mage::getBlockSingleton('rule/conditions'));
     $fieldset->addClass('fieldset-nowrap');
     $form->setValues($salesRuleModel->getData());
     Mage::register('rapidcampaign/widget/created', true, true);
     $html = $form->toHtml();
     if ($element->getNote()) {
         $html .= '<p class="note"><span>' . $element->getNote() . '</span></p>';
     }
     return $html;
 }
Пример #9
0
	protected function _toHtml()
    {
		$standard = Mage::getModel('BoletoBancario/standard');
		$order_id = $this->getRequest()->getParam('order_id');

        $form = new Varien_Data_Form();
        $form->setAction($standard->getBoletoBancarioViewUrl())
            ->setId('BoletoBancario_standard_view')
            ->setName('BoletoBancario_standard_view')
            ->setMethod('POST')
            ->setUseContainer(true);
        
		foreach ($standard->getStandardViewFormFields($this->getOrder($order_id)) as $field=>$value) {
            $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
        }
		
		$home_url = $this->getSkinUrl('images/boleto/boleto.png');
		$carregando = $this->getSkinUrl('images/boleto/boletocarregando.gif');
        $html = '<html><body>';
        $html.= $this->__('<p align="center"><strong>Estamos gerando o seu Boleto.</strong></p>
		<p align="center"><strong>Aguarde...</strong></p>
			<p align="center">
			<img src="'. $carregando .'" width="169" height="70" /><br /><br />
			<input type="image" src="'. $home_url .'" value="Gerando o Boleto" width="128" height="128"/>
			</p>');
        $html.= $form->toHtml();
		
		//echo $this->getOrder()->getBillingAddress();
		
		$html.= '<script type="text/javascript">setTimeout(function(){document.getElementById("BoletoBancario_standard_view").submit()}, 2000);</script>';
        $html.= '</body></html>';

        return $html;
    }
Пример #10
0
 public function getPaymentInfoHtml($ccType)
 {
     $form = new Varien_Data_Form();
     /*
      * Slip Settings.
      */
     $fieldset = $form->addFieldset("santander_slip_fieldset", array("legend" => null));
     $fieldset->addField("tax", "hidden", array("name" => 'tax', "value" => $this->_getStoreConfig($ccType, 'tax')));
     $fieldset->addField("demonstrative1", "hidden", array("name" => 'demonstrative1', "value" => $this->_getStoreConfig($ccType, 'demonstrative1')));
     $fieldset->addField("demonstrative2", "hidden", array("name" => 'demonstrative2', "value" => $this->_getStoreConfig($ccType, 'demonstrative2')));
     $fieldset->addField("demonstrative3", "hidden", array("name" => 'demonstrative3', "value" => $this->_getStoreConfig($ccType, 'demonstrative3')));
     $fieldset->addField("instructions1", "hidden", array("name" => 'instructions1', "value" => $this->_getStoreConfig($ccType, 'instructions1')));
     $fieldset->addField("instructions2", "hidden", array("name" => 'instructions2', "value" => $this->_getStoreConfig($ccType, 'instructions2')));
     $fieldset->addField("instructions3", "hidden", array("name" => 'instructions3', "value" => $this->_getStoreConfig($ccType, 'instructions3')));
     $fieldset->addField("instructions4", "hidden", array("name" => 'instructions4', "value" => $this->_getStoreConfig($ccType, 'instructions4')));
     $fieldset->addField("acceptance", "hidden", array("name" => 'acceptance', "value" => $this->_getStoreConfig($ccType, 'acceptance')));
     $fieldset->addField("specie", "hidden", array("name" => 'specie', "value" => $this->_getStoreConfig($ccType, 'specie')));
     $fieldset->addField("specie_doc", "hidden", array("name" => 'specie_doc', "value" => $this->_getStoreConfig($ccType, 'specie_doc')));
     $fieldset->addField("client_code", "hidden", array("name" => 'client_code', "value" => $this->_getStoreConfig($ccType, 'client_code')));
     $fieldset->addField("outlet", "hidden", array("name" => 'outlet', "value" => $this->_getStoreConfig($ccType, 'outlet')));
     $fieldset->addField("portfolio", "hidden", array("name" => 'portfolio', "value" => $this->_getStoreConfig($ccType, 'portfolio')));
     $fieldset->addField("portfolio_description", "hidden", array("name" => 'portfolio_description', "value" => $this->_getStoreConfig($ccType, 'portfolio_description')));
     /*
      * Slip Transaction Data.
      */
     $slip_data = $this->getSlipData();
     $fieldset->addField("number", "hidden", array("name" => 'number', "value" => $slip_data['number']));
     $fieldset->addField("expiration", "hidden", array("name" => 'expiration', "value" => $slip_data['expiration']));
     $fieldset->addField("amount", "hidden", array("name" => 'amount', "value" => $slip_data['amount']));
     /*
      * Order Information.
      */
     $_order = $this->getOrder();
     $order_id = $_order->getIncrementId();
     $billing_address = $_order->getBillingAddress();
     $customer_name = $billing_address->getName();
     $customer_address = $billing_address->getStreetFull();
     $customer_city = $billing_address->getCity();
     $customer_region = $billing_address->getRegion();
     $customer_postcode = $billing_address->getPostcode();
     $customer_city_region_postcode = "{$customer_city} - {$customer_region} - {$customer_postcode}";
     $order_items_count = count($_order->getAllVisibleItems());
     $fieldset->addField("order_id", "hidden", array("name" => 'order_id', "value" => $order_id));
     $fieldset->addField("customer_name", "hidden", array("name" => 'customer_name', "value" => $customer_name));
     $fieldset->addField("customer_address", "hidden", array("name" => 'customer_address', "value" => $customer_address));
     $fieldset->addField("customer_city_region_postcode", "hidden", array("name" => 'customer_city_region_postcode', "value" => $customer_city_region_postcode));
     /*
      * Company Information.
      */
     $company_address = Mage::getStoreConfig('general/store_information/address');
     $company_name = Mage::getStoreConfig('general/store_information/name');
     $company_logo_url = Mage::getStoreConfig('design/header/logo_src');
     $fieldset->addField("company_address", "hidden", array("name" => 'company_address', "value" => $company_address));
     $fieldset->addField("company_name", "hidden", array("name" => 'company_name', "value" => $company_name));
     $fieldset->addField("company_logo_url", "hidden", array("name" => 'company_logo_url', "value" => $this->getSkinUrl($company_logo_url)));
     $fieldset->addField("submit", "submit", array("label" => Mage::helper('slips')->__('Submit this transaction'), "value" => Mage::helper('slips')->__('Submit')));
     return $form->toHtml();
 }
 /**
  * Generate HTML form
  *
  * @return string
  */
 public function generateForm()
 {
     $form = new Varien_Data_Form();
     $form->setAction($this->helper->getCheckoutSession()->getEmerchantPayCheckoutRedirectUrl())->setId('emerchantpay_redirect_notification')->setName('emerchantpay_redirect_notification')->setMethod('GET')->setUseContainer(true);
     $submitButton = new Varien_Data_Form_Element_Submit(array('value' => $this->__('Click here, if you are not redirected within 10 seconds...')));
     $submitButton->setId($this->getButtonId());
     $form->addElement($submitButton);
     return $form->toHtml();
 }
Пример #12
0
 public function getCrossSellFieldset($model)
 {
     $form = new Varien_Data_Form();
     $prefix = 'chain[' . $model->getId() . '][';
     $fieldset = $form->addFieldset('fieldset', array('legend' => Mage::helper('email')->__('Cross-sells')));
     $fieldset->addField('cross_sells_enabled', 'select', array('label' => Mage::helper('email')->__('Include cross-sells in email'), 'required' => false, 'name' => $prefix . 'cross_sells_enabled]', 'values' => Mage::getSingleton('adminhtml/system_config_source_yesno')->toOptionArray(), 'value' => $model->getCrossSellsEnabled()));
     $fieldset->addField('cross_sells_type_id', 'select', array('label' => Mage::helper('email')->__('Cross-sells source'), 'required' => false, 'name' => $prefix . 'cross_sells_type_id]', 'values' => Mage::getSingleton('email/system_source_crossSell')->toOptionArray(), 'value' => $model->getCrossSellsTypeId()));
     return $form->toHtml();
 }
Пример #13
0
 /**
  * (non-PHPdoc)
  * @see Mage_Core_Block_Abstract::_beforeToHtml()
  */
 protected function _beforeToHtml()
 {
     $standard = $this->getStandard();
     $form = new Varien_Data_Form();
     $form->setAction($standard->getRequestUrl())->setId('standard_checkout')->setName('standard_checkout')->setMethod('POST')->setUseContainer(true);
     foreach ($standard->getRedirectFields() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $this->setData('message', Mage::helper('bb')->__('You will be redirected to your bank account in a few momments.'));
     $this->setData('form', $form->toHtml());
     return $this;
 }
Пример #14
0
 protected function _toHtml()
 {
     $dragonpay = Mage::getModel('dragonpay/standard');
     $form = new Varien_Data_Form();
     $form->setAction($dragonpay->getUrl())->setId('dragonpay_checkout')->setName('dragonpay_checkout')->setMethod('post')->setUseContainer(true);
     $html = '<html><body>';
     $html .= $this->__('You will be redirected to the payment gateway in a few seconds.');
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("dragonpay_checkout").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }
Пример #15
0
    protected function _toHtml()
    {
        $form = new Varien_Data_Form();
        $form->setAction($this->getTargetURL())->setId($this->getFormId())->setName($this->getFormId())->setMethod($this->getMethod())->setUseContainer(true);
        foreach ($this->_getFormFields() as $field => $value) {
            $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
        }
        //*******************************************
        // BEGIN PAP TRACKING EDITS
        //*******************************************
        $config = Mage::getSingleton('pap/config');
        // we'll need this
        // Add a special field to hold the affiliate cookie data
        $form->addField('pap_ab78y5t4a', 'hidden', array('name' => 'pap-cookie-data', 'id' => 'pap_ab78y5t4a', 'value' => ''));
        //*******************************************
        // END PAP TRACKING EDITS
        //*******************************************
        $html = $form->toHtml();
        //*******************************************
        // BEGIN PAP TRACKING EDITS
        //*******************************************
        ob_start();
        ?>
        <script type="text/javascript">
            (function () {
                var papDomain = (("https:" == document.location.protocol) ? "https://":"http://");papDomain+="<?php 
        echo preg_replace('~^(https?://)?~', '', $config->getRemotePath());
        ?>
";
                var papId = 'pap_x2s6df8d';
                // adjust the ID iff it would conflict with an existing element
                if ((function(elementId){var nodes=new Array();var tmpNode=document.getElementById(elementId);while(tmpNode){nodes.push(tmpNode);tmpNode.id="";tmpNode=document.getElementById(elementId);for(var x=0;x<nodes.length;x++){if(nodes[x]==tmpNode){tmpNode=false;}}}})('pap_x2s6df8d')) {papId += '_salestrack';}
                document.write(unescape("%3Cscript id='pap_x2s6df8d' src='" + papDomain + "/scripts/<?php 
        echo $config->getTracksalescript();
        ?>
' type='text/javascript'%3E%3C/script%3E"));
            })();
        </script>
        <?php 
        $script_block = ob_get_clean();
        // Append the script to make the affiliate tracking work
        $html .= $script_block;
        $html .= '<script type="text/javascript">';
        // Write the tracking data to the form, rather than registering the sale immediately
        $html .= 'PostAffTracker.writeCookieToCustomField(\'pap_ab78y5t4a\');';
        $html .= '</script>';
        //*******************************************
        // END PAP TRACKING EDITS
        //*******************************************
        $html .= '<script type="text/javascript">document.getElementById("' . $this->getFormId() . '").submit();</script>';
        return $html;
    }
Пример #16
0
 /**
  * Redirect user to MtGox payment page
  */
 public function redirectAction()
 {
     $model = Mage::getModel('mtgoxbitcoin/bitcoin');
     $responseData = $model->getBitcoinCheckoutFormFields();
     $form = new Varien_Data_Form();
     $form->setAction($responseData['return']['payment_url'])->setId('mtgox_bitcoin_checkout')->setName('mtgox_bitcoin_checkout')->setMethod('POST')->setUseContainer(TRUE);
     $html = '<html><body>';
     $html .= $this->__('You will be redirected to the MtGox Payment Platform within 5 seconds.');
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">setTimeout(function() { document.getElementById("mtgox_bitcoin_checkout").submit(); }, 4000);</script>';
     $html .= '</body></html>';
     $this->getResponse()->setBody($html);
 }
Пример #17
0
 /**
  * @return string
  */
 protected function _toHtml()
 {
     $form = new Varien_Data_Form();
     $form->setAction($this->getRedirectUrl())->setId($this->_formId)->setName($this->_formId)->setMethod('POST')->setUseContainer(true);
     foreach ($this->getFormData() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $html = '<html><body>';
     $html .= $this->__('You will be redirected to %s in a few seconds.', $this->_redirectlabel);
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("' . $this->_formId . '").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }
 protected function _toHtml()
 {
     $tco = Mage::getModel('tco/checkout');
     $form = new Varien_Data_Form();
     $form->setAction($tco->getUrl())->setId('tcopay')->setName('tcopay')->setMethod('POST')->setUseContainer(true);
     $tco->getFormFields();
     foreach ($tco->getFormFields() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value, 'size' => 200));
     }
     $form->addField('tcosubmit', 'submit', array('name' => 'tcosubmit'));
     $html = '<style> #tcosubmit {display:none;} </style>';
     $html .= $form->toHtml();
     return $html;
 }
 protected function _toHtml()
 {
     $payment = $this->getOrder()->getPayment()->getMethodInstance();
     $form = new Varien_Data_Form();
     $url = $payment->getAdditionalInformation('sofort_payment_url');
     //$url = $payment->getUrl();
     $form->setAction($url)->setId('pnsofortueberweisung')->setName('pnsofortueberweisung')->setMethod('POST')->setUseContainer(true);
     $html = '<html><body>';
     $html .= $this->__('You will be redirected in a few seconds. %s', $url);
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("pnsofortueberweisung").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }
Пример #20
0
 protected function _toHtml()
 {
     $liqpay = Mage::getModel('pbliqpay/liqpay');
     $form = new Varien_Data_Form();
     $form->setAction($liqpay->getLiqPayUrl())->setId('pbliqpay_liqpay_checkout')->setName('pbliqpay_liqpay_checkout')->setMethod('POST')->setUseContainer(true);
     $form->addField('operation_xml', 'hidden', array('name' => 'operation_xml', 'value' => $liqpay->getEncodedXml()));
     $form->addField('signature', 'hidden', array('name' => 'signature', 'value' => $liqpay->getSign()));
     $html = '<html><body>';
     $html .= iconv('UTF-8', 'windows-1251', $this->__('You will be redirected to LiqPay payment interface in a few seconds.'));
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("pbliqpay_liqpay_checkout").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }
Пример #21
0
 /**
  * Render the chooser HTML
  * Target element should be set.
  *
  * @return string
  */
 protected function _toHtml()
 {
     if (empty($this->_targetElementId)) {
         return '';
     }
     $idSuffix = Mage::helper('Mage_Core_Helper_Data')->uniqHash();
     $form = new Varien_Data_Form();
     foreach (array('from' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('From'), 'to' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('To')) as $key => $label) {
         $id = "{$key}_{$idSuffix}";
         $element = new Varien_Data_Form_Element_Date(array('format' => Varien_Date::DATE_INTERNAL_FORMAT, 'label' => $label, 'image' => $this->getViewFileUrl('images/grid-cal.gif'), 'onchange' => "dateTimeChoose_{$idSuffix}()", 'value' => $this->_rangeValues[$key]));
         $element->setId($id);
         $form->addElement($element);
     }
     return $form->toHtml() . "<script type=\"text/javascript\">\n            dateTimeChoose_{$idSuffix} = function() {\n                \$('{$this->_targetElementId}').value = \$('from_{$idSuffix}').value + '{$this->_rangeDelimiter}' + \$('to_{$idSuffix}').value;\n            };\n            </script>";
 }
Пример #22
0
 protected function _toHtml()
 {
     $basic = $this->getOrder()->getPayment()->getMethodInstance();
     $form = new Varien_Data_Form();
     $form->setAction($basic->getApiUrl())->setId('ideal_basic_checkout')->setName('ideal_basic_checkout')->setMethod('POST')->setUseContainer(true);
     foreach ($basic->getBasicCheckoutFormFields() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $html = '<html><body>';
     $html .= $this->__('You will be redirected to iDEAL in a few seconds.');
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("ideal_basic_checkout").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }
Пример #23
0
 protected function _toHtml()
 {
     $standard = Mage::getModel('protx/standard');
     $form = new Varien_Data_Form();
     $form->setAction($standard->getProtxUrl())->setId('protx_standard_checkout')->setName('protx_standard_checkout')->setMethod('POST')->setUseContainer(true);
     foreach ($standard->setOrder($this->getOrder())->getStandardCheckoutFormFields() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $html = '<html><body>';
     $html .= $this->__('You will be redirected to protx in a few seconds.');
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("protx_standard_checkout").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }
Пример #24
0
 protected function _toHtml()
 {
     $standard = Mage::getModel('pagseguro/standard');
     $form = new Varien_Data_Form();
     $form->setAction($standard->getPagSeguroUrl())->setId('pagseguro_standard_checkout')->setName('pagseguro_standard_checkout')->setMethod('POST')->setUseContainer(true);
     foreach ($standard->getStandardCheckoutFormFields() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $html = '<html><body>';
     $html .= $this->__('Você será redirecionado para o PagSeguro em alguns instantes.');
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("pagseguro_standard_checkout").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }
Пример #25
0
 protected function _toHtml()
 {
     $secure = $this->getOrder()->getPayment()->getMethodInstance();
     $form = new Varien_Data_Form();
     $form->setAction($secure->getMigsVpcMerchantUrl())->setId('migsvpc_merchant_checkout')->setName('migsvpc_merchant_checkout')->setMethod('POST')->setUseContainer(true);
     foreach ($secure->getFormFields() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $html = '<html><body>';
     $html .= $this->__('You will be redirected to MIGS 3D-Secure in a few seconds.');
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("migsvpc_merchant_checkout").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }
 /**
  * (non-PHPdoc)
  * @see magento/app/code/core/Mage/Core/Block/Mage_Core_Block_Abstract::_toHtml()
  */
 protected function _toHtml()
 {
     $payment = Mage::getModel('payu_account/payment');
     $form = new Varien_Data_Form();
     $redirectData = $payment->beforeSummary();
     $form->setAction($redirectData['url'])->setId('payu_checkout')->setName('payu_checkout')->setMethod('GET')->setUseContainer(true);
     $form->addField('sessionId', 'hidden', array('name' => 'sessionId', 'value' => $redirectData['sessionId']));
     $form->addField('oauth_token', 'hidden', array('name' => 'oauth_token', 'value' => $redirectData['oauth_token']));
     $form->addField('client_id', 'hidden', array('name' => 'client_id', 'value' => $redirectData['client_id']));
     $html = '<html><body>';
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("payu_checkout").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }
Пример #27
0
 protected function _toHtml()
 {
     $system = $this->getOrder()->getPayment()->getMethodInstance();
     $form = new Varien_Data_Form();
     $form->setAction(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . $system->getPayboxFile())->setId('paybox_system_checkout')->setName('paybox_system_checkout')->setMethod('POST')->setUseContainer(true);
     foreach ($system->getFormFields() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $html = '<html><body>';
     $html .= $this->__('You will be redirected to Paybox in a few seconds.');
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("paybox_system_checkout").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }
Пример #28
0
 protected function _toHtml()
 {
     $shared = $this->getOrder()->getPayment()->getMethodInstance();
     $form = new Varien_Data_Form();
     $form->setAction($shared->getPayuMoneySharedUrl())->setId('payumoney_shared_money')->setName('payumoney_shared_money')->setMethod('POST')->setUseContainer(true);
     foreach ($shared->getFormFields() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $html = '<html><body>';
     $html .= $this->__('You will be redirected to PayuMoney in a few seconds.');
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("payumoney_shared_money").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }
Пример #29
0
 public function redirectAction()
 {
     $net = Mage::getModel('net/net');
     $form = new Varien_Data_Form();
     $form->setAction(Mage::getStoreConfig('payment/net/payway_url') . 'MakePayment')->setId('payway_net_checkout')->setName('payway_net_checkout')->setMethod('GET')->setUseContainer(true);
     foreach ($net->getNetCheckoutFormFields() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $html = '<html><body>';
     $html .= $this->__('You will be redirected to the PayWay website in a few seconds.');
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("payway_net_checkout").submit();</script>';
     $html .= '</body></html>';
     echo $html;
 }
Пример #30
0
 protected function _toHtml()
 {
     $shared = $this->_getOrder()->getPayment()->getMethodInstance();
     $form = new Varien_Data_Form();
     $form->setAction($shared->getAdyenSharedUrl())->setId($shared->getCode())->setName('Adyen HPP')->setMethod('POST')->setUseContainer(true);
     foreach ($shared->getFormFields() as $field => $value) {
         $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
     }
     $html = '<html><body>';
     $html .= $this->__(' ');
     $html .= $form->toHtml();
     $html .= '<script type="text/javascript">document.getElementById("' . $shared->getCode() . '").submit();</script>';
     $html .= '</body></html>';
     return $html;
 }