<?php

/******************************************************************************
 *
 *	PROJECT: Flynax Classifieds Software
 *	VERSION: 4.0
 *	LISENSE: http://www.flynax.com/license-agreement.html
 *	PRODUCT: General Classifieds
 *	
 *	FILE: PRE_PAYPAL.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), $config['paypal_secret_word']);

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

$notify_url = RL_LIBS_URL . 'payment/paypal/post_paypal.gateway.php';

/* generate payment form */
?>
<form name="payment_form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
	<input type="hidden" name="item_number" value="<?php echo str_replace(' ', '+', $item); ?>" />
	<input type="hidden" name="currency_code" value="<?php echo $config['paypal_currency_code']; ?>" />
	<input type="hidden" name="business" value="<?php echo $config['paypal_account_email']; ?>" />
	<input type="hidden" name="cmd" value="_xclick" />
	<input type="hidden" name="no_shipping" value="1" />
	<input type="hidden" name="item_name" value="<?php echo $item_name; ?>" />
	<input type="hidden" name="amount" value="<?php echo $price; ?>" />
	<input type="hidden" name="return" value="<?php echo $success_url;?>" />
	<input type="hidden" name="cancel_return" value="<?php echo $cancel_url;?>" />
	<input type="hidden" name="notify_url" value="<?php echo $notify_url; ?>" />
	<input type="hidden" name="rm" value="2" />
	<input type="hidden" name="charset" value="utf-8">
	<input type="hidden" name="image_url" value="<?php echo RL_TPL_BASE ?>img/logo.png">
</form>