diff --git a/booking.balance.inc b/booking.balance.inc index 55b7768..95589e2 100644 --- a/booking.balance.inc +++ b/booking.balance.inc @@ -1,14 +1,14 @@ 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 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', "
Balance page tokens:\n@info", 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; - }