You are here

function payment_page_method_enable_disable in Payment 7

Toggle a payment method's enabled status.

Parameters

string $operation: Either 'enable' or 'disable'.

PaymentMethod $payment_method:

Return value

NULL

1 string reference to 'payment_page_method_enable_disable'
payment_menu in ./payment.module
Implements hook_menu().

File

./payment.ui.inc, line 612
The Payment user interface.

Code

function payment_page_method_enable_disable($operation, PaymentMethod $payment_method) {
  switch ($operation) {
    case 'enable':
      $payment_method->enabled = TRUE;
      break;
    case 'disable':
      $payment_method->enabled = FALSE;
      break;
  }
  entity_save('payment_method', $payment_method);
  drupal_goto('admin/config/services/payment/method');
}