$title ='Make A Payment'; include('elements/header.php'); ?>
$current_menu = 'payment_only_payment.php'; include('elements/payment_only_menu.php'); ?>
if ( isset($_POST['amount']) && $_POST['amount'] ) {
$payment_results = $freeside->payment_only_process_payment(array(
'session_id' => $_COOKIE['session_id'],
'payby' => $_POST['payby'],
'amount' => $_POST['amount'],
'paybatch' => $_POST['paybatch'],
//'discount_term' => $discount_term,
));
if ( $payment_results['error'] ) {
$error = $payment_results['error'];
} else {
$receipt_html = $payment_results['receipt_html'];
}
}
#echo print_r($payment_results);
if ( $receipt_html ) {
?>
Your payment was processed successfully. Thank you.
echo $receipt_html; ?>
} else {
$payment_info = $freeside->payment_only_payment_info( array(
'session_id' => $_COOKIE['session_id'],
) );
if ( isset($payment_info['error']) && $payment_info['error'] ) {
$error = $payment_info['error'];
// possible to just keep on this page
header('Location:payment_only_error.php?error='. urlencode($error));
die();
}
extract($payment_info);
$tr_amount_fee = $freeside->payment_only_mason_comp(array(
'session_id' => $_COOKIE['session_id'],
'comp' => '/elements/tr-amount_fee.html',
'args' => [ 'amount', $balance ],
));
//$tr_amount_fee = $tr_amount_fee->{'error'} || $tr_amount_fee->{'output'};
$tr_amount_fee = $tr_amount_fee['output'];
?>
include('elements/error.php'); ?>