I m getting response. Please guide me

http://182.19.20.182:81/mcommerce.webservices/pgService?wsdl


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pay="http://paymentgateway.mcommerce/">
<soapenv:Header>
<pay:password>**password**</pay:password>
<pay:userId>**user-id**</pay:userId>
</soapenv:Header>
<soapenv:Body>
<pay:refundPaymentTransaction>
<MCODE>0024999999</MCODE>
<mcomPgTransID>1706161063197</mcomPgTransID>
<transRefNo>16061700036088</transRefNo>
<amt>150</amt>
<narration>refund</narration>
<reversalType>F</reversalType>
</pay:refundPaymentTransaction>
</soapenv:Body>
</soapenv:Envelope>

Welcome to the forums developersharad.

Is there a specific question you have to ask about this code.
It’s not clear exactly what the problem is.

<?php  
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient('http://182.19.20.182:81/mcommerce.webservices/pgService?wsdl',array('trace' => 1 )); 
$ns='http://paymentgateway.mcommerce/';
////var_dump($client->__getFunctions());  
//
$auth = array(
  "userid" => "**user-id**",
  "password" => "**password**",
  
);
$header = new SoapHeader($ns, 'pay', $auth);

$params = array(
  "MCODE" => 0001000269,
  "mcomPgTransID" => 2903173001857,
  "transRefNo" => 290320171490774815,
  "amt" => 1,
  "narration" => "refund",
  "reversalType" => "F",
);

$response = $client->__soapCall("refundPaymentTransaction", $params,NULL, $header);
//Create Soap Header.
//echo $client->__getLastRequest();
//echo $client->__getLastRequestHeaders();

var_dump($response);

?>

Please see above code i m getting below error. please fix it.

object(stdClass)#3 (1) { ["Response"]=> object(stdClass)#4 (2) { ["statusCode"]=> string(3) "101" ["reason"]=> string(21) "Authentication failed" } }

so, if i understand it right, you did nothing on your own and want us to do your work?

1 Like

I am not able to succesfully connect with above wsdl url. I’ve tried above codes but none of them worked.

Because you are getting “Authentication failed”, I think that’s what you should look at fixing first.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.