<?php
/*****************************************************************************************************/
/*  CALL BACK CODE FROM CHRONOPAY : This code needs to be called from your processor upon completion */
/* 									This is the user redirect.  									 */
/* 									The Chronopay server calls callback_ipn.php						 */
/*****************************************************************************************************/
define('INCLUDE_STEPS', 'pluginCallback');
require_once dirname(__FILE__) . '/../../../common/common.php';
require_once 'classes/class.gateway.plugin.php';

//Get vars from post/get
$lInvoiceID		= trim( stripslashes($_POST['cs1']) );
$lSignUp		= trim( stripslashes($_POST['cs2']) );

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

//print_r( $cPlugin );

//print_r( get_class_methods($cPlugin) );

//echo $cPlugin->IsPaid();

//ClientExec URL

//var_dump( get_defined_vars() );
//print_r( $GLOBALS['mySettings']->m_arrSettings['ClientExec URL'] );

if( $cPlugin->IsPaid()==1 )
{
	$cPlugin->m_PaymentAccepted = 1;
}

//var_export( $cPlugin );
$cPlugin->ForwardUser($lSignUp);	

?>
