<?php

/******************************************************************************
 *
 *	PROJECT: Flynax Classifieds Software
 *	VERSION: 4.X
 *	LICENSE: FL0M2SG681CQ - http://www.flynax.com/license-agreement.html
 *	PRODUCT: Pets Classifieds
 *	DOMAIN: pupsnshop.com
 *	FILE: PRE.GATEWAY.PHP
 *
 *	The software is a commercial product delivered under single, non-exclusive, 
 *	non-transferable license for one domain or IP address. Therefore distribution, 
 *	sale or transfer of the file in whole or in part without permission of Flynax 
 *	respective owners is considered to be illegal and breach of Flynax License End 
 *	User Agreement. 
 *
 *	You are not allowed to remove this information from the file without permission
 *	of Flynax respective owners.
 *
 *	Flynax Classifieds Software 2014 |  All copyrights reserved. 
 *
 *	http://www.flynax.com/
 *
 ******************************************************************************/

// get invoice info
if ( $_SESSION['complete_payment']['callback']['plugin'] == 'Invoices' )
{
	$sql  = "SELECT `ID`, `Txn_ID`, `Account_ID` FROM `". RL_DBPREFIX ."invoices` ";
	$sql .= "WHERE `Account_ID` = '{$account_info['ID']}' AND `Txn_ID` = '{$_SESSION['complete_payment']['item_id']}' LIMIT 1";
	$invoice_info = $rlDb -> getRow($sql);

	$_SESSION['complete_payment']['item_id'] = (int)$invoice_info['ID'];
	$item_id = $invoice_info['ID'];

	unset($invoice_info);
}

$data = $plan_id .'|'. $item_id .'|'. $account_id .'|'. $price .'|'. $callback_class .'|'. $callback_method .'|'. $cancel_url .'|'. $success_url .'|'. RL_LANG_CODE .'|'. $callback_plugin;
$data = base64_encode($data);

?>

<form action="<?php echo RL_PLUGINS_URL .'payAsYouGoCredits/controllers/post.gateway.php'; ?>" method="POST" name="payment_form">
	<input type="hidden" name="form" value="payment" />
	<input type="hidden" name="total" value="<?php echo $price; ?>" />
	<input type="hidden" name="item_id" value="<?php echo $item_id; ?>" />
	<input type="hidden" name="service" value="<?php echo $service; ?>" />
	<input type="hidden" name="item_number" value="<?php echo $data; ?>" />
</form>