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'],
45 'payment_payby' => 'CARD',
48 if ( isset($payment_info['error']) && $payment_info['error'] ) {
49 $error = $payment_info['error'];
50 header('Location:index.php?error='. urlencode($error));
54 extract($payment_info);
56 $error = $payment_error;
58 $tr_amount_fee = $freeside->mason_comp(array(
59 'session_id' => $_COOKIE['session_id'],
60 'comp' => '/elements/tr-amount_fee.html',
61 'args' => [ 'amount', $balance ],
63 //$tr_amount_fee = $tr_amount_fee->{'error'} || $tr_amount_fee->{'output'};
64 $tr_amount_fee = $tr_amount_fee['output'];
68 <? include('elements/error.php'); ?>
70 <FORM NAME="OneTrueForm" METHOD="POST" ACTION="payment_cc.php" onSubmit="document.OneTrueForm.process.disabled=true">
74 <TD ALIGN="right">Amount Due</TD>
77 $<? echo sprintf("%.2f", $balance) ?>
82 <? echo $tr_amount_fee; ?>
84 <? //include('elements/discount_term.php') ?>
87 <TD ALIGN="right">Card type</TD>
89 <SELECT NAME="card_type"><OPTION></OPTION>
90 <? foreach ( $card_types AS $ct ) { ?>
91 <OPTION <? if ( $card_type == $ct ) { echo 'SELECTED'; } ?>
92 VALUE="<? echo $ct; ?>"><? echo $ct; ?>
98 <? include('elements/card.php'); ?>
102 <INPUT TYPE="checkbox" <? if ( ! $save_unchecked ) { echo 'CHECKED'; } ?> NAME="save" VALUE="1">
103 Remember this card and billing address
107 <INPUT TYPE="checkbox" <? if ( $payby == 'CARD' ) { echo ' CHECKED'; } ?> NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }">
108 Charge future payments to this card automatically
113 <INPUT TYPE="hidden" NAME="paybatch" VALUE="<? echo $paybatch ?>">
114 <INPUT TYPE="submit" NAME="process" VALUE="Process payment"> <!-- onClick="this.disabled=true"> -->
119 <? include('elements/menu_footer.php'); ?>
120 <? include('elements/footer.php'); ?>