diff --git a/booking.balance.inc b/booking.balance.inc index 5e69693..55b7768 100644 --- a/booking.balance.inc +++ b/booking.balance.inc @@ -47,22 +47,22 @@ function booking_balance_page() { // @todo - use admin variable booking_payment_processor to determine which of these to calculate $tokens['paypal-total-form'] = _booking_paypal_form($node, $invoiceid, $tokens['paypal-total-amount'], "Pay Balance"); $tokens['stripe-total-form'] = _booking_stripe_form($node, $invoiceid, $tokens['payment-required'], "Pay Balance"); - + watchdog('booking_debug', "
Balance page tokens:\n@info
", 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); //If the amount outstanding is zero, then display information to that effect. - if ($tokens['paypal-total-amount'] == 0) - { + //@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); } - else - { + else { $output = token_replace(variable_get('booking_regn_balance_page'), $tokens); //optional additional text for married people - if ($node->booking_married == 'Y') + if ($node->booking_married == 'Y') { $output .= token_replace(variable_get('booking_regn_balance_married_text'), $tokens); + } } //put all the bits together