<?php

$xml = "<?xml version='1.0' encoding='utf-8' ?> 
<order> 
    <userAccountId>23005</userAccountId> 
    <currency>USD</currency> 
    <label>order label</label> 
    <ageGroup>ALL</ageGroup> 
    <categoryId>225</categoryId> 
    <urlAcquital><![CDATA[http://www.exemple.com/acquittement.php]]></urlAcquital> 
    <urlOk><![CDATA[http://www.exemple.com/ok.php]]></urlOk> 
    <urlKo><![CDATA[http://www.exemple.com/ko.php]]></urlKo> 
    <urlCancel><![CDATA[http://www.exemple.com/cancel.php]]></urlCancel> 
    <urlInstall><![CDATA[http://www.exemple.com/install.php]]></urlInstall> 
    <urlLogo><![CDATA[http://www.exemple.com/logo.gif]]></urlLogo> 
    <email_ack><![CDATA[support_it_allopass@hotmail.com]]></email_ack>
 
    <!-- optional --> 
    <locale>fr_FR</locale> 
    <issuerAccountLogin>issuerlogin@hipay.com</issuerAccountLogin> 
 
    <data> 
        <nom1>value 1</nom1> 
        <nom2>value 2</nom2> 
        <nom3>value 3</nom3> 
    </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> 
            <taxes> 
                <tax id='1'> 
                    <label>shipping</label> 
                    <amount>25</amount> 
                </tax> 
                <tax id='2'> 
                    <label>VAT</label> 
                    <amount>19.6%</amount> 
                </tax> 
            </taxes> 
        </item> 
        <item id='2'> 
            <name>second product name</name> 
            <infos>second product description</infos> 
            <amount>2.14</amount> 
            <categoryId>225</categoryId> 
            <quantity>2</quantity> 
            <reference>REF2</reference> 
            <taxes> 
                <tax id='1'> 
                    <label>VAT</label> 
                    <amount>19.6%</amount> 
                </tax> 
                <tax id='2'> 
                    <label>shipping</label> 
                    <amount>5.25</amount> 
                </tax> 
            </taxes> 
        </item> 
    </items> 
    <affiliates> 
        <affiliate id='23095'> 
            <amount>15%</amount> 
        </affiliate> 
        
    </affiliates> 
</order>
";


 
/* 
 * Var $data contain the XML string describing your order 
 */ 
 $data = trim($xml); 
 
// your website Hipay key 
$signKey = 'a65eb46d338a40e41955dc56e1af55a5'; 
$encodedData = base64_encode($data); 
$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='hidden' name='pay-mode' value="mobile" /> --> 
    <input type='image' name='send' src="https://test-www.hipay.com/images/bt_payment3.gif" /> 
</form> 