Login   Register  
PHP Classes
elePHPant
Icontem

File: request.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Alessandro Astarita  >  GestPayCrypt-PHP  >  request.php  >  Download  
File: request.php
Role: Example script
Content type: text/plain
Description: Example request
Class: GestPayCrypt-PHP
GestPay Italian credit card payment gateway
Author: By
Last change:
Date: 2003-07-04 19:52
Size: 826 bytes
 

Contents

Class file image Download
<?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);

?>