<?php
/*
 * TEST SOAP ABO
 * 
 * */
$wsdl = 'https://test-ws.hipay.com/soap/subscription?wsdl';
$initArray = array(

  'wsLogin' => '4f8c3e80fd4e476f1e227c68fefdb3e5',
  'wsPassword' => '2f0c4099c4254f819bf7246d6202d192',
  'websiteId' => 345,
  'categoryId' => 225,
  'customerEmail' => 'jabella@hi-media.com',
);

$options = array(
                'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP,
                'cache_wsdl' => WSDL_CACHE_NONE,
            );

            $client = new SoapClient($wsdl, $options);
            $result = $client->process($initArray + array(
                    'currency' => 'EUR',
                    'rating' => '+18',
                    'locale' => 'fr_FR',
                    'label' => 'test3.juanrene.com', //'Abonnement web service',
                    'customerIpAddress' => '66.249.92.104', //$_SERVER['REMOTE_ADDR'],
                    'merchantReference' => '5028737', // 'REF-ABO15',
                    'urlCallback' => 'http://test.perfectpay.com/HiPayWSConfirmation.aspx', // 'http://www.example.com/callback',

                    'urlAccept' => 'http://test.perfectpay.com/HiPayWSReturnURL.aspx?response=ok&amp;transid=5028737&amp;clientid=1511042',
                    'urlDecline' => 'http://test.perfectpay.com/HiPayWSReturnURL.aspx?response=nok&amp;transid=5028737&amp;clientid=1511042',
                    'urlCancel' => 'http://test.perfectpay.com/HiPayWSReturnURL.aspx?response=cancel&amp;transid=5028737&amp;clientid=1511042',

                    'payments' => array(
                    	'initial' => array(
                            'name' => 'Edição Digital',
                            'description' => 'Assinatura Free Trial',
                            'amount' => 2,
                            'periodType' => 'trial',
                            'recurrence' => array(
                                'frequency' => 1,
                                'duration' => 'month',
                            ),
                           //'periodType' => 'normal',
                            
                            //'executionTimestamp' => date('Y-m-dTH:i:s', strtotime("+7 days")),
                        ),
                        'rebill' => array(
                            'name' => 'Edição Digital - 1 Mês',
                            'description' => 'Pagamento Recorrente',
                            'amount' => '9.99',
                            'executionTimestamp' => date('c', strtotime("+2 months", strtotime(date('c')))),
                        ),
                    ),
             	)
             );
var_dump($result);             
          
/*-----------------
 * 
 * TEST SOAP USER ACCOUNT
 * 
 * 
 
$client = new
SoapClient("https://test-ws.hipay.com/soap/user-account-v2?wsdl", array('features' => SOAP_SINGLE_ELEMENT_ARRAYS));

//$parameters = new stdClass();
$parameters = array(
  'wsLogin' => '4f8c3e80fd4e476f1e227c68fefdb3e5',
  'wsPassword' => '2f0c4099c4254f819bf7246d6202d192',
  'email' => 'jabella@hi-media.com', 
);

$response = $client->getAvailablePaymentMethods($parameters);

var_dump($response);
*/