mehdi4467
دوشنبه 14 شهریور 1390, 18:10 عصر
سلام
برای پرداخت بانک پارسیان کلاس زیر نوشته شده است:
فایل paymentgate.php
<?php
class PaymentGate
{
public $Authority = 0;
public static function gotoParsian($amount, $orderID)
{
$wsdl = "https://www.pec24.com/pecpaymentgateway/eshopservice.asmx?wsdl";
$soap = new soapclient($wsdl,"wsdl");
$proxy = $soap->getProxy();
$callbackUrl = "http://eshop.sadagahi.com/index.php?orderID=$orderID" ;
$parameters = array('pin'=>'T5rR32211764a1nUw5r4','amount'=>$amount,'orderId'=>$orderID,'callbackUrl'=>$callbackUrl ,'authority'=>0,'status'=>0);
$result = $proxy->PinPaymentRequest($parameters);
return $result;
}
public static function check_Payment_Parsian ($auth)
{
$wsdl = "https://www.pec24.com/pecpaymentgateway/eshopservice.asmx?wsdl";
$soap = new soapclient($wsdl,"wsdl");
$proxy = $soap->getProxy();
$parameters = array('pin'=>'V5rRh31117P4F1nkwkr3','authority'=>$auth,'status'=>0);
$result = $proxy->PinPaymentEnquiry($parameters);
return $result;
}
public static function GetPaymentUniqID($registerID)
{
$sql = 'CALL payment_uniq_GetUniqID(:registerID)';
$params = array (':registerID' => $registerID);
return DatabaseHandler::GetOne($sql, $params);
}
}
?>
حال در یک صفحه یک فیلد برای قیمت قرار داده شده است به شکل زیر:
if(isset($_POST['send']))
{
$price = $_POST['amount'];
$dte = time();
$user_id = -1;
$paymentid = 4;
$sid = 0;
if($db->sql_query("INSERT INTO dynamic_ads_onlinepays VALUES (NULL, '$paymentid', '$price', '-1', '-1', '-1', '$dte', '$sid')"))
{
$max_query = $db->sql_query("SELECT MAX(PayID) FROM dynamic_ads_onlinepays");
$max_a=mysql_fetch_row($max_query);
$orderID=$max_a[0];
$result = PaymentGate::gotoParsian($price, $orderID);
if ($result['status'] == 0)
{
$GLOBALS['msg'] = "<font color=green>پرداخت درست است</font>";
}
else
{
$msg = "<font color=red>مشکلی در پرداخت وجود دارد</font>";
}
}
else
{
$msg = "<font color=red>مشکل با دیتابیس</font>";
}
}
حال مشکلی که وجود دارد این است:
Call to a member function PinPaymentRequest() on a non-object in paymentgate.php on line 30
برای پرداخت بانک پارسیان کلاس زیر نوشته شده است:
فایل paymentgate.php
<?php
class PaymentGate
{
public $Authority = 0;
public static function gotoParsian($amount, $orderID)
{
$wsdl = "https://www.pec24.com/pecpaymentgateway/eshopservice.asmx?wsdl";
$soap = new soapclient($wsdl,"wsdl");
$proxy = $soap->getProxy();
$callbackUrl = "http://eshop.sadagahi.com/index.php?orderID=$orderID" ;
$parameters = array('pin'=>'T5rR32211764a1nUw5r4','amount'=>$amount,'orderId'=>$orderID,'callbackUrl'=>$callbackUrl ,'authority'=>0,'status'=>0);
$result = $proxy->PinPaymentRequest($parameters);
return $result;
}
public static function check_Payment_Parsian ($auth)
{
$wsdl = "https://www.pec24.com/pecpaymentgateway/eshopservice.asmx?wsdl";
$soap = new soapclient($wsdl,"wsdl");
$proxy = $soap->getProxy();
$parameters = array('pin'=>'V5rRh31117P4F1nkwkr3','authority'=>$auth,'status'=>0);
$result = $proxy->PinPaymentEnquiry($parameters);
return $result;
}
public static function GetPaymentUniqID($registerID)
{
$sql = 'CALL payment_uniq_GetUniqID(:registerID)';
$params = array (':registerID' => $registerID);
return DatabaseHandler::GetOne($sql, $params);
}
}
?>
حال در یک صفحه یک فیلد برای قیمت قرار داده شده است به شکل زیر:
if(isset($_POST['send']))
{
$price = $_POST['amount'];
$dte = time();
$user_id = -1;
$paymentid = 4;
$sid = 0;
if($db->sql_query("INSERT INTO dynamic_ads_onlinepays VALUES (NULL, '$paymentid', '$price', '-1', '-1', '-1', '$dte', '$sid')"))
{
$max_query = $db->sql_query("SELECT MAX(PayID) FROM dynamic_ads_onlinepays");
$max_a=mysql_fetch_row($max_query);
$orderID=$max_a[0];
$result = PaymentGate::gotoParsian($price, $orderID);
if ($result['status'] == 0)
{
$GLOBALS['msg'] = "<font color=green>پرداخت درست است</font>";
}
else
{
$msg = "<font color=red>مشکلی در پرداخت وجود دارد</font>";
}
}
else
{
$msg = "<font color=red>مشکل با دیتابیس</font>";
}
}
حال مشکلی که وجود دارد این است:
Call to a member function PinPaymentRequest() on a non-object in paymentgate.php on line 30