0

Hi I have to get an information from a website using url and login parameters and some XML parameters as input Using a PHP. I am new to any API calls so please explain me how can I use these parameters in my PHP code and make a request to a server to get the information When I use these in SOAP UI I can get the demo result, I need to build the same in PHP.

https://transact-prelive.litle.com/vap/communicator/online
Username: u82917418420715660 
Password: dENteSXnXwfqKHF 
Merchant Id: 01183990

<litleOnlineRequest version="9.4" xmlns="http://www.litle.com/schema" merchantId="01183990">
    <authentication>
        <user>u82917418420715660</user>
        <password>dENteSXnXwfqKHF</password>
    </authentication>
    <authorization id="834262" reportGroup="ABC Division" customerId="038945">
        <orderId>65347567</orderId>
        <amount>40000</amount>
        <orderSource>3dsAuthenticated</orderSource>
        <billToAddress>
            <name>John Smith</name>
            <addressLine1>100 Main St</addressLine1>
            <city>Boston</city>
            <state>MA</state>
            <zip>12345</zip>
            <email>jsmith@someaddress.com</email>
            <phone>555-123-4567</phone>
        </billToAddress>
        <card>
        <type>VI</type>
        <number>4000000000000001</number>
        <expDate>1209</expDate>
        <cardValidationNum>555</cardValidationNum>
        </card>
        <cardholderAuthentication>
            <authenticationValue></authenticationValue>
            <authenticationTransactionId></authenticationTransactionId>
        </cardholderAuthentication>
    </authorization>
</litleOnlineRequest>
Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106
hemanth kumar
  • 529
  • 1
  • 6
  • 25

1 Answers1

0

You can use nusoap library to use SOAP with PHP. Here is an example how you can use it. It is just similar to your query.

        $this->load->library("lib_nusoap");
        $wsdl = "https://transact-prelive.litle.com/vap/communicator/online";
        $client = new nusoap_client($wsdl, 'wsdl');

        //$client->setCredentials($api_username,$api_password);
        $error = $client->getError();
        if ($error)
        {
            echo "\nSOAP Error\n".$error."\n";
            return false;
        }
        else
        {
            $params = array ('user' => "u82917418420715660 ", 'Password' => "dENteSXnXwfqKHF "); 
            $result = $client->call('retrive', $params);
            if ($client->fault)
            {
                print_r($result);
                print $client->fault;
            }
            else
            {
                $result_arr = json_decode($result, true);
            }    
        }
        print_r($result_arr);

Nusoap library will handle CURL API call.