PHP Classes

File: response.php

Recommend this page to a friend!
  Classes of Alessandro Astarita   GestPayCrypt-PHP   response.php   Download  
File: response.php
Role: Example script
Content type: text/plain
Description: Example response
Class: GestPayCrypt-PHP
GestPay Italian credit card payment gateway
Author: By
Last change:
Date: 20 years ago
Size: 706 bytes
 

Contents

Class file image Download
<?php

require_once "../GestPayCrypt.inc.php";

// Parametri obbligatori
if (empty($_GET["a"])) {
    die(
"Parametro mancante: 'a'\n");
}

if (empty(
$_GET["b"])) {
    die(
"Parametro mancante: 'b'\n");
}

$crypt = new GestPayCrypt();

$crypt->SetShopLogin($a);
$crypt->SetEncryptedString($b);

if (!
$crypt->Decrypt()) {
    die(
"Error: ".$crypt->GetErrorCode().": ".$crypt->GetErrorDescription()."\n");
}

switch(
$crypt->GetTransactionResult()) {
    case
"XX":
        die(
"Esito transazione sospeso (pagamento tramite bonifico)\n");
        break;

    case
"KO":
        die(
"Esito transazione negativo\n");
        break;

    case
"OK":
        die(
"Esito transazione positivo\n");
        break;

    default:
        die(
"Esito transazione indefinito\n");
}

?>