You are here

function payment_rules_condition_payment_method_supports_currencies in Payment 7

Implements Rules condition callback: check whether a payment method supports a currency.

Parameters

PaymentMethod $payment_method: The payment method to check the condition for.

array $currency_codes: The ISO 4217 currency codes to check for.

Return value

boolean

1 call to payment_rules_condition_payment_method_supports_currencies()
payment_rules_condition_payment_method_controller_supports_currency in ./payment.rules.inc
Implements Rules condition callback: check whether a payment method controller supports a currency.

File

./payment.rules.inc, line 569
Rules integration.

Code

function payment_rules_condition_payment_method_supports_currencies(PaymentMethod $payment_method, array $currency_codes) {
  return empty($payment_method->controller->currencies) || (bool) array_intersect($currency_codes, array_keys($payment_method->controller->currencies));
}