You are here

function mollie_payment_requirements in Mollie Payment 7.2

Implements hook_requirements().

File

./mollie_payment.module, line 15
Provides Mollie integration for the Payment platform.

Code

function mollie_payment_requirements($phase) {
  $requirements = array();
  switch ($phase) {
    case 'runtime':

      // Load installer.
      $installer = mollie_payment_get_installer();

      // Check whether the Mollie API client for PHP is available.
      $check_client = $installer
        ->checkMollieApiClient();
      if ($check_client) {
        $requirements['mollie_payment_client'] = $check_client;
      }

      // Check whether an account for Mollie is set.
      $check_account = $installer
        ->checkMollieAccount();
      if ($check_account) {
        $requirements['mollie_payment_account'] = $check_account;
      }

      // Check whether an account for Mollie is set.
      $check_method = $installer
        ->checkMolliePaymentMethod();
      if ($check_method) {
        $requirements['mollie_payment_method'] = $check_method;
      }
      break;
    default:
      break;
  }
  return $requirements;
}