diff --git a/booking.tokens.inc b/booking.tokens.inc index 059ba00..c03f0d0 100644 --- a/booking.tokens.inc +++ b/booking.tokens.inc @@ -436,7 +436,19 @@ function booking_token_info() { $info['tokens']['booking']['paypal-total-form'] = array( 'name' => t('Paypal Total Form Button'), 'description' => t('The paypal form for the total amount.') + ); + $info['tokens']['booking']['stripe-deposit-amount'] = array( + 'name' => t('Stripe Deposit Only'), + 'description' => t('The deposit amount required to confirm the registration including stripe fees.') ); + $info['tokens']['booking']['stripe-total-amount'] = array( + 'name' => t('Stripe Outstanding Balance'), + 'description' => t('The total amount required to complete the registration including stripe fees.') + ); + $info['tokens']['booking']['stripe-total-amount-intl'] = array( + 'name' => t('Stripe Outstanding Balance International'), + 'description' => t('The total amount required to complete the registration including international or amex stripe fees.') + ); $info['tokens']['booking']['stripe-deposit-form'] = array( 'name' => t('Stripe Deposit Form Button'), 'description' => t('The stripe popup form for the deposit amount.') @@ -566,6 +578,7 @@ function booking_define_personspecific_tokens($node) { global $event; $amount_paid = 0; + $payment_processor_type = variable_get('booking_payment_processor', 0); //get a count of the total number of people booked in to this event //but don't include people who haven't paid or have withdrawn their booking @@ -607,10 +620,21 @@ function booking_define_personspecific_tokens($node) $tokens['payment-transaction-desc'] = $node->nid . ' ' . $node->booking_lastname; $tokens['balance-payment-link'] = url('balance/' . $tempid, array('absolute' => TRUE)); $tokens['confirm-payment-link'] = url('confirm/' . $tempid, array('absolute' => TRUE)); - $tokens['paypal-total-amount'] = _booking_amount_owing($node, $amount_paid); - $tokens['paypal-deposit-amount'] = _booking_deposit_amount($node, TRUE); $tokens['regn-summary'] = _booking_details_email_summary($node); - + + //if payment processor is set to manual then don't populate these tokens + //if paypal is enabled + if ($payment_processor_type == 0) { + $tokens['paypal-deposit-amount'] = _booking_deposit_amount($node, TRUE); + $tokens['paypal-total-amount'] = _booking_amount_owing($node, $amount_paid); + } + //if stripe is enabled + elseif ($payment_processor_type == 1) { + $tokens['stripe-deposit-amount'] = _booking_deposit_amount($node, TRUE); + $tokens['stripe-total-amount'] = _booking_amount_owing($node, $amount_paid); + $tokens['stripe-total-intl'] = _booking_amount_owing($node, $amount_paid); + } + if (variable_get('booking_enable_travelform', 0) == 1) { $tokens['travel-link'] = url('travel/' . $tempid, array('absolute' => TRUE)); $tokens['travel-summary'] = _booking_travelform_email_summary($node);