<?php
/*****************************************************************************************************/
/*  CALL BACK CODE FROM PAYSYSTEM on fail : This code needs to be called from your processor upon completion */
/*****************************************************************************************************/
// $cPlugin->GetPluginVariable takes queries in the form of plugin_[pluginname]_[variable]

include_once("../../../classes/class.gateway.plugin.php");

//Get vars from post/get
list($tInvoiceID,$tIsRecurring,$tGenerateInvoice) = explode("_", $_POST['option1']);

$tTransStatus = $_POST['cc_status'];
$lPricePaid = $_POST['amount'];  //For Future Use
$tSignUp = $_POST['option2'];  // return of optional variables needs to be 1 or 0, 1 if a signup transaction
$tOrderID = $_POST['orderid'];
$transaction = " Payment failed (OrderID:".$tOrderID.")";

//Create plug in class to interact with CE
$cPlugin = new Plugin($tInvoiceID);

//Determine if payment was made
$cPlugin->PaymentRejected($transaction);

//Forward User needs to come after PaymentAccepted or PaymentRejected
$cPlugin->ForwardUser($tSignUp);
?>