<?php
ini_set('soap.wsdl_cache_ttl', 1);
ini_set("soap.wsdl_cache_enabled", WSDL_CACHE_NONE);

$client = new SoapClient("https://test-ws.hipay.com/soap/payment-v2?wsdl",
    array('features' =>  SOAP_SINGLE_ELEMENT_ARRAYS, 'trace' => 1));

$parameters = new stdClass();
$freeData = array();
$aFreeData1 = new stdClass();
        $aFreeData1->key = "keyOne";
        $aFreeData1->value = "aValueOne";
    
        $aFreeData2 = new stdClass();
        $aFreeData2->key = "keyTwo";
        $aFreeData2->value = "aValueTwo";
    
        $freeData[] = $aFreeData1;
        $freeData[] = $aFreeData2;
        
$parameters->parameters = array(
   	'wsLogin' =>  '4f8c3e80fd4e476f1e227c68fefdb3e5',
   	'wsPassword' =>  '2f0c4099c4254f819bf7246d6202d192',
   	'websiteId' =>  '345', 
   	'categoryId' =>  '225', 
//   'subscriptionId' =>  '8F4C62FA9554CF398DD4E4D2AE07F0E2', 
   	'currency' =>  'EUR', 
   	'amount' =>  '20', 
   	'rating' =>  'ALL', 
   	'locale' =>  'fr_FR', 
   	'customerIpAddress' =>  '127.0.0.0', 
   	'customerEmail' =>  'juanchor@mail.com', 
//   'executionDate' => '2012-12-10T18:00:00+00:00',
// 	'executionDate' => date('Y-m-dTH:i:s', strtotime("+2 hours")),
	'executionDate' => date('Y-m-dTH:i:s', time()),
   	'manualCapture' =>  '0', 
   	'urlCallback' =>  'http://sd-20614.dedibox.fr/~jabella/notif/index.php', 
   	'urlAccept' =>  'http://sd-20614.dedibox.fr/~jabella/notif/index.php?page=WSAccept', 
   	'urlDecline' =>  'http://sd-20614.dedibox.fr/~jabella/notif/index.php?page=WSDecline', 
   	'urlCancel' =>  'http://sd-20614.dedibox.fr/~jabella/notif/index.php?page=WSCancel',
	'urlLogo' =>  'http://sd-20614.dedibox.fr/~jabella/sample_logo.jpg', 
   	'emailCallback' =>  'jabella@hi-media.com', 
   	'freeData' => $freeData,
	'description' => 'Payment by WS',
	'merchantComment' => 'Using the payment-v2 WS',
	
);

$response = $client->generate($parameters);

echo "<strong>Request</strong><br/>" . $client->__getLastRequest();

echo "<br/>Response<br/>";
var_dump($response);

?>
