You are here

function uc_cybersource_page_alter in Ubercart 7.3

Implements hook_page_alter().

File

payment/uc_cybersource/uc_cybersource.module, line 48
A module used for CyberSource's Silent Order POST and Hosted Order Page methods of payment.

Code

function uc_cybersource_page_alter(&$page) {
  $block = block_load('system', 'main');

  // Add to the review page hidden form fields with data to post to
  // CyberSource HOP.
  if (isset($page[$block->region]['system_main']['#theme']) && $page[$block->region]['system_main']['#theme'] == 'uc_cart_checkout_review' && ($order_id = intval($_SESSION['cart_order'])) > 0) {
    $order = uc_order_load($order_id);
    if ($order->payment_method == 'cybersource_hop') {
      $page[$block->region]['system_main']['#form'] = drupal_get_form('uc_cybersource_hop_form', $order);
    }
  }
}