You are here

function uc_store_encryption_errors in Ubercart 8.4

Same name and namespace in other branches
  1. 5 uc_store/uc_store.module \uc_store_encryption_errors()
  2. 6.2 uc_store/uc_store.module \uc_store_encryption_errors()
  3. 7.3 uc_store/uc_store.module \uc_store_encryption_errors()

Logs encryption errors to watchdog.

Parameters

$crypt: The object used to perform your encryption/decryption.

$module: The module name to specify in the watchdog notices.

4 calls to uc_store_encryption_errors()
AuthorizeNet::buildConfigurationForm in payment/uc_authorizenet/src/Plugin/Ubercart/PaymentMethod/AuthorizeNet.php
Form constructor.
AuthorizeNet::submitConfigurationForm in payment/uc_authorizenet/src/Plugin/Ubercart/PaymentMethod/AuthorizeNet.php
Form submission handler.
CreditCardPaymentMethodBase::cartProcess in payment/uc_credit/src/CreditCardPaymentMethodBase.php
Called when checkout is submitted with this payment method selected.
CreditCardPaymentMethodBase::orderSave in payment/uc_credit/src/CreditCardPaymentMethodBase.php
Called when an order is being saved with this payment method.

File

uc_store/uc_store.module, line 716
Contains global Ubercart functions and store administration functionality.

Code

function uc_store_encryption_errors(&$crypt, $module) {
  $errors = $crypt
    ->getErrors();
  if (!empty($errors)) {
    foreach ($errors as $message) {
      $items[] = $message;
    }
    \Drupal::logger('encryption')
      ->error('Encryption failed.');

    // @todo Fix formatting of logger message.

    //\Drupal::logger('encryption')->error('Encryption failed. @messages', ['@messages' => drupal_render(['#theme' => 'item_list', '#items' => $items])]);
  }
}