1 <? $title ='Make A Payment'; include('elements/header.php'); ?>
2 <? $current_menu = 'payment_only_payment.php'; include('elements/payment_only_menu.php'); ?>
6 if ( isset($_POST['amount']) && $_POST['amount'] ) {
8 $payment_results = $freeside->payment_only_process_payment(array(
9 'session_id' => $_COOKIE['session_id'],
10 'payby' => $_POST['payby'],
11 'amount' => $_POST['amount'],
12 'paybatch' => $_POST['paybatch'],
13 //'discount_term' => $discount_term,
16 if ( $payment_results['error'] ) {
17 $error = $payment_results['error'];
19 $receipt_html = $payment_results['receipt_html'];
24 #echo print_r($payment_results);
26 if ( $receipt_html ) {
29 Your payment was processed successfully. Thank you.<BR><BR>
30 <? echo $receipt_html; ?>
34 $payment_info = $freeside->payment_only_payment_info( array(
35 'session_id' => $_COOKIE['session_id'],
38 if ( isset($payment_info['error']) && $payment_info['error'] ) {
39 $error = $payment_info['error'];
40 // possible to just keep on this page
41 header('Location:payment_only_error.php?error='. urlencode($error));
45 extract($payment_info);
47 $tr_amount_fee = $freeside->payment_only_mason_comp(array(
48 'session_id' => $_COOKIE['session_id'],
49 'comp' => '/elements/tr-amount_fee.html',
50 'args' => [ 'amount', $balance ],
52 //$tr_amount_fee = $tr_amount_fee->{'error'} || $tr_amount_fee->{'output'};
53 $tr_amount_fee = $tr_amount_fee['output'];
57 <? include('elements/error.php'); ?>
59 <SCRIPT TYPE="text/javascript">
61 function payby_changed(what) {
62 var amount = document.getElementById('amount');
63 var amountdue = document.getElementById('amountdue');
64 var surcharge_cell = document.getElementById('ajax_surcharge_cell');
65 var surcharge_percentage = document.getElementById('surcharge_percentage');
66 var surcharge_flatfee = document.getElementById('surcharge_flatfee');
67 if (what.value == "CHEK") {
68 surcharge_cell.style.display = 'none';
69 amount.value = amountdue.value;
72 else if (what.value == "CARD") {
73 surcharge_cell.style.display = 'inline';
74 amount.value = (+amountdue.value + (+amountdue.value * +surcharge_percentage.value) + +surcharge_flatfee.value).toFixed(2);
80 <FORM NAME="OneTrueForm" METHOD="POST" ACTION="payment_only_payment.php" onSubmit="document.OneTrueForm.process.disabled=true">
85 <TD ALIGN="right"><B>Payment account</B></TD>
87 <SELECT ID="payby" NAME="payby" onChange="payby_changed(this)">
89 <OPTION VALUE="CARD"><? echo $card_type ?> <? echo $card_mask ?></OPTION>
92 <OPTION VALUE="CHEK"><? echo $check_type ?> <? echo $check_mask ?></OPTION>
99 <TD ALIGN="right"><B>Amount Due</B></TD>
102 $<? echo sprintf("%.2f", $balance) ?>
103 <INPUT TYPE=hidden NAME="amountdue" ID="amountdue" VALUE="<? echo sprintf("%.2f", $balance) ?>" >
108 <? echo $tr_amount_fee; ?>
112 <INPUT TYPE="hidden" NAME="paybatch" VALUE="<? echo $paybatch ?>">
113 <INPUT TYPE="submit" NAME="process" VALUE="Process payment"> <!-- onClick="this.disabled=true"> -->
117 <? include('elements/menu_footer.php'); ?>
118 <? include('elements/footer.php'); ?>