$title ='Electronic Check Payment'; include('elements/header.php'); ?>
$current_menu = 'payment_ach.php'; include('elements/menu.php'); ?>
if ( isset($_POST['amount']) && $_POST['amount'] ) {
$payment_results = $freeside->process_payment(array(
'session_id' => $_COOKIE['session_id'],
'payby' => 'CHEK',
'amount' => $_POST['amount'],
'payinfo1' => $_POST['payinfo1'],
'payinfo2' => $_POST['payinfo2'],
'month' => 12,
'year' => 2037,
'payname' => $_POST['payname'],
'paytype' => $_POST['paytype'],
'paystate' => $_POST['paystate'],
'ss' => $_POST['ss'],
'stateid' => $_POST['stateid'],
'stateid_state' => $_POST['stateid_state'],
'save' => $_POST['save'],
'auto' => $_POST['auto'],
'paybatch' => $_POST['paybatch'],
//'discount_term' => $discount_term,
));
if ( $payment_results['error'] ) {
$payment_error = $payment_results['error'];
} else {
$receipt_html = $payment_results['receipt_html'];
}
}
if ( $receipt_html ) { ?>
Your payment was processed successfully. Thank you.
echo $receipt_html; ?>
} else {
$payment_info = $freeside->payment_info( array(
'session_id' => $_COOKIE['session_id'],
) );
if ( isset($payment_info['error']) && $payment_info['error'] ) {
$error = $payment_info['error'];
header('Location:index.php?error='. urlencode($error));
die();
}
extract($payment_info);
$error = $payment_error;
?>
include('elements/error.php'); ?>