I hope you guys can help me out. When we make an invoice I would like to include a link that enables our customers to pay their invoice online. We have a merchant account at a Danish gateway called ePay (a part of Bambora).
Our billing system can't build the URL I need, so I figured that with a PHP script on our webserver I could request the data, orderid and amount, and then add the rest via the php script. However I cannot get it to work.
Also a md5 checksum from our md5 key should be sent along with the data ie. "secret123'. So it should be submittet as a form.
Is it possible to build a form and automatically submit it via PHP? - So it works just like a redirect.
I followed user5214530 advice, but the page returns a 500 error? And I can't spot it?
<?php
$hash = 'secrethash';
$accepturl = 'https://www.asd.dk/dinbetaling.html#accept';
$cancelurl = 'https://www.asd.dk/dinbetaling.html#cancelurl';
$callbackurl = 'https://www.asd.dk/dinbetaling.html#callbackurl';
$mnumber = '123456';
$wid = '3';
$parameters = array
(
'merchantnumber' => $mnumber,
'windowid' => $wid,
'amount' => get_option('total_price'),
'currency' => get_option('currency'),
'windowstate' => 3,
'orderid' => get_option('orderid'),
'accepturl' => $accepturl,
'cancelurl' => $cancelurl,
'callbackurl' => $callback
);
?>
<html>
<head>
<title>Epay payment redirect</title>
</head>
<!--<body onload="autosubmit()">-->
<form method="post" action="script.php" name="betaling" id="betaling">
<input type="hidden" name="merchantnumber" value="<?php echo $merchantnumber; ?>">
<input type="hidden" name="windowid" value="<?php echo $windowid; ?>">
<input type="hidden" name="amount" value="<?php echo $amount; ?>">
<input type="hidden" name="currency" value="<?php echo $currency; ?>">
<input type="hidden" name="windowstate" value="<?php echo $windowstate; ?>">
<input type="hidden" name="orderid" value="<?php echo $orderid; ?>">
<input type="hidden" name="accepturl" value="<?php echo $accepturl; ?>">
<input type="hidden" name="cancelurl" value="<?php echo $cancelurl; ?>">
<input type="hidden" name="callbackurl" value="<?php echo $callbackurl; ?>">
<input type="hidden" name="hash" value="<?php md5(implode("", array_values($parameters)) . $hash); ?>">
</form>
<!--<script>
function autosubmit()
{
document.betaling.submit()
}</script>
-->
</body>
</html>