summaryrefslogtreecommitdiff
path: root/ng_selfservice/payment_paypal.php
blob: feb852dec95f3e414316098dcb90e9f24545803b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<? $title ='PayPal Payment'; include('elements/header.php'); ?>
<? $current_menu = 'payment_paypal.php'; include('elements/menu.php'); ?>
<?
if ( isset($_POST['amount']) && $_POST['amount'] ) {

  $payment_results = $freeside->start_thirdparty(array(
    'session_id'  => $_COOKIE['session_id'],
    'method'      => 'PAYPAL',
    'amount'      => $_POST['amount'],
  ));

  include('elements/post_thirdparty.php');

} else {

  $payment_info = $freeside->payment_info( array(
    'session_id' => $_COOKIE['session_id'],
  ) );

  $tr_amount_fee = $freeside->mason_comp(array(
    'session_id'  => $_COOKIE['session_id'],
    'comp'        => '/elements/tr-amount_fee.html',
    'args'        => [ 'amount', $payment_info['balance'] ],
  ));
  $tr_amount_fee = $tr_amount_fee['output'];

  include('elements/error.php'); ?>
<FORM NAME="OneTrueForm" METHOD="POST" ACTION="payment_paypal.php">
  <TABLE>
  <TR>
    <TD ALIGN="right">Amount&nbsp;Due</TD>
    <TD>$<? echo sprintf('%.2f', $payment_info['balance']); ?></TD>
  </TR>
  <? echo $tr_amount_fee; ?>
  </TABLE>
  <BR>
  <INPUT TYPE="submit" NAME="process" VALUE="Start payment">
</FORM>
<? } ?>
<? include('elements/menu_footer.php'); ?>
<? include('elements/footer.php'); ?>