You are here

function commerce_payment_ui_add_payment_rule_form_submit in Commerce Core 7

Submit callback for commerce_payment_ui_form_commerce_payment_ui_add_payment_rule_form_alter().

1 string reference to 'commerce_payment_ui_add_payment_rule_form_submit'
commerce_payment_ui_form_commerce_payment_ui_add_payment_rule_form_alter in modules/payment/commerce_payment_ui.module
Implements hook_form_FORM_ID_alter().

File

modules/payment/commerce_payment_ui.module, line 253
Default Payment UI for Drupal Commerce.

Code

function commerce_payment_ui_add_payment_rule_form_submit($form, &$form_state) {

  // Enable the selected payment method on the Rule.
  $method_id = $form_state['values']['method_id'];
  $form_state['rules_config']
    ->action('commerce_payment_enable_' . $method_id, array(
    'commerce_order:select' => 'commerce-order',
    'payment_method' => $method_id,
  ));
}