You are here

function _uc_stripe_payment_pane_callback in Ubercart Stripe 7.3

Implements uc_checkout_pane_callback() specified in 'callback' of uc_stripe_uc_checkout_pane()

Provides empty pane for stripe elements to be added

_state

Parameters

$op:

$order:

$form:

Return value

array

1 string reference to '_uc_stripe_payment_pane_callback'
uc_stripe_uc_checkout_pane in ./uc_stripe.module
Implements hook_uc_checkout_pane to add checkout pane for stripe payment details

File

./uc_stripe.module, line 334
A stripe.js PCI-compliant payment gateway Forked from Bitcookie's work (thanks!) which was posted at http://bitcookie.com/blog/pci-compliant-ubercart-and-stripe-js from discussion in the uc_stripe issue queue, https://www.drupal.org/node/1467886

Code

function _uc_stripe_payment_pane_callback($op, $order, $form = NULL, &$form_state = NULL) {

  // Create separate payment pane for stripe because the normal payment pane is refreshed many times
  // by ajax, by country changes, etc.. Refreshing the payment section triggers Stripe Api's security feature
  // and destroys the Stripe Element in the DOM.
  // Emtpy values needed so that pane still appears.
  switch ($op) {
    case 'view':
      $description = t('');
      $contents['stripe_card_element'] = array(
        '#markup' => '',
      );
      return array(
        'description' => $description,
        'contents' => $contents,
      );
  }
}