You are here

function mollie_payment_update_7102 in Mollie Payment 7.2

Same name and namespace in other branches
  1. 7 mollie_payment.install \mollie_payment_update_7102()

Rename mollie_id to mollie_api_key.

File

./mollie_payment.install, line 82
Install and update hooks for Mollie Payment.

Code

function mollie_payment_update_7102() {
  $records = db_select('mollie_payment_payment_method_configurations', 'c')
    ->fields('c', array(
    'pmid',
    'configuration',
  ))
    ->execute()
    ->fetchAllKeyed();
  foreach ($records as $pmid => $configuration) {
    $config = unserialize($configuration);
    $config['mollie_api_key'] = $config['mollie_id'];
    unset($config['mollie_id']);
    mollie_payment_payment_method_configuration_save($pmid, $config);
  }
  variable_del('mollie_payment_test_message');
}