Mohammad Aref 120367 اشتراک گذاری ارسال شده در 29 آذر، ۱۳۹۲ شاید بعضی از دوستان برای استفاده از پلاگین پرداخت آنلاین بانک ملت وی بولتین دچار مشکل شده باشن و موقع اتصال به بانک با ارور زیر مواجه میشن: Loading... ERROR!!REFRESH PAGE! برای حل این مشکل باید دو فایل رو ویرایش کنید و حرف f که قرمز شده رو حذف کنید و pgwsf رو به pgws تغییر بدین. فایل mellat.php که تو پوشه mellat هستش: <script language="javascript" type="text/javascript"> function postRefId(refIdValue) { var form = document.createElement("form"); form.setAttribute("method", "POST"); form.setAttribute("action", "https://pgw.bpm.bankmellat.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> <div style="display:none;"> <form name="form1" method="post" preservedata="true"> </form> </div> <?php date_default_timezone_set('Asia/Tehran'); @[url="http://www.noandishaan.com/forums/member.php?u=84750"]ses[/url]sion_start(); require_once ("lib/nusoap.php"); $client = new nusoap_client('https://pgws[color=#ff0000]f[/color].bpm.bankmellat.ir/pgwchannel/services/pgw?wsdl'); $namespace = 'http://interfaces.core.sw.bps.com/'; if (isset($_SESSION['mellat_terminal_id_vb']) && isset($_SESSION['mellat_user_vb']) && isset($_SESSION['mellat_pass_vb']) && isset($_POST['mellat_tozih']) && isset($_POST['mellat_back_url'])) { echo 'Loading...'; $terminalId = $_SESSION['mellat_terminal_id_vb']; $userName = $_SESSION['mellat_user_vb']; $userPassword = $_SESSION['mellat_pass_vb']; $orderId = rand(); $amount = $_SESSION['mellat_price_vb'] * 10000; $localDate = date("Ymd"); $localTime = date("His"); $additionalData = $_POST['mellat_tozih']; $callBackUrl = $_POST['mellat_back_url']; $payerId = 0; // Check for an error $err = $client -> getError(); if ($err) { echo '<br/>ERROR!!REFRESH PAGE!'; die(); } $parameters = array('terminalId' => $terminalId, 'userName' => $userName, 'userPassword' => $userPassword, 'orderId' => $orderId, 'amount' => $amount, 'localDate' => $localDate, 'localTime' => $localTime, 'additionalData' => $additionalData, 'callBackUrl' => $callBackUrl, 'payerId' => $payerId); // Call the SOAP method $result = $client -> call('bpPayRequest', $parameters, $namespace); // Check for a fault if ($client -> fault) { echo '<br/>ERROR!!REFRESH PAGE!'; die(); } else { // Check for errors $resultStr = $result; $err = $client -> getError(); if ($err) { // Display the error echo '<br/>ERROR!!REFRESH PAGE!'; die(); } else { // Display the result $res = explode(',', $resultStr); $ResCode = $res[0]; if ($ResCode == "0") { $file = 'mellat.txt'; $data = 'Order Id:' . $orderId . "\n" . 'Refrence Id:' . $res[1] . "\n" . 'Amount:' . $amount . "\n" . 'Date:' . $localDate . "\n" . 'Time:' . $localTime . "\n" . 'Additional Data:' . $additionalData . "\n" . '-----------------------------------------------------' . "\n"; if (!file_exists('mellat.log')) { $handle = fopen($file, 'a') or die('Cannot open file: ' . $file); fwrite($handle, $data); } else { $file = fopen($file, "a"); fwrite($file, $data); fclose($file); } echo "<script language='javascript' type='text/javascript'>postRefId('" . $res[1] . "');</script>"; } else { echo '<br/>ERROR!!REFRESH PAGE!'; } }// end Display the result }// end Check for errors } else { echo 'invalid!'; } ?> و فایل class_mellat.php که تو مسیر includes > paymentapi هستش: <?php #Mohammad Hossein Abedinpour(Hamyar.org,Mhabedinpour.com) if (!isset($GLOBALS['vbulletin'] -> db)) { exit ; } /** * Class that provides payment verification and form generation functions * * @package vBulletin * @version $Revision: 20000 $ * @[url="http://www.noandishaan.com/forums/member.php?u=150601"]date[/url] $Date: 2012-03-25 01:24:45 +0350 (Sun, 25 March 2012) $ */ class vB_PaidSubscriptionMethod_mellat extends vB_PaidSubscriptionMethod { var $supports_recurring = false; var $display_feedback = true; function verify_payment() { require_once (DIR . '/mellat/lib/nusoap.php'); if (isset($_POST['ResCode'])) { if ($_POST['ResCode'] == 0) { $RefId = $_POST['RefId']; $ResCode = $_POST['ResCode']; $SaleOrderId = $_POST['SaleOrderId']; $SaleReferenceId = $_POST['SaleReferenceId']; echo '<script>var person=prompt("کد زیر را به خاطر داشته باشید.","'.$RefId.'");</script>'; //curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //$page = curl_exec ($ch); $client = new nusoap_client('https://pgws[color=#ff0000]f[/color].bpm.bankmellat.ir/pgwchannel/services/pgw?wsdl'); $namespace = 'http://interfaces.core.sw.bps.com/'; ///////////////// VERIFY REQUEST @[url="http://www.noandishaan.com/forums/member.php?u=84750"]ses[/url]sion_start(); $terminalId = $_SESSION['mellat_terminal_id_vb']; $userName = $_SESSION['mellat_user_vb']; $userPassword = $_SESSION['mellat_pass_vb']; $orderId = $SaleOrderId; $verifySaleOrderId = $SaleOrderId; $verifySaleReferenceId = $SaleReferenceId; // Check for an error $err = $client -> getError(); if ($err) { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } $parameters = array('terminalId' => $terminalId, 'userName' => $userName, 'userPassword' => $userPassword, 'orderId' => $orderId, 'saleOrderId' => $verifySaleOrderId, 'saleReferenceId' => $verifySaleReferenceId); // Call the SOAP method $result = $client -> call('bpVerifyRequest', $parameters, $namespace); // Check for a fault if ($client -> fault) { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } else { $resultStr = $result; $err = $client -> getError(); if ($err) { ///////////////// INQUIRY REQUEST // $terminalId = $_POST['TerminalId']; // $userName = $_POST['UserName']; // $userPassword = $_POST['UserPassword']; // $orderId = $_POST['InquiryOrderId']; $inquirySaleOrderId = $SaleOrderId; $inquirySaleReferenceId = $SaleReferenceId; // Check for an error $err = $client -> getError(); if ($err) { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } $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) { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } else { $resultStr = $result; $err = $client -> getError(); if ($err) { ///////////////// REVERSAL REQUEST // $terminalId = $_POST['TerminalId']; // $userName = $_POST['UserName']; // $userPassword = $_POST['UserPassword']; // $orderId = $_POST['ReversalOrderId']; $reversalSaleOrderId = $SaleOrderId; $reversalSaleReferenceId = $SaleReferenceId; // Check for an error $err = $client -> getError(); if ($err) { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } $parameters = array('terminalId' => $terminalId, 'userName' => $userName, 'userPassword' => $userPassword, 'orderId' => $orderId, 'saleOrderId' => $reversalSaleOrderId, 'saleReferenceId' => $reversalSaleReferenceId); // Call the SOAP method $result = $client -> call('bpReversalRequest', $parameters, $namespace); // Check for a fault if ($client -> fault) { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } else { $resultStr = $result; $err = $client -> getError(); if ($err) { // Display the error $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } else { // Update Table, Save Reversal Status // Note: Successful Reversal means that sale is reversed. }// end Display the result }// end Check for errors // Display the error $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } else { // Update Table, Save Inquiry Status // Note: Successful Inquiry means complete successful sale was done. ///////////////// SETTLE REQUEST $settleSaleOrderId = $SaleOrderId; $settleSaleReferenceId = $SaleReferenceId; // Check for an error $err = $client -> getError(); if ($err) { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } $parameters = array('terminalId' => $terminalId, 'userName' => $userName, 'userPassword' => $userPassword, 'orderId' => $orderId, 'saleOrderId' => $settleSaleOrderId, 'saleReferenceId' => $settleSaleReferenceId); // Call the SOAP method $result = $client -> call('bpSettleRequest', $parameters, $namespace); // Check for a fault if ($client -> fault) { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } else { $resultStr = $result; $err = $client -> getError(); if ($err) { // Display the error $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } else { // Update Table, Save Settle Status // Note: Successful Settle means that sale is settled. //echo "Settle Response is : " . $resultStr; }// end Display the result }// end Check for errors }// end Display the result }// end Check for errors // Display the error $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } else { // Display the result // Update Table, Save Verify Status // Note: Successful Verify means complete successful sale was done. //echo "Verify Response is : " . $resultStr; ///////////////// SETTLE REQUEST // $terminalId = $_POST['TerminalId']; // $userName = $_POST['UserName']; // $userPassword = $_POST['UserPassword']; // $orderId = $_POST['SettleOrderId']; $settleSaleOrderId = $SaleOrderId; $settleSaleReferenceId = $SaleReferenceId; // Check for an error $err = $client -> getError(); if ($err) { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } $parameters = array('terminalId' => $terminalId, 'userName' => $userName, 'userPassword' => $userPassword, 'orderId' => $orderId, 'saleOrderId' => $settleSaleOrderId, 'saleReferenceId' => $settleSaleReferenceId); // Call the SOAP method $result = $client -> call('bpSettleRequest', $parameters, $namespace); // Check for a fault if ($client -> fault) { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } else { $resultStr = $result; $err = $client -> getError(); if ($err) { // Display the error $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } else { // Update Table, Save Settle Status // Note: Successful Settle means that sale is settled. $this -> registry -> input -> clean_array_gpc('r', array('item' => TYPE_STR)); $this -> transaction_id = $this -> registry -> GPC['item']; if (!empty($this -> registry -> GPC['item'])) { $this -> paymentinfo = $this -> registry -> db -> query_first(" SELECT paymentinfo.*, user.username FROM " . TABLE_PREFIX . "paymentinfo AS paymentinfo INNER JOIN " . TABLE_PREFIX . "user AS user USING (userid) WHERE hash = '" . $this -> registry -> db -> escape_string($this -> registry -> GPC['item']) . "' "); if (!empty($this -> paymentinfo)) { $sub = $this -> registry -> db -> query_first("SELECT * FROM " . TABLE_PREFIX . "subscription WHERE subscriptionid = " . $this -> paymentinfo['subscriptionid']); $cost = unserialize($sub['cost']); $amount = floor($cost[0][cost][usd]); $this -> paymentinfo['currency'] = 'usd'; $this -> paymentinfo['amount'] = $cost[0][cost][usd]; $this -> type = 1; return true; } else { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } } else { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } }// end Display the result }// end Check for errors }// end Display the result }// end Check for errors } else { $this -> error = 'پرداخت نشد! اگر وجهی از حساب شما کم شده است به حسابتان باز می گردد! نگران نباشید!'; return false; } } else { $this -> error = 'خطا در چک کردن متغیر های کنترلی'; return false; } } function test() { @[url="http://www.noandishaan.com/forums/member.php?u=84750"]ses[/url]sion_start(); if (isset($_SESSION['mellat_terminal_id_vb']) && isset($_SESSION['mellat_user_vb']) && isset($_SESSION['mellat_pass_vb']) ) { return true; } else { return false; } } function generate_form_html($hash, $cost, $currency, $subinfo, $userinfo, $timeinfo) { $item = $hash; global $vbphrase, $vbulletin, $show; @[url="http://www.noandishaan.com/forums/member.php?u=84750"]ses[/url]sion_start(); $cost = floor($cost); $_SESSION['mellat_price_vb'] = $cost; $form['action'] = 'mellat/mellat.php'; $form['method'] = 'POST'; $settings = &$this -> settings; $templater = vB_Template::create('mellat_payment'); $templater -> register('item', $item); $templater -> register('userinfo', $userinfo); $form['hiddenfields'] .= $templater -> render(); return $form; } } ?> 3 نقل قول لینک به دیدگاه
ارسال های توصیه شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .