PDA

View Full Version : سوال: مشکل در نحوه استعلام وجه از درگاه بانک ملت



hamid_computer3
دوشنبه 12 آبان 1393, 11:05 صبح
من میخوام ی قسمت تو پروژم انجام بدم که کاربر بتونه با وارد کردن شنایه پرداخت و شماره درخواستی که پس از پرداخت وجه با درگاه بانک ملت داره چک کنه ببینه آیا وجه واریز شده به حساب یانه

تو سمپل بانک ملت نوشته


http://www.8pic.ir/images/jcn20wgqnr00mcnaf6u3.jpg

خوب من چطوری باید این کار رو انجم بدم میشه کد کاملش رو برام بدین

hamidhassas
دوشنبه 12 آبان 1393, 14:04 عصر
کدت باید اینجوری باشه



<html>
<head>
<title>BP PGW Test</title>
<link href="Css/Style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function postRefId (refIdValue)
{
var form = document.createElement("form");
form.setAttribute("method", "POST");
form.setAttribute("action", "https://bpm.shaparak.ir/pgwchannel/startpay.mellat");
form.setAttribute("target", "_self");
var hiddenField = document.createElement("input");
hiddenField.setAttribute("name", "RefId");
hiddenField.setAttribute("value", refIdValue);
form.appendChild(hiddenField);
document.body.appendChild(form);
form.submit();
document.body.removeChild(form);
}
</script>
</head>
<body>
<form name="form1" method="post" preservedata="true">
<table class="MainTable" cellspacing="5" cellpadding="1" align="center">
<tr class="HeaderTr">
<td colspan="2" align="center" height="25">
<span class="HeaderText">Inquiry Request Method Call</span>
</td>
</tr>
<tr>
<td class="LabelTd">
<span>OrderId</span>
</td>
<td>
<input type="text" name="InquiryOrderId" value="<?php echo $_POST['InquiryOrderId'] ?>">
</td>
</tr>
<tr>
<td class="LabelTd">
<span>SaleOrderId</span>
</td>
<td>
<input type="text" name="InquirySaleOrderId" value="<?php echo $_POST['InquirySaleOrderId'] ?>">
</td>
</tr>
<tr>
<td class="LabelTd">
<span>SaleReferenceId</span>
</td>
<td>
<input type="text" name="InquirySaleReferenceId" value="<?php echo $_POST['InquirySaleReferenceId'] ?>">
</td>
</tr>
<tr class="HeaderTr">
<td colspan="2" align="center">
<input type="submit" CssClass="PublicButton" name="InquiryRequestButton" value="Inquiry"/>
</td>
</tr>
</table>
</form>
</body>
<?php
require_once("lib/nusoap.php");
//curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
//$page = curl_exec ($ch);
$client = new soapclient('https://bpm.shaparak.ir/pgwchannel/services/pgw?wsdl');
$namespace='http://interfaces.core.sw.bps.com/';
///////////////// INQUIRY REQUEST
if (isset($_POST['InquiryRequestButton']))
{
$terminalId = '';
$userName = '';
$userPassword = '';
$orderId = $_POST['InquiryOrderId'];
$inquirySaleOrderId = $_POST['InquirySaleOrderId'];
$inquirySaleReferenceId = $_POST['InquirySaleReferenceId'];
$callBackUrl="http://www.youradress.com/callback.php";
// Check for an error
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
die();
}

$parameters = array(
'terminalId' => $terminalId,
'userName' => $userName,
'userPassword' => $userPassword,
'orderId' => $orderId,
'saleOrderId' => $inquirySaleOrderId,
'saleReferenceId' => $inquirySaleReferenceId,
);
// Call the SOAP method
$result = $client->call('bpInquiryRequest', $parameters, $namespace);
// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
die();
}
else {
$resultStr = $result;

$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
die();
}
else {
// Update Table, Save Inquiry Status
// Note: Successful Inquiry means complete successful sale was done.
echo "<script>alert('Inquiry Response is : " . $resultStr . "');</script>";
echo "Inquiry Response is : " . $resultStr;
}// end Display the result
}// end Check for errors
}
?>
</html>

hamid_computer3
دوشنبه 12 آبان 1393, 14:10 عصر
کدتون قرار دام ولی خطای زیر رو میده


Fatal error: Uncaught SoapFault exception: [Client] Function ("getError") is not a valid method for this service in /home3/hsco/public_html/bank/default.php:81 Stack trace: #0 /home3/hsco/public_html/bank/1/default.php(81): SoapClient->__call('getError', Array) #1 /home3/hsco/public_html/bank/default.php(81): SoapClient->getError() #2 {main} thrown in /home3/hsco/public_html/bank/default.php on line 81



مربوط به خط زیر هست


$err = $client->getError();