tidy up balance page
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?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() {
|
function booking_balance_page() {
|
||||||
global $event;
|
global $event;
|
||||||
|
$payment_processor_type = variable_get('booking_payment_processor', 0);
|
||||||
$output = "";
|
$output = "";
|
||||||
$waiting_list = False;
|
$waiting_list = FALSE;
|
||||||
$already_paid = false;
|
$already_paid = FALSE;
|
||||||
$paypal_form = "";
|
$paypal_form = "";
|
||||||
|
|
||||||
//verify that arg(1) is a uuid
|
//verify that arg(1) is a uuid
|
||||||
@@ -44,16 +44,17 @@ function booking_balance_page() {
|
|||||||
|
|
||||||
//populate tokens and paypal form
|
//populate tokens and paypal form
|
||||||
$tokens = booking_define_personspecific_tokens($node);
|
$tokens = booking_define_personspecific_tokens($node);
|
||||||
// @todo - use admin variable booking_payment_processor to determine which of these to calculate
|
//if paypal is enabled
|
||||||
$tokens['paypal-total-form'] = _booking_paypal_form($node, $invoiceid, $tokens['paypal-total-amount'], "Pay Balance");
|
if ($payment_processor_type == 0) {
|
||||||
$tokens['stripe-total-form'] = _booking_stripe_form($node, $invoiceid, $tokens['payment-required'], "Pay Balance");
|
$tokens['paypal-total-form'] = _booking_paypal_form($node, $invoiceid, $tokens['paypal-total-amount'], "Pay Balance");
|
||||||
watchdog('booking_debug', "<pre>Balance page tokens:\n@info</pre>", array('@info' => print_r( $tokens, true)));
|
}
|
||||||
//Calculate the amount outstanding
|
//if stripe is enabled
|
||||||
//watchdog('booking', 'Booking Balance form calculating amount owing');
|
elseif ($payment_processor_type == 1) {
|
||||||
//$amount_owing = _booking_amount_owing($person->nid);
|
$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)));
|
||||||
|
|
||||||
//If the amount outstanding is zero, then display information to that effect.
|
//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) {
|
if ($tokens['payment-required'] == 0) {
|
||||||
$output = token_replace(variable_get('booking_regn_balance_page_paid'), $tokens);
|
$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('paragraph' => array('#type' => 'markup', '#markup' => $output));
|
||||||
//$return_array[] = array('form' => $paypal_form);
|
//$return_array[] = array('form' => $paypal_form);
|
||||||
|
|
||||||
//return the form
|
//return the page
|
||||||
return $return_array;
|
return $return_array;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user