private static function filterCountry($paymentMethods, $country)
    {
        $output = array();
        foreach ($paymentMethods as $paymentMethod) {
            if (in_array($country, $paymentMethod['countries'], true)
              || in_array('ALL', $paymentMethod['countries'], true)
            ) {
                $output[] = $paymentMethod;
            }
        }
        return $output;
    }
private static function filterCountry($paymentMethods, $country)
    {
        $output = array();
        foreach ($paymentMethods as $paymentMethod) {
            if (in_array($country, $paymentMethod['countries'], true)
              || in_array('ALL', $paymentMethod['countries'], true)
            ) {
                $output[] = $paymentMethod;
            }
        }
        return $output;
    }
private static function filterCountry ( $ paymentMethods , $ country ) { $ output = array ( ) ; foreach ( $ paymentMethods as $ paymentMethod ) { if ( in_array ( $ country , $ paymentMethod [ 'countries' ] , true ) || in_array ( 'ALL' , $ paymentMethod [ 'countries' ] , true ) ) { $ output [ ] = $ paymentMethod ; } } return $ output ; }
Filter the result to only return payment methods allowed for a country

@param array $paymentMethods
@param string $country
@return array filtered paymentmethods
Filter the result to only return payment methods allowed for a country