<?php

/******************************************************************************
 *
 *	PROJECT: Flynax Classifieds Software
 *	VERSION: 4.0
 *	LISENSE: http://www.flynax.com/license-agreement.html
 *	PRODUCT: General Classifieds
 *	
 *	FILE: PRE_2CO.GATEWAY.PHP
 *
 *	This script is a commercial software and any kind of using it must be 
 *	coordinate with Flynax Owners Team and be agree to Flynax License Agreement
 *
 *	This block may not be removed from this file or any other files with out 
 *	permission of Flynax respective owners.
 *
 *	Copyrights Flynax Classifieds Software | 2012
 *	http://www.flynax.com/
 *
 ******************************************************************************/

$crypted_price = crypt(sprintf("%.2f",$price), "reefless.com");

$data = $plan_id .'|'. $item_id .'|'. $account_id .'|'. $crypted_price .'|'. $callback_class .'|'. $callback_method .'|'. $cancel_url .'|'. $success_url .'|'. RL_LANG_CODE;
$item = urlencode(base64_encode($data));

$order_id = mt_rand() . time();
$notify_url = RL_LIBS_URL . 'payment/2co/post_2co.gateway.php';

/* generate payment form */
?>
<form name="payment_form" action="https://www.2checkout.com/checkout/purchase" method="post">
	<input type="hidden" name="sid" value="<?php echo $GLOBALS['config']['2co_id']; ?>" />
	<input type="hidden" name="cart_order_id" value="<?php echo $order_id; ?>" />
	<input type="hidden" name="item_number" value="<?php echo $item; ?>" />
	<input type="hidden" name="product_id" value="<?php echo $listing_id; ?>" />
	<input type="hidden" name="total" value="<?php echo $price; ?>" />
	<input type="hidden" name="quantity" value="1" />
	<input type="hidden" name="credit_card_processed" value="Y" />
	<input type="hidden" name="x_receipt_link_url" value="<?php echo $notify_url; ?>" />
	<input type="hidden" name="c_name" value="<?php echo $item_name; ?>" >
	<input type="hidden" name="c_description" value="<?php echo $item_name; ?>" />
	
	<!--input type="hidden" name="demo" value="Y" /-->
</form>