<?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'		=>	'd4a919efc4843389def7d56922c56c58', // Prod Hipay Direct Juan
	'wsPassword'	=>	'a2e33c6fdad9cbd3685cbf3fe8c868e0',  // Prod Hipay Direct Juan
   	'websiteId'		=>  '7432', 
   	'categoryId' 	=>  '618', 
   	'currency' =>  'EUR', 
   	'amount' =>  '23.15', 
   	'rating' =>  'ALL', 
   	'locale' =>  'fr_FR', 
   	'customerIpAddress' =>  '127.0.0.0', 
   	'customerEmail' =>  'juanchor@mail.com', 
	'executionDate' => date('Y-m-dTH:i:s', time()),
   	'manualCapture' =>  '0', 
   	'urlCallback' =>  'http://example.org/Callback', 
   	'urlAccept' =>  'http://example.org/Accept', 
   	'urlDecline' =>  'http://example.org/Decline', 
   	'urlCancel' =>  'http://example.org/Cancel',
	'urlLogo' =>  'http://blog.laruchequiditoui.fr/upload2/2013/07/logo-article-blog.jpg', 
   	'freeData' => $freeData,
	'description' => 'Test LRQDO',
	'merchantComment' => 'Comment Test LRQDO',
	
);

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

header('Content-Type: text/xml; charset=UTF-8');
echo $client->__getLastResponse();

?>

