tidy up balance page

This commit is contained in:
Nathan Coad
2016-07-22 16:09:23 +10:00
parent 2cbfda6cf7
commit 69bae12146

View File

@@ -1,14 +1,14 @@
<?php
// $Id: booking.confirm.inc,v 0.1 2011/07/12
/**
* Confirmation page for event registration
* Balance payment page for event registration
*/
function booking_balance_page() {
global $event;
$payment_processor_type = variable_get('booking_payment_processor', 0);
$output = "";
$waiting_list = False;
$already_paid = false;
$waiting_list = FALSE;
$already_paid = FALSE;
$paypal_form = "";
//verify that arg(1) is a uuid
@@ -44,16 +44,17 @@ function booking_balance_page() {
//populate tokens and paypal form
$tokens = booking_define_personspecific_tokens($node);
// @todo - use admin variable booking_payment_processor to determine which of these to calculate
//if paypal is enabled
if ($payment_processor_type == 0) {
$tokens['paypal-total-form'] = _booking_paypal_form($node, $invoiceid, $tokens['paypal-total-amount'], "Pay Balance");
}
//if stripe is enabled
elseif ($payment_processor_type == 1) {
$tokens['stripe-total-form'] = _booking_stripe_form($node, $invoiceid, $tokens['payment-required'], "Pay Balance");
watchdog('booking_debug', "<pre>Balance page tokens:\n@info</pre>", array('@info' => print_r( $tokens, true)));
//Calculate the amount outstanding
//watchdog('booking', 'Booking Balance form calculating amount owing');
//$amount_owing = _booking_amount_owing($person->nid);
}
//watchdog('booking_debug', "<pre>Balance page tokens:\n@info</pre>", array('@info' => print_r( $tokens, true)));
//If the amount outstanding is zero, then display information to that effect.
//@todo don't rely on the paypal token in case stripe is being used
if ($tokens['payment-required'] == 0) {
$output = token_replace(variable_get('booking_regn_balance_page_paid'), $tokens);
}
@@ -69,7 +70,6 @@ function booking_balance_page() {
$return_array[] = array('paragraph' => array('#type' => 'markup', '#markup' => $output));
//$return_array[] = array('form' => $paypal_form);
//return the form
//return the page
return $return_array;
}