function add() { //debug($_SERVER['DOCUMENT_ROOT']); include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/BillToAddress.php"; include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/CardInfo.php"; include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/Merchant.php"; include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/MPIData.php"; include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/ShipToAddress.php"; include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/PGResponse.php"; include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/PostLibPHP.php"; include $_SERVER['DOCUMENT_ROOT'] . "/app/webroot/payment/Sfa/PGReserveData.php"; $oMPI = new MPIData(); $oCI = new CardInfo(); $oPostLibphp = new PostLibPHP(); $oMerchant = new Merchant(); $oBTA = new BillToAddress(); $oSTA = new ShipToAddress(); $oPGResp = new PGResponse(); $oPGReserveData = new PGReserveData(); $oMerchant->setMerchantDetails("96039227", "96039227", "96039227", "10.10.10.238", rand() . "", "Ord1234", $_SERVER['HTTP_HOST'] . "/app/webroot/payment/SFAResponse.php", "POST", "INR", "INV123", "req.Sale", "100", "", "Ext1", "true", "Ext3", "Ext4", "New PHP"); $oBTA->setAddressDetails("CID", "Tester", "Aline1", "Aline2", "Aline3", "Pune", "A.P", "48927489", "IND", "*****@*****.**"); $oSTA->setAddressDetails("Add1", "Add2", "Add3", "City", "State", "443543", "IND", "*****@*****.**"); #$oMPI->setMPIRequestDetails("1245","12.45","356","2","2 shirts","12","20011212","12","0","","image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"); //debug( $oPostLibphp); // debug( $oMerchant); // debug( $oMerchant); // debug( $oMerchant); $oPGResp = $oPostLibphp->postSSL($oBTA, $oSTA, $oMerchant, $oMPI, $oPGReserveData); if ($oPGResp->getRespCode() == '000') { $url = $oPGResp->getRedirectionUrl(); #$url =~ s/http/https/; #print "Location: ".$url."\n\n"; #header("Location: ".$url); redirect($url); } else { print "Error Occured.<br>"; print "Error Code:" . $oPGResp->getRespCode() . "<br>"; print "Error Message:" . $oPGResp->getRespMessage() . "<br>"; } }
include "Sfa/MPIData.php"; include "Sfa/ShipToAddress.php"; include "Sfa/PGResponse.php"; include "Sfa/PostLibPHP.php"; include "Sfa/PGReserveData.php"; $oMPI = new MPIData(); $oCI = new CardInfo(); $oPostLibphp = new PostLibPHP(); $oMerchant = new Merchant(); $oBTA = new BillToAddress(); $oSTA = new ShipToAddress(); $oPGResp = new PGResponse(); $oPGReserveData = new PGReserveData(); $oMerchant->setMerchantDetails("00012849", "00012849", "00012849", "193.545.34.33", rand() . "", "Ord123", $baseurl . "payment/SFAResponse.php", "POST", "INR", "INV123", "req.Sale", $applicationfees, "", "Ext1", "true", "Ext3", "Ext4", "Ext5"); $oBTA->setAddressDetails("CID", "Tester", "JBIMS", "Mumbai", "Maharashtra", "Test", "Test", "Test", "IND", "*****@*****.**"); $oSTA->setAddressDetails("Add1", "Add2", "Add3", "City", "State", "443543", "IND", "*****@*****.**"); $INRapplicationfees = "INR" . $applicationfees; $applicationfeespaisa = $applicationfees * 100; $oMPI->setMPIRequestDetails($applicationfeespaisa, $INRapplicationfees, "356", "2", "JBIMS Admission", "", "", "", "0", "", "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*", "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"); $oPGReserveData->setReserveObj($applicationid, $applicantName, $applicantemailid, $applicationfees, "5", "6", "7", "8", "9", "10"); $oPGResp = $oPostLibphp->postSSL($oBTA, $oSTA, $oMerchant, $oMPI, $oPGReserveData); if ($oPGResp->getRespCode() == '000') { $url = $oPGResp->getRedirectionUrl(); //$url =~ s/http/https/; //print "Location: ".$url."\n\n"; //header("Location: ".$url); redirect($url); } else { print "Error Occured.<br>"; print "Error Code:" . $oPGResp->getRespCode() . "<br>"; print "Error Message:" . $oPGResp->getRespMessage() . "<br>";
//ini_set('display_errors', '1'); include "Sfa/BillToAddress.php"; include "Sfa/CardInfo.php"; include "Sfa/Merchant.php"; include "Sfa/MPIData.php"; include "Sfa/ShipToAddress.php"; include "Sfa/PGResponse.php"; include "Sfa/PostLibPHP.php"; include "Sfa/PGReserveData.php"; $oMPI = new MPIData(); $oCI = new CardInfo(); $oPostLibphp = new PostLibPHP(); $oMerchant = new Merchant(); $oBTA = new BillToAddress(); $oSTA = new ShipToAddress(); $oPGResp = new PGResponse(); $oPGReserveData = new PGReserveData(); $oMerchant->setMerchantDetails("00002116", "00002116", "00002116", "10.10.10.238", rand() . "", "OrderRef1", "", "", "INR", "INV1234", "req.Sale", "100", "", "Ext1", "Ext2", "Ext3", "Ext4", "Ext5"); $oSTA->setAddressDetails("Add1", "Add2", "Add3", "City", "State", "443543", "IND", "*****@*****.**"); $oBTA->setAddressDetails("CID", "Tester", "Aline1", "Aline2", "Aline3", "Pune", "MH", "48927489", "IND", "*****@*****.**"); $oCI->setCardDetails("MC", "5081264401288025", "234", "2028", "12", "Tester", "CREDI"); $oMPI->setMPIResponseDetails("02", "NTBlZjRjMThjMjc1NTUxYzk1MTY=", "Y", "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "84759435", "1000", "356"); $oPGResp = $oPostLibphp->postMOTO($oBTA, $oSTA, $oMerchant, $oMPI, $oCI, $oPGReserveData); $oPGResp->getResponse($oResp); print "Response Code:" . $oPGResp->getRespCode() . "<br>"; print "Response Message:" . $oPGResp->getRespMessage() . "<br>"; print "Transaction ID:" . $oPGResp->getTxnId() . "<br>"; print "Epg Transaction ID:" . $oPGResp->getEpgTxnId() . "<br>"; print "Auth Id Code :" . $oPGResp->getAuthIdCode() . "<br>"; print "RRN :" . $oPGResp->getRRN() . "<br>"; print "CVResp Code :" . $oPGResp->getCVRespCode() . "<br>";
public function redirectAction() { $session = Mage::getSingleton('checkout/session'); $redirected = $session->getData("redirected"); if ($redirected == "true") { $session->setData("redirected", "false"); $cartURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . "checkout/cart/"; echo "<script language='javascript' type='text/javascript'>setTimeout('window.self.location=\\'" . $cartURL . "\\''); </script>"; exit; } $session->setpaysealStandardQuoteId($session->getQuoteId()); $config = Mage::getSingleton('payseal/config'); $order = $this->getOrder(); if (!$order->getId()) { $this->norouteAction(); return; } $shippingAdd = $order->getShippingAddress()->getData(); $billingAdd = $order->getBillingAddress()->getData(); include "Sfa/BillToAddress.php"; include "Sfa/CardInfo.php"; include "Sfa/Merchant.php"; include "Sfa/MPIData.php"; include "Sfa/ShipToAddress.php"; include "Sfa/PGResponse.php"; include "Sfa/PostLibPHP.php"; include "Sfa/PGReserveData.php"; $oMPI = new MPIData(); $oCI = new CardInfo(); $oPostLibphp = new PostLibPHP(); $oMerchant = new Merchant(); $oBTA = new BillToAddress(); $oSTA = new ShipToAddress(); $oPGResp = new PGResponse(); $oPGReserveData = new PGReserveData(); $merchantId = $config->getMerchantId(); $responseURL = $config->getResponseURL(); $transactionNo = "Transact" . rand(); $oMerchant->setMerchantDetails($merchantId, $merchantId, $merchantId, "", $transactionNo, $order->getId(), $responseURL, "POST", "INR", "", "req.Sale", round($order->getData('grand_total'), 2), "", "", "true", "", "", ""); $oBTA->setAddressDetails($billingAdd['customer_id'], $billingAdd['firstname'] . ' ' . $billingAdd['lastname'], $billingAdd['street'], "", "", $billingAdd['city'], $billingAdd['region'], $billingAdd['postcode'], "IND", $billingAdd['email']); $oSTA->setAddressDetails($shippingAdd['firstname'], $shippingAdd['lastname'], $shippingAdd['street'], $shippingAdd['city'], $shippingAdd['region'], $shippingAdd['postcode'], "IND", $shippingAdd['email']); $oPGResp = $oPostLibphp->postSSL($oBTA, $oSTA, $oMerchant, $oMPI, $oPGReserveData); if ($oPGResp->getRespCode() == "000") { $debug = Mage::getModel('payseal/api_debug'); $debug->setData("transact_id", $transactionNo); $debug->setRequestBody(print_r($oMerchant, 1)); $debug->save(); $url = $oPGResp->getRedirectionUrl(); $order->addStatusToHistory($order->getStatus(), Mage::helper('payseal')->__('Customer was redirected to payseal')); $order->save(); //$this->redirect($url); $session->setData("redirected", "true"); echo "<html><head>\r\n\t\t\t <title>Processing..</title></head><body><center><div><font size='5' color='#3b4455'>You are redirecting to patment gateway,<br/>Please wait ...<br/>\r\n <font size='3'>(Please do not press 'Refresh' or 'Back' button)</font></font></div>\r\n\t\t\t\t <img src='" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . "frontend/enterprise/lecom/images/spinner.gif' />\r\n\t\t\t\t </center>\r\n\t\t\t\t </body></html>\r\n <script language='javascript' type='text/javascript'>setTimeout('window.self.location=\\'" . $url . "\\'', 3000); </script>"; } else { // Mage::logException($oPGResp->getRespMessage()); Mage::getSingleton('core/session')->addError("Error Message:" . $oPGResp->getRespMessage() . " Please choose another payment method"); $this->_redirect('onestepcheckout/?cart=true', array('_secure' => true)); } }