Ejemplo n.º 1
0
 function requestMerchant()
 {
     $payment = new payment();
     $datenow = date("d/m/Y h:m:s");
     $modifiedDate = str_replace(" ", "%20", $datenow);
     $payment->url = $this->paymentConfig->Url;
     $postFields = "";
     $postFields .= "&login="******"&pass="******"&ttype=" . $_POST['TType'];
     $postFields .= "&prodid=" . $_POST['product'];
     $postFields .= "&amt=" . $_POST['amount'];
     $postFields .= "&txncurr=" . $this->paymentConfig->TxnCurr;
     $postFields .= "&txnscamt=" . $this->paymentConfig->TxnScAmt;
     $postFields .= "&clientcode=" . urlencode(base64_encode($_POST['clientcode']));
     $postFields .= "&txnid=" . rand(0, 999999);
     $postFields .= "&date=" . $modifiedDate;
     $postFields .= "&custacc=" . $_POST['AccountNo'];
     $postFields .= "&ru=" . $_POST['ru'];
     $postFields .= "&udf1=" . str_replace(" ", "%20", $_POST['udf1']);
     $postFields .= "&udf2=" . $_POST['udf2'];
     $postFields .= "&udf3=" . $_POST['udf3'];
     $postFields .= "&udf4=" . str_replace(" ", "%20", $_POST['udf4']);
     // Not required for merchant
     //$postFields .= "&bankid=".$_POST['bankid'];
     $sendUrl = $payment->url . "?" . substr($postFields, 1) . "\n";
     $this->writeLog($sendUrl);
     $returnData = $payment->sendInfo($postFields);
     $this->writeLog($returnData . "\n");
     $xmlObjArray = $this->xmltoarray($returnData);
     $url = $xmlObjArray['url'];
     $postFields = "";
     $postFields .= "&ttype=" . $_POST['TType'];
     $postFields .= "&tempTxnId=" . $xmlObjArray['tempTxnId'];
     $postFields .= "&token=" . $xmlObjArray['token'];
     $postFields .= "&txnStage=1";
     $url = $payment->url . "?" . $postFields;
     $this->writeLog($url . "\n");
     header("Location: " . $url);
 }