You are here

function uc_stripe_form_uc_cart_checkout_form_alter in Ubercart Stripe 7

Same name and namespace in other branches
  1. 8.3 uc_stripe.module \uc_stripe_form_uc_cart_checkout_form_alter()
  2. 8.2 uc_stripe.module \uc_stripe_form_uc_cart_checkout_form_alter()
  3. 6.2 uc_stripe.module \uc_stripe_form_uc_cart_checkout_form_alter()
  4. 6 uc_stripe.module \uc_stripe_form_uc_cart_checkout_form_alter()
  5. 7.3 uc_stripe.module \uc_stripe_form_uc_cart_checkout_form_alter()
  6. 7.2 uc_stripe.module \uc_stripe_form_uc_cart_checkout_form_alter()

Implements hook_form_FORM_ID_alter().

File

./uc_stripe.module, line 73
A module used for processing payments with Stripe.

Code

function uc_stripe_form_uc_cart_checkout_form_alter(&$form, &$form_state) {

  // If testmode is enabled, display a message on checkout.
  if (uc_credit_default_gateway() == 'uc_stripe') {
    if (variable_get('uc_stripe_testmode', TRUE)) {
      $form['panes']['testmode'] = array(
        '#prefix' => "<div class='messages' style='background-color:#BEEBBF'>",
        '#type' => 'markup',
        '#value' => t("Test mode is <strong>ON</strong> for the Stripe Payment Gateway. Your credit card will not be charged. To change this setting, edit the !link", array(
          '!link' => l("Stripe settings", "admin/store/settings/payment/edit/gateways"),
        )),
        '#suffix' => "</div>",
      );
    }
    if (variable_get('uc_stripe_poweredby', FALSE)) {
      drupal_add_css(drupal_get_path('module', 'uc_stripe') . '/css/uc_stripe.css');
      $form['panes']['payment']['poweredbystripe'] = array(
        '#prefix' => "<a href='https://stripe.com' target='_blank' class='poweredbylink'><div class='poweredbystripe'>",
        '#type' => 'markup',
        '#value' => t("powered by"),
        '#suffix' => " " . theme('image', drupal_get_path('module', 'uc_stripe') . '/images/logo_bare.png', 'powered by Stripe', 'powered by Stripe') . "</div></a>",
      );
    }
  }
}