You are here

function commerce_no_payment_update_7202 in Commerce No Payment 7.2

Updates Commerce Payment transactions to use the new Commerce Payment payment method.

1 call to commerce_no_payment_update_7202()
CommerceNoPaymentUpgrade::testUpgrade in tests/CommerceNoPaymentUpgrade.test
Tests the upgrade process.

File

./commerce_no_payment.install, line 130
Installation and uninstallation functions.

Code

function commerce_no_payment_update_7202(&$sandbox) {
  $pmid = variable_get('commerce_no_payment_2_migration_pmid');
  db_update('commerce_payment_transaction')
    ->condition('payment_method', 'commerce_no_payment')
    ->condition('instance_id', 'commerce_no_payment|commerce_payment_commerce_no_payment')
    ->fields(array(
    'instance_id' => 'payment_commerce_' . $pmid . '|commerce_payment_payment_commerce_' . $pmid,
    'payment_method' => 'payment_commerce_' . $pmid,
  ))
    ->execute();
}