رفتن به مطلب

مشکل در راه اندازی درگاه پرداخت بانک ملت


پست های پیشنهاد شده

سلام.من داکیومنت درگاه بانک ملت رو در هاتس آپلود کردم حالا وقتی اطالاعات رو بهش میدم این پیغام رو میده


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

اینم کل فایل هست.ببینید مشکل از چیه لطفا

default.php

لینک به ارسال

WSDL جدید را بررسی کنید.

https://bpm.shaparak.ir/pgwchannel/services/pgw?wsdl

البته پیشنهاد میکنم از این کلاس برای اتصال به درگاه ملت استفاده کنید.

متدهای خوب و کاملی دارد.

  • امتیاز 3
لینک به ارسال
  • 4 ماه بعد...

سلام .

منم همین مشکل رو داشتم که با تغییر تابعی که آقا مصطفی دادن ، مشکلم حل شد .

آقا مصطفی ، لینکی که دادی ظاهرا حذف شده .

نمونه ای ندارید که فقط یه فایل اصلی ( فرم و متدهاش ) باشه و یه فایل وریفای ؟

این همه پیچیدگی داره کدهاش که باعث اذیت شدن و گمراهیم میشه !

ممنونم.

ویرایش شده توسط dodgy
  • امتیاز 1
لینک به ارسال

نمونه کلاس برای شاپرک که بدون مشکل کار میکنه ( سایت های خودم استفاده میکنم )


<?php
class Mellat
{
var $client;
var $namespace;
var $terminalId;
var $userName;
var $userPassword;
function __construct($client,$tId,$uN,$uP)
{
$this->client=$client;
$this->namespace='http://interfaces.core.sw.bps.com/';
$this->terminalId=$tId;
$this->userName=$uN;
$this->userPassword=$uP;
}
function Pay($Amount,$redirect)
{
$parameters = array(
'terminalId' => $this->terminalId,
'userName' => $this->userName,
'userPassword' => $this->userPassword,
'orderId' => time(),
'amount' => $Amount,
'localDate' => date("Ymd"),
'localTime' => date("His"),
'additionalData' => 'اطلاعات پرداخت',
'callBackUrl' => $redirect,
'payerId' => "0");
$result = $this->client->call('bpPayRequest', $parameters,$this->namespace);

if ($this->client->fault) return 'fault';
$resultStr = $result;
$err = $this->client->getError();
if ($err) return 'errorCurl';
$res = explode (',',$resultStr);
settype($res[0],"string");
settype($res[1],"string");
$ResCode = $res[0];
$Hashcode = $res[1];
if ($ResCode == '0') return $Hashcode;
else return 'errorBank';
}
function Verify($refId,$saleCode,$trnsID)
{
$parameters = array(
'terminalId' => $this->terminalId,
'userName' => $this->userName,
'userPassword' => $this->userPassword,
'orderId' => $saleCode,
'saleOrderId' => $saleCode,
'saleReferenceId' => $trnsID);

$result = $this->client->call('bpVerifyRequest', $parameters, $this->namespace);

if ($this->client->fault) return 'fault';
$resultStr = $result;
$err = $this->client->getError();
if ($err) return 'errorCurl';
if ($resultStr == '0') return 'Verified';
else return 'NotVerified';
}
function Settle($refId,$saleCode,$trnsID)
{
$parameters = array(
'terminalId' => $this->terminalId,
'userName' => $this->userName,
'userPassword' => $this->userPassword,
'orderId' => $saleCode,
'saleOrderId' => $saleCode,
'saleReferenceId' => $trnsID);

$result = $this->client->call('bpSettleRequest', $parameters, $this->namespace);

if ($this->client->fault) return 'fault';
$resultStr = $result;
$err = $this->client->getError();
if ($err) return 'errorCurl';
if ($resultStr == '0') return 'Setteled';
else return 'NotSetteled';
}
}
?>

و اتصال :


require_once('nusoap.php'); // file marbout be soap clinet
$client = new nusoap_client('https://bpm.shaparak.ir/pgwchannel/services/pgw?wsdl');
require_once ('class.mellat.php');
$pay = new Mellat($client,1324888,'codak','co55da'); // etelaate dargah rovared konid
va baghiye codhatoun ......

دیگه بقیه کدها مربوط به برنامتون میشه که چه شکلی باشه

  • امتیاز 5
لینک به ارسال

لطفا برای ارسال دیدگاه وارد شوید

شما بعد از اینکه وارد حساب کاربری خود شدید می توانید دیدگاهی ارسال کنید



ورود به حساب کاربری
×
×
  • اضافه کردن...