You are here

function pay_method_gateway::payment_types in Pay 7

Same name and namespace in other branches
  1. 6 includes/handlers/pay_method_gateway.inc \pay_method_gateway::payment_types()
2 calls to pay_method_gateway::payment_types()
pay_method_gateway::form in includes/handlers/pay_method_gateway.inc
pay_method_gateway::settings_form in includes/handlers/pay_method_gateway.inc

File

includes/handlers/pay_method_gateway.inc, line 361
The base class for credit card payment activities.

Class

pay_method_gateway
@file The base class for credit card payment activities.

Code

function payment_types($filter = NULL) {
  $payment_types = array();
  if ($this->gateway_supports_cc) {
    $payment_types = array(
      'visa' => t('Visa'),
      'mc' => t('Mastercard'),
      'amex' => t('American Express'),
      'discover' => t('Discover'),
      'diners' => t("Diner's Club"),
      'laser' => t('Laser'),
      'maestro' => t('Maestro'),
      'switch' => t('Switch'),
      'solo' => t('Solo'),
    );
  }
  if ($this->gateway_supports_ach) {

    // TODO this is a stub. We need to build the echeck form and validation
    // functions for this to be relevant. Thus it's commented out for now.

    //$payment_types['ach'] = t('Online checking transfer.');
  }
  if ($filter) {
    foreach ($payment_types as $key => $label) {
      if (!$filter[$key]) {
        unset($payment_types[$key]);
      }
    }
  }
  return $payment_types;
}