You are here

function _stripe_requirement_check in Stripe 7

Helper function to hook_requirements.

1 call to _stripe_requirement_check()
stripe_requirements in ./stripe.install
Implements hook_requirements().

File

./stripe.install, line 21
Install, update and uninstall functions for the Stripe module.

Code

function _stripe_requirement_check() {
  $t = get_t();
  if (($library = libraries_detect('stripe-php')) && !empty($library['installed'])) {
    return array(
      'title' => $t('Stripe Payment API PHP Library'),
      'value' => $t('Stripe PHP Library is in place. Version @version', array(
        '@version' => $library['version'],
      )),
      'severity' => REQUIREMENT_OK,
    );
  }
  else {
    return array(
      'title' => $t('Stripe Payment API PHP Library'),
      'value' => $t('The Stripe PHP Library is not in place. <a href="https://code.stripe.com/stripe-php-latest.zip">Download and unzip the library</a> then place the contents of that directory in sites/all/libraries/stripe-php'),
      'severity' => REQUIREMENT_ERROR,
    );
  }
}