<?php
$hipay = "<?xml version='1.0' encoding='utf-8' ?> 
<order type='subscription'> 
    <userAccountId>22920</userAccountId> 
    <currency>EUR</currency> 
    <label>libelle de la commande</label> 
    <ageGroup>ALL</ageGroup> 
    <categoryId>225</categoryId> 
    <urlAcquital><![CDATA[http://sd-20614.dedibox.fr/~jabella/hipay/acquital.php]]></urlAcquital> 
    <urlOk><![CDATA[http://sd-20614.dedibox.fr/~jabella/hipay/notif_save.php]]></urlOk> 
    <urlKo><![CDATA[http://sd-20614.dedibox.fr/~jabella/hipay/notif_save.php]]></urlKo> 
    <urlCancel><![CDATA[http://sd-20614.dedibox.fr/~jabella/hipay/notif_save.php]]></urlCancel> 
    <urlInstall><![CDATA[http://sd-20614.dedibox.fr/~jabella/hipay/notif_save.php]]></urlInstall> 
    
    <!-- optional --> 
    <locale>fr_FR</locale> 
    <issuerAccountLogin></issuerAccountLogin> 
 
    <!-- free data --> 
    <data> 
        <nom>mon nom</nom> 
        <stock>mon stock</stock> 
        <credits1>VALUE 1</credits1> 
        <credits2>value 2</credits2> 
        <credits2>value 3</credits2> 
    </data> 
  <!-- subscription description --> 
    <items> 
        <!-- no promotion period --> 
        <item id='1'> 
            <amount>89.70</amount> 
            <!-- description of the subscription cycle --> 
            <delay type='month'>6</delay> 
 
            <!-- renewability of the subscription --> 
            <renewable>12</renewable> 
        </item> 
    </items> 
</order>
";
/*
$hipay = "<?xml version='1.0' encoding='utf-8' ?> 
<order> 
    <userAccountId>166181</userAccountId> 
    <currency>CHF</currency> 
    <label>Chips Order</label> 
    <ageGroup>ALL</ageGroup> 
    <categoryId>652</categoryId> 
    <urlAcquital><![CDATA[http://www.loftgirls.com/hipay_CFc893ylCUJ43r7GCkjhnb4Vu4hLKvr.php]]></urlAcquital> 
    <urlOk><![CDATA[http://www.loftgirls.com/myaccount.php]]></urlOk> 
    <urlKo><![CDATA[http://www.loftgirls.com/myaccount.php]]></urlKo> 
    <urlCancel><![CDATA[http://www.loftgirls.com/myaccount.php]]></urlCancel> 
    <urlInstall><![CDATA[http://www.loftgirls.com/myaccount.php]]></urlInstall> 
    
    <!-- optional --> 
    <locale>fr_FR</locale> 
    <issuerAccountLogin>issuerlogin@hipay.com</issuerAccountLogin> 
 
    <data> 
        <nom1>value 1</nom1> 
     </data> 
    <items> 
        <item id='1'> 
            <name>first product name</name> 
            <infos>first product description</infos> 
            <amount>5.2</amount> 
            <categoryId>225</categoryId> 
            <quantity>1</quantity> 
            <reference>REF1</reference> 
            
        </item> 
        
    </items> 
    
</order>
";
*/
$encodedData = base64_encode(trim($hipay));
$signKey = 'a65eb46d338a40e41955dc56e1af55a5'; 
$md5Sign = md5($encodedData.$signKey);
?> 
 
<form target='_blank' action='https://test-payment.hipay.com/index/form/' method='post' > 
    <input type='hidden' name='mode' value='MODE_B' /> 
    <input type='hidden' name='website_id' value='345' /> 
    <input type='hidden' name='sign' value="<?php echo $md5Sign ?>" /> 
    <input type='hidden' name='data' value="<?php echo $encodedData ?>" /> 
    <input type='image' name='send' src="https://www.hipay.com/images/bt_payment3.gif" /> 
</form> 