You are here

function commerce_payment_rules_compare_selected_payment_method in Commerce Core 7

Condition callback: compares the selected payment method for an order.

1 string reference to 'commerce_payment_rules_compare_selected_payment_method'
commerce_payment_rules_condition_info in modules/payment/commerce_payment.rules.inc
Implements hook_rules_condition_info().

File

modules/payment/commerce_payment.rules.inc, line 142
Rules integration for payments.

Code

function commerce_payment_rules_compare_selected_payment_method($order, $method_id) {
  if (!empty($order->data['payment_method'])) {
    list($selected_method_id, ) = explode('|', $order->data['payment_method']);
  }
  else {
    $selected_method_id = '-none-';
  }
  return $method_id == $selected_method_id;
}