1 <? $title ='Credit Card Payment'; include('elements/header.php'); ?>
2 <? $current_menu = 'payment_cc.php'; include('elements/menu.php'); ?>
5 if ( isset($_POST['amount']) && $_POST['amount'] ) {
7 $payment_results = $freeside->process_payment(array(
8 'session_id' => $_COOKIE['session_id'],
10 'amount' => $_POST['amount'],
11 'payinfo' => $_POST['payinfo'],
12 'paycvv' => $_POST['paycvv'],
13 'month' => $_POST['month'],
14 'year' => $_POST['year'],
15 'payname' => $_POST['payname'],
16 'address1' => $_POST['address1'],
17 'address2' => $_POST['address2'],
18 'city' => $_POST['city'],
19 'state' => $_POST['state'],
20 'zip' => $_POST['zip'],
21 'country' => $_POST['country'],
22 'save' => $_POST['save'],
23 'auto' => $_POST['auto'],
24 'paybatch' => $_POST['paybatch'],
25 //'discount_term' => $discount_term,
28 if ( $payment_results['error'] ) {
29 $payment_error = $payment_results['error'];
31 $receipt_html = $payment_results['receipt_html'];
36 if ( $receipt_html ) { ?>
38 Your payment was processed successfully. Thank you.<BR><BR>
39 <? echo $receipt_html; ?>
43 $payment_info = $freeside->payment_info( array(
44 'session_id' => $_COOKIE['session_id'],
47 if ( isset($payment_info['error']) && $payment_info['error'] ) {
48 $error = $payment_info['error'];
49 header('Location:index.php?error='. urlencode($error));
53 extract($payment_info);
55 $error = $payment_error;
57 $tr_amount_fee = $freeside->mason_comp(array(
58 'session_id' => $_COOKIE['session_id'],
59 'comp' => '/elements/tr-amount_fee.html',
60 'args' => [ 'amount', $balance ],
62 //$tr_amount_fee = $tr_amount_fee->{'error'} || $tr_amount_fee->{'output'};
63 $tr_amount_fee = $tr_amount_fee['output'];
67 <? include('elements/error.php'); ?>
69 <FORM NAME="OneTrueForm" METHOD="POST" ACTION="payment_cc.php" onSubmit="document.OneTrueForm.process.disabled=true">
73 <TD ALIGN="right">Amount Due</TD>
76 $<? echo sprintf("%.2f", $balance) ?>
81 <? echo $tr_amount_fee; ?>
83 <? //include('elements/discount_term.php') ?>
86 <TD ALIGN="right">Card type</TD>
88 <SELECT NAME="card_type"><OPTION></OPTION>
89 <? foreach ( $card_types AS $ct ) { ?>
90 <OPTION <? if ( $card_type == $card_types[$ct] ) { echo 'SELECTED'; } ?>
91 VALUE="<? echo $card_types[$ct]; ?>"><? echo $ct; ?>
97 <? include('elements/card.php'); ?>
101 <INPUT TYPE="checkbox" <? if ( ! $save_unchecked ) { echo 'CHECKED'; } ?> NAME="save" VALUE="1">
102 Remember this card and billing address
106 <INPUT TYPE="checkbox" <? if ( $payby == 'CARD' ) { echo ' CHECKED'; } ?> NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }">
107 Charge future payments to this card automatically
112 <INPUT TYPE="hidden" NAME="paybatch" VALUE="<? echo $paybatch ?>">
113 <INPUT TYPE="submit" NAME="process" VALUE="Process payment"> <!-- onClick="this.disabled=true"> -->
118 <? include('elements/menu_footer.php'); ?>
119 <? include('elements/footer.php'); ?>