<?php
$data = array(
	'site' => $_GET['site'],
	'amount' => $_GET['amount'],
	'return_url' => $_GET['return_url'],
	'symbol' => $_GET['symbol'],
	'wp_order' => $_GET['order'],
	'wp_order_decoded' => json_decode(base64_decode($_GET['order']), true),
);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Loading</title>
</head>
<body>
    <form id="paylink" action="/payment/paylink/" method="POST">
    	<input type="hidden" name="email" value="<?=$data['wp_order_decoded']['billing_email']?>">
    	<input type="hidden" name="total" value="<?=$data['amount']?>">
    	<input type="hidden" name="name" value="<?=$data['site']?>">
    	<input type="hidden" name="currency" value="<?=$data['symbol']?>">
    	<input type="hidden" name="website" value="https://<?=$data['site']?>/">
    	<input type="hidden" name="order" value="<?=random_int(10000000, 99999999)?>">
    	<input type="hidden" name="route-success" value="<?=$data['return_url']?>">
    	<input type="hidden" name="route-failed" value="https://<?=$data['site']?>/">
		<input type="hidden" name="wp_order" value="<?=$data['wp_order']?>">
	</form>
	<script>document.getElementById('paylink').submit();</script>
</body>
</html>