<?php require_once 'protect.php'; ?>

<?php if ($payurl) { ?>

<div class="floatleft margright20 divbank"> 
<?php
$amount = number_format($amount, 2,",","");

if ( $amount>500 ) {
$str = $sitenr."en".$orderid.$item.$amount."EUR".$email.$ctel."20".$period.$protocol."www.".$domain."/transaction-1".$protocol."www.".$domain."/transaction-2".$sitecode;
} else {
$str = $sitenr."en".$orderid.$item.$amount."EUR".$email.$ctel."2".$protocol."www.".$domain."/transaction-1".$protocol."www.".$domain."/transaction-2".$sitecode;
}

$digest = base64_encode(sha1($str, true))
?>
<form id="ccardform" name="ccardform" method="post" action="<?php echo $payurl ?>" enctype="application/x-www-form-urlencoded" accept-charset="UTF-8">

<input type="hidden" name="mid" value="<?php echo $sitenr ?>"/>
<input type="hidden" name="lang" value="en"/>
<input type="hidden" name="orderid" value="<?php echo $orderid ?>"/>
<input type="hidden" name="orderDesc" value="<?php echo $item ?>"/>
<input type="hidden" name="orderAmount" value="<?php echo $amount ?>"/>
<input type="hidden" name="currency" value="EUR"/>
<input type="hidden" name="payerEmail" value="<?php echo $email ?>"/>
<input type="hidden" name="payerPhone" value="<?php echo $telephone ?>"/>
<input type="hidden" name="trType" value="2"/>
<?php if ( $period>0 ) {?>
<input type="hidden" name="extInstallmentoffset" value="0"/>
<input type="hidden" name="extInstallmentperiod" value="<?php echo $period ?>"/>
<?php } ?>
<input type="hidden" name="confirmUrl" value="<?php echo $protocol ?>www.<?php echo $domain ?>/transaction-1"/>
<input type="hidden" name="cancelUrl" value="<?php echo $protocol ?>www.<?php echo $domain ?>/transaction-2"/>
<input type="hidden" name="digest" value="<?php echo $digest ?>"/>
<input name="submitpayment" type="submit" class="button" value="PAY WITH CREDIT CARD">

</form>
</div>
<?php } ?> 