more stripe specific tokens

This commit is contained in:
Nathan Coad
2016-07-22 15:46:03 +10:00
parent 04396cda56
commit 87247d87f4

View File

@@ -437,6 +437,18 @@ function booking_token_info() {
'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);