Question

mblox soap api - php soap Payment Request not working and gives error.

I use as below code in subscribe.php file...

$client = new SoapClient("https://ngp.us.mblox.com/client-gateway/services?wsdl", array('trace' => 1,  'encoding' => 'UTF-8', 'soap_version' => SOAP_1_2));

$array = array(
'SecurityContext'=>array('userId'=>'aaaaaaaa','password'=>'bbbbbbbb'),
'ClientDetails'=>array('shortcode'=>'234242', 'brandName'=>'aaaaaaaaaa.com', 'programSponsor'=>'aaaaaaaaaa',  'originatingUrl'=>'www.aaaaaaaaaa.com', 'minPageUrl'=>'www.aaaaaaaaaa.com', 'successUrl'=>'www.aaaaaaaaaa.com/subscribConfirm.php', 'cancelUrl'=>'www.aaaaaaaaaa.com', 'tcUrl'=>'www.aaaaaaaaaa.com/terms.html', 'postBackUrl'=>'http://aaaaaaaaaa/subscribe.php'),
'paymentDetails'=>array('paymentType'=>'PSMS', 'amount'=>'9.99', 'currency'=>'USD', 'billingFrequency'=>'MONTHLY'),
'msisdn'=>'243233232',
'serviceId'=>'332',
'operatorId'=>'33343',
'productDescription'=>'Text test',
'optInBody'=>'aaaaaaaaaa',
'browserSessionId'=>'123456',
);

$result = $client->initiatePayment($array);

It shows error as below on last line => $result = $client->initiatePayment($array);

Fatal error: Uncaught SoapFault exception: [(null)] in /aaaaaaaa/Source/developement/PHP/ver1/subscribe.php:97 Stack trace: 0 /aaaaaaaa/Source/developement/PHP/ver1/subscribe.php(97): SoapClient->__call('initiatePayment', Array) #1 /aaaaaaaa/Source/developement/PHP/ver1/subscribe.php(97): SoapClient->initiatePayment(Array) #2 {main} thrown in /aaaaaaaa/Source/developement/PHP/ver1/subscribe.php on line 97

Was it helpful?

Solution

I got things working using curl,

I use This

as a reference and code working.

Thankx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top