<?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/
 *
 ******************************************************************************/

$crypted_price = crypt(sprintf("%.2f",$price), $config['alertPay_secure_code']);

$data = $plan_id .'|'. $item_id .'|'. $account_id .'|'. $crypted_price .'|'. $callback_class .'|'. $callback_method .'|'. RL_LANG_CODE .'|'. $callback_plugin; // $callback_plugin from v4.0.2
$data = base64_encode($data);

$alertPay_url = $config['alertPay_sandbox'] ? 'https://sandbox.Payza.com/sandbox/payprocess.aspx' : 'https://secure.payza.com/checkout';
$notify_url = RL_PLUGINS_URL . 'alertPay/controllers/post.gateway.php';

?>

<form name="payment_form" action="<?php echo $alertPay_url; ?>" method="post">
	<input name="ap_purchasetype" type="hidden" value="item-goods" />
	<input name="ap_merchant" type="hidden" value="<?php echo $config['alertPay_account_email']; ?>" />
	<input name="ap_securitycode" type="hidden" value="<?php echo $config['alertPay_secure_code']; ?>" />
	<input name="ap_itemname" type="hidden" value="<?php echo $item_name; ?>" />
	<input name="ap_amount" type="hidden" value="<?php echo $price; ?>" />
	<input name="ap_currency" type="hidden" value="<?php echo $config['alertPay_currency_code']; ?>" />
	<input name="apc_1" type="hidden" value="<?php echo $data; ?>" />
	<input name="ap_quantity" type="hidden" value="1" />
	<?php if ( $account_info['First_name'] ) { ?>
	<input name="ap_fname" type="hidden" value="<?php echo $account_info['First_name']; ?>" />
	<?php } ?>
	<?php if ( $account_info['Last_name'] ) { ?>
	<input name="ap_lname" type="hidden" value="<?php echo $account_info['Last_name']; ?>" />
	<?php } ?>
	<?php if ( $account_info['Mail'] ) { ?>
	<input name="ap_contactemail" type="hidden" value="<?php echo $account_info['Mail']; ?>" />
	<?php } ?>
	<input name="ap_image" src="<?php echo RL_TPL_BASE; ?>img/logo.png" type="hidden" />
	
	<!--input type="hidden" name="ap_ipnversion" value="2" /-->
	
	<input type="hidden" name="ap_returnurl" value="<?php echo $success_url; ?>"/>
	<input type="hidden" name="ap_cancelurl" value="<?php echo $cancel_url; ?>"/>
	<input type="hidden" name="ap_alerturl" value="<?php echo $notify_url; ?>"/>
</form>