$url = 'https://anypay.io/merchant';
$params = array(
'merchant_id' => $project_id,
'pay_id' => $pay_id,
'amount' => $amount,
'currency' => $currency,
'desc' => $desc,
'sign' => $sign,
);
$result = file_get_contents($url, false, stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => http_build_query($params)
)
)));
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body onload="document.getElementById('payment-form').submit();">
<form id="payment-form" action="https://anypay.io/merchant" method="post">
<input type="hidden" name="merchant_id" value="<?=$project_id?>" />
<input type="hidden" name="pay_id" value="<?=$pay_id?>" />
<input type="hidden" name="amount" value="<?=$amount?>" />
<input type="hidden" name="currency" value="<?=$currency?>" />
<input type="hidden" name="desc" value="<?=$desc?>" />
<input type="hidden" name="sign" value="<?=$sign?>" />
<noscript>
<input type="submit" value="Перейти к оплате" />
</noscript>
</form>
</body>
</html>
<?php
$params = array(
'merchant_id' => $project_id,
'pay_id' => $pay_id,
'amount' => $amount,
'currency' => $currency,
'desc' => $desc,
'sign' => $sign,
);
$url = "https://anypay.io/merchant?".http_build_query($params);
header("Location: {$url}");
exit;