You are here

function uc_payment_token_values in Ubercart 5

Same name and namespace in other branches
  1. 6.2 payment/uc_payment/uc_payment.module \uc_payment_token_values()

Implementation of hook_token_values().

File

payment/uc_payment/uc_payment.module, line 151

Code

function uc_payment_token_values($type, $object = NULL) {
  switch ($type) {
    case 'order':
      $order = $object;
      $values['order-payment-method'] = _payment_method_data($order->payment_method, 'review');
      if (empty($values['order-payment-method'])) {
        $values['order-payment-method'] = _payment_method_data($order->payment_method, 'name');
      }
      $values['order-payment-balance'] = uc_currency_format(uc_payment_balance($order));
      break;
  }
  return $values;
}