public function redirectAction()
    {
        $session = Mage::getSingleton('checkout/session');
        $session->setcitrusStandardQuoteId($session->getQuoteId());
        $config = Mage::getSingleton('citrus/config');
        $order = $this->getOrder();
        if (!$order->getId()) {
            $this->norouteAction();
            return;
        }
        $billingAdd = $order->getBillingAddress()->getData();
        require_once 'citrus/lib/CitrusPay.php';
        require_once 'Zend/Crypt/Hmac.php';
        $secretKey = trim($config->getSecretKey());
        $transactionNo = rand();
        $vanity = $config->getVanityUrl();
        $orderAmount = round($order->getData('grand_total'), 2);
        CitrusPay::setApiKey($secretKey, 'production');
        $vanityUrl = $vanity;
        $currency = "INR";
        $data = "{$vanityUrl}{$orderAmount}{$transactionNo}{$currency}";
        $secSignature = $this->generateHmacKey($data, CitrusPay::getApiKey());
        $action = CitrusPay::getCPBase() . "{$vanityUrl}";
        $time = time() * 1000;
        $time = number_format($time, 0, '.', '');
        $responseURL = $config->getResponseURL();
        $debug = Mage::getModel('citrus/api_debug');
        $debug->setData("transact_id", $transactionNo);
        $debug->setRequestBody(print_r($oMerchant, 1));
        $debug->save();
        $order->addStatusToHistory($order->getStatus(), Mage::helper('citrus')->__('Customer was redirected to citrus'));
        $order->save();
        //$this->redirect($url);
        ?>
			      <form action="<?php 
        echo $action;
        ?>
" method="POST" name="TransactionForm" id="transactionForm">
					<input name="merchantTxnId" type="hidden" value="<?php 
        echo $transactionNo;
        ?>
" />
					<input name="addressState" type="hidden" value="<?php 
        echo $billingAdd['region'];
        ?>
" />
					<input name="addressCity" type="hidden" value="<?php 
        echo $billingAdd['city'];
        ?>
" />
					<input name="addressStreet1" type="hidden" value="<?php 
        echo $billingAdd['street'];
        ?>
" />
					<input name="addressCountry" type="hidden" value="India" />
					<input name="addressZip" type="hidden" value="<?php 
        echo $billingAdd['postcode'];
        ?>
" />
					<input name="firstName" type="hidden" value="<?php 
        echo $billingAdd['firstname'];
        ?>
" />
					<input name="lastName" type="hidden" value="<?php 
        echo $billingAdd['lastname'];
        ?>
" />
					<input name="email" type="hidden" value="<?php 
        echo $billingAdd['email'];
        ?>
" />
					<input name="paymentMode" type="hidden" value="NET_BANKING" />
					<input name="returnUrl" type="hidden" value="<?php 
        echo $responseURL;
        ?>
" />
					<input name="orderAmount" type="hidden" value="<?php 
        echo $orderAmount;
        ?>
" />
					<input type="hidden" name="reqtime" value="<?php 
        echo $time;
        ?>
" />
					<input type="hidden" name="secSignature" value="<?php 
        echo $secSignature;
        ?>
" /> 
					<input type="hidden" name="currency" value="<?php 
        echo $currency;
        ?>
" />
					<input name="phoneNumber" type="hidden" value="<?php 
        echo $billingAdd['telephone'];
        ?>
" />
					<input name="issuerCode" type="hidden" value="" />
					<input name="cardHolderName" type="hidden" value="" />
					<input name="cardNumber" type="hidden" value="" />
					<input name="expiryMonth" type="hidden" value="" />
					<input name="cardType" type="hidden" value="" />
					<input name="cvvNumber" type="hidden" value="" />
					<input name="expiryYear" type="hidden" value="" />
                 </form>
                   <script language='javascript' type='text/javascript'>
				   document.getElementById("transactionForm").submit();
				   </script>";
	<?php 
    }
Ejemplo n.º 2
0
 public static function setVerifySslCerts($verify)
 {
     self::$verifySslCerts = $verify;
 }