<?php
require_once "../GestPayCrypt.inc.php";
define("GESTPAY_SHOPLOGIN", "");
define("GESTPAY_URL_PAGAM", "https://ecomm.sella.it/gestpay/pagam.asp");
// Parametri obbligatori
if (empty($_GET["id"])) {
die("Parametro mancante: 'id'\n");
}
if (empty($_GET["price"])) {
die("Parametro mancante: 'price'\n");
}
// Parametri opzionali
if (empty($_GET["cur"])) {
$cur = "242"; // default
}
$crypt = new GestPayCrypt();
$crypt->SetShopLogin(GESTPAY_SHOPLOGIN);
$crypt->SetShopTransactionID($id);
$crypt->SetAmount($price);
$crypt->SetCurrency($cur);
if (!$crypt->Encrypt()) {
die("Errore: ".$crypt->GetErrorCode().": ".$crypt->GetErrorDescription()."\n");
}
$req_url = GESTPAY_URL_PAGAM."?a=".$crypt->GetShopLogin().
"&b=".$crypt->GetEncryptedString();
header("Location: ".$req_url);
?>
|