SecurePay-PHP (PA)

<?php
function prepareCheckout() {
$data = "authentication.userId=8a8294184f45ce7e014f4b1d16cc12df".
"&authentication.password=j3zCJ2ENaD".
"&authentication.entityId=8a8294184f45ce7e014f4b1d16bd12db".
"&paymentType=PA" .
"&amount=50.99" .
"&curency=RSD";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if(curl_errno($ch)) {
return curl_error($ch);
}
curl_close($ch);
return json_decode($response)->id;
}
$checkoutId = prepareCheckout();
?>
<!DOCTYPE html>
<head>
<title>SECUREPAY PHP</title>
<script src="https://test.oppwa.com/v1/paymentWidgets.js?checkoutId=<?php echo $checkoutId; ?>"></script>
</head>
<body>
<form action="http://localhost/status.php" class="paymentWidgets">VISA MASTER MAESTRO</form>
</body>
</html>