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>";
     }
 }
<?php

include "Sfa/Merchant.php";
include "Sfa/PGResponse.php";
include "Sfa/PostLibPHP.php";
$oPostLibphp = new PostLibPHP();
$oMerchant = new Merchant();
$oPGResp = new PGResponse();
$oMerchant->setMerchantRelatedTxnDetails("00002116", "00002116", "00002116", "21345", "201208091494345", "000000130470", "130470", "", "", "INR", "req.Refund", "10", "", "Ext1", "Ext2", "Ext3", "Ext4", "Ext5");
$oPgResp = $oPostLibphp->postRelatedTxn($oMerchant);
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>";
Ejemplo n.º 3
0
include "Sfa/PaySecureDetails.php";
$sendA = $_POST['sendAuth'];
$pgRespCode = null;
$txnid = null;
$guid = null;
$exp1 = null;
$errMsg = null;
$errCode = null;
$mod1 = null;
$mid1 = null;
$amt = null;
$curr = null;
$npciResp = null;
$epgRefNum = null;
$crdNum = "6076000000000022";
$oPostLibPHP = new PostLibPHP();
$oPSD = new PaySecureDetails();
$oMerchant = new Merchant();
$oPgResponse = new PGResponse();
$oCI = new CardInfo();
$oReserveData = new PGReserveData();
$oMerchant->setMerchantDetails("00001203", "00001203", "00001203", "10.10.10.167", rand() . "", "", "", "", "INR", "INV123", "req.Sale", "10", "", "Ext1", "Ext2", "Ext3", "Ext4", "Ext5");
$oCI->setCardDetails("RUPAY", $crdNum, "234", "2018", "12", "Tester", "DEBIT");
if ($sendA == "N") {
    print ".....Inside TestAuth1.php....." . "<br>";
    $mod1 = $_POST['Modulus'];
    $txnid = $_POST['TxnID'];
    $guid = $_POST['GUID'];
    $exp1 = $_POST['Exponent'];
    $errMsg = $_POST['ErrMsg'];
    $errCode = $_POST['ErrCode'];
Ejemplo n.º 4
0
<?php

include "Sfa/Merchant.php";
include "Sfa/PGResponse.php";
include "Sfa/PGSearchResponse.php";
include "Sfa/PostLibPHP.php";
$oPostLibphp = new PostLibPHP();
$oMerchant = new Merchant();
$oPGResp = new PGResponse();
$oPGSearchResp = new PGSearchResponse();
$oMerchant->setMerchantTxnSearch("00002116", "20120808", "20120809");
#$oMerchant =null;
$oPGSearchResp = $oPostLibphp->postTxnSearch($oMerchant);
$arrayPGRespObj = $oPGSearchResp->getPGResponseObjects();
#print "Response Code:".$oPGSearchResp->getRespCode()."<br>";
#print "Response Message".$oPGSearchResp->getRespMessage()."<br>";
if ($arrayPGRespObj != null) {
    foreach ($arrayPGRespObj as $oPgResp) {
        print "<br>";
        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 " Txn Type: " . $oPgResp->getTxnType() . "<br>";
        print " Txn Date Time: " . $oPgResp->getTxnDateTime() . "<br>";
        print " CV Resp Code: " . $oPgResp->getCVRespCode() . "<br>";
        print "<br>";
    }
}
Ejemplo n.º 5
0
    $applicationfees = $applicationfees * $programselectedcount;
    $applicationfees = round($applicationfees, 2);
} else {
    redirect($baseurl);
}
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("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();
 function PostLibPHP()
 {
     PostLibPHP::readPropFile();
 }
<?php

include "Sfa/Merchant.php";
include "Sfa/PGResponse.php";
include "Sfa/PGSearchResponse.php";
include "Sfa/PostLibPHP.php";
$oPostLibphp = new PostLibPHP();
$oMerchant = new Merchant();
$oPGResp = new PGResponse();
$oPGSearchResp = new PGSearchResponse();
$oMerchant->setMerchantOnlineInquiry("00002116", "21345");
$oPGSearchResp = $oPostLibphp->postStatusInq($oMerchant);
$arrayPGRespObj = $oPGSearchResp->getPGResponseObjects();
if ($arrayPGRespObj != null) {
    foreach ($arrayPGRespObj as $oPgResp) {
        print "<br>";
        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 " Txn Type: " . $oPgResp->getTxnType() . "<br>";
        print " Txn Date Time: " . $oPgResp->getTxnDateTime() . "<br>";
        print " CvResp Code: " . $oPgResp->getCVRespCode() . "<br>";
        print "<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));
     }
 }