'); return ""; } //TODO: if the person says they're married, query to see if they're listed partner has already registered and paid //if they have, then let the new registration person know their partner has already paid, and send them the confirmation email //work out the node id from the session id $query = db_select('booking_person', 'p'); $db_and = db_and()->condition('p.booking_eventid', $event->eid, '=') ->condition('p.booking_tempid', arg(1), '='); $query->condition($db_and); $query->fields('p', array('nid')); $person = $query->execute() ->fetchObject(); /* $query = db_select('booking_person', 'p'); $query->condition('p.booking_tempid', arg(1), '=') ->fields('p', array('nid')); $person = $query->execute() ->fetchObject(); */ if ($person) { //load all the fields $node = node_load($person->nid); //calculate the invoice ID $invoiceid = $person->nid . '_bal' . REQUEST_TIME . '_' . $node->booking_lastname . '-' . $node->booking_firstname; //maximum length for invoice id in paypal is 127 characters so truncate if necessary $invoiceid = substr($invoiceid, 0, 126); } else { watchdog('booking', "
Unmatched token supplied to the balance payment page:\n@info", array( '@info' => print_r(arg(1), true) )); drupal_set_message("Error: Invalid token supplied to the balance payment page. Please use the contact us form to let us know.", 'error', FALSE); drupal_goto('
Balance page tokens:\n@info", array('@info' => print_r( $tokens, true))); //If the amount outstanding is zero, then display information to that effect. if ($tokens['payment-required'] == 0) { $output = token_replace(variable_get('booking_regn_balance_page_paid'), $tokens); } else { $output = token_replace(variable_get('booking_regn_balance_page'), $tokens); //optional additional text for married people if ($node->booking_married == 'Y') { $output .= token_replace(variable_get('booking_regn_balance_married_text'), $tokens); } } //put all the bits together $return_array[] = array('paragraph' => array('#type' => 'markup', '#markup' => $output)); //$return_array[] = array('form' => $paypal_form); //return the page return $return_array; }