Jump to content

SOAP with SSL problem

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
Hello
I write class for SOAP WDSL now I have problem
My error
[B]Fatal error[/B]:  Uncaught SoapFault exception: [WSDL] SOAP-ERROR:  Parsing WSDL: Couldn't load from  'https://pgwstest.bpm.bankmellat.ir/pgwchannel/services/pgw?wsdl' :  failed to load external entity  "https://pgwstest.bpm.bankmellat.ir/pgwchannel/services/pgw?wsdl"  in C:\xampp\htdocs\paymet.php:19 Stack trace: #0 C:\xampp\htdocs\paymet.php(19):  SoapClient->SoapClient('https://pgwstes...') #1 C:\xampp\htdocs\paymet.php(101): melatPayment->__construct('ali',  'sss', 'ssss') #2 {main}   thrown in [B]C:\xampp\htdocs\paymet.php[/B] on line [B]19[/B]
My code:
<?php

/**
 * @author Ali Ghasemzadeh (Hamed)
 * @website http://Ghasemzadeh.ir
 * @copyright 2011
 */
class melatPayment
{
    private $terminalID;
    private $userName;
    private $userPassword;
    public $melatURL = 'https://pgwstest.bpm.bankmellat.ir/pgwchannel/services/pgw?wsdl';
    public $nameSpace = 'http://interfaces.core.sw.bps.com/';
    public $soapClient;
    
    function __construct($terminalID ,$userName ,$userPassword)
    {
        $this->soapClient = new SoapClient($this->melatURL);
        $this->terminalID = $terminalID;
        $this->userName = $userName;
        $this->userPassword = $userPassword;
    }
    
    function bpPayRequest($amount ,$orderID ,$callBackURL ,$additonalData ,$payerID = "0")
    {
        $localDate = date("Ymd");
        $localTime =  date("His");
        $params = array(
            'terminalId' => $this->terminalID,
            'userName' => $this->userName,
            'userPassword' => $this->userPassword,
            'orderId' => $orderID,
            'amount' => $amount,
            'localDate' => $localDate,
            'localTime' => $localTime,
            'additionalData' =>  $additonalData,
            'callBackUrl' => $callBackURL,
            'payerId' => $payerID);
        $result = $this->soapClient->__call('bpPayRequest',$params,$this->nameSpace);
        $outPut = explode (',',$result);
        return $outPut;
    }
    
    function bpVerifyRequest($orderID ,$saleReferenceID)
    {
        $params = array(
            'terminalId' => $this->terminalID,
            'userName' => $this->userName,
            'userPassword' => $this->userPassword,
            'orderId' => $orderID,
            'saleOrderId' => $orderID,
            'saleReferenceId' => $saleReferenceID);
        $result = $this->soapClient->__call('bpVerifyRequest',$params,$this->nameSpace);
        $outPut = explode (',',$result);
        return $outPut;
    }
    
    function bpSettleRequest($orderID ,$saleReferenceID)
    {
        $params = array(
            'terminalId' => $this->terminalID,
            'userName' => $this->userName,
            'userPassword' => $this->userPassword,
            'orderId' => $orderID,
            'saleOrderId' => $orderID,
            'saleReferenceId' => $saleReferenceID);
        $result = $this->soapClient->__call('bpSettleRequest',$params,$this->nameSpace);
        $outPut = explode (',',$result);
        return $outPut;
    }
    
    function bpInquiryRequest($orderID ,$saleReferenceID)
    {
        $params = array(
            'terminalId' => $this->terminalID,
            'userName' => $this->userName,
            'userPassword' => $this->userPassword,
            'orderId' => $orderID,
            'saleOrderId' => $orderID,
            'saleReferenceId' => $saleReferenceID);
        $result = $this->soapClient->__call('bpInquiryRequest',$params,$this->nameSpace);
        $outPut = explode (',',$result);
        return $outPut;
    }
    
    function bpReversalRequest($orderID ,$saleReferenceID)
    {
        $params = array(
            'terminalId' => $this->terminalID,
            'userName' => $this->userName,
            'userPassword' => $this->userPassword,
            'orderId' => $orderID,
            'saleOrderId' => $orderID,
            'saleReferenceId' => $saleReferenceID);
        $result = $this->soapClient->__call('bpReversalRequest',$params,$this->nameSpace);
        $outPut = explode (',',$result);
        return $outPut;
    }
}
$mp = new melatPayment('ali','sss','ssss');


?>


#2
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
Now
I get this error:
Warning: SoapClient::__call() expects parameter 3 to be array, string given in C:\xampp\htdocs\paymet.php on line 51






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users