本文整理汇总了PHP中payment::sendInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP payment::sendInfo方法的具体用法?PHP payment::sendInfo怎么用?PHP payment::sendInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类payment
的用法示例。
在下文中一共展示了payment::sendInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: requestMerchant
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=" . $this->paymentConfig->Login;
$postFields .= "&pass=" . $this->paymentConfig->Password;
$postFields .= "&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);
}