You are here

function uc_cybersource_hop_complete in Ubercart 7.3

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

Finalizes CyberSource transaction.

1 string reference to 'uc_cybersource_hop_complete'
uc_cybersource_menu in payment/uc_cybersource/uc_cybersource.module
Implements hook_menu().

File

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

Code

function uc_cybersource_hop_complete($order) {

  // If the order ID specified in the return URL is not the same as the one in
  // the user's session, we need to assume this is either a spoof or that the
  // user tried to adjust the order on this side while at PayPal. If it was a
  // legitimate checkout, the CyberSource POST will still register, so the
  // gets processed correctly. We'll leave an ambiguous message just in case.
  if (intval($_SESSION['cart_order']) != $order->order_id) {
    drupal_set_message(t('Thank you for your order! We will be notified by CyberSource that we have received your payment.'));
    drupal_goto('cart');
  }

  // This lets us know it's a legitimate access of the complete page.
  $_SESSION['uc_checkout'][$_SESSION['cart_order']]['do_complete'] = TRUE;
  drupal_goto('cart/checkout/complete');
}