You are here

function uc_cybersource_hop_include in Ubercart 7.3

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

Checks for HOP.php and includes it or returns FALSE if it cannot be found.

5 calls to uc_cybersource_hop_include()
uc_cybersource_hop_form in payment/uc_cybersource/uc_cybersource.module
Defines values to be posted to CyberSource.
uc_cybersource_hop_post in payment/uc_cybersource/uc_cybersource.module
Processes a payment POST from the CyberSource Hosted Order Page API.
uc_cybersource_requirements in payment/uc_cybersource/uc_cybersource.install
Implements hook_requirements().
uc_cybersource_settings_form in payment/uc_cybersource/uc_cybersource.module
Adds the CyberSource fields to the payment gateway settings form.
_uc_cybersource_post_charge in payment/uc_cybersource/uc_cybersource.module
POSTs transaction to CyberSource.

File

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

Code

function uc_cybersource_hop_include() {
  $hop_paths[0] = 'sites/all/libraries/uc_cybersource/HOP.php';
  $hop_paths[1] = drupal_get_path('module', 'uc_cybersource') . '/HOP.php';

  // Loop through possible paths, include and return TRUE when HOP.php is
  // located.
  foreach ($hop_paths as $key => $path) {
    if (file_exists($path)) {
      require_once $path;
      return TRUE;
    }
  }

  // We didn't find HOP.php in any of the possible paths.
  return FALSE;
}