public function paymentMethod(array $values)
    {
        $existing = array_filter($values, function ($method_id) {
            return (bool) $this->payment->get($method_id);
        });

        if (count($values) != count($existing)) {
            return $this->translation->text('@name is unavailable', array(
                '@name' => $this->translation->text('Payment')));
        }

        return true;
    }
public function paymentMethod(array $values)
    {
        $existing = array_filter($values, function ($method_id) {
            return (bool) $this->payment->get($method_id);
        });

        if (count($values) != count($existing)) {
            return $this->translation->text('@name is unavailable', array(
                '@name' => $this->translation->text('Payment')));
        }

        return true;
    }
public function paymentMethod ( array $ values ) { $ existing = array_filter ( $ values , function ( $ method_id ) { return ( bool ) $ this -> payment -> get ( $ method_id ) ; } ) ; if ( count ( $ values ) != count ( $ existing ) ) { return $ this -> translation -> text ( '@name is unavailable' , array ( '@name' => $ this -> translation -> text ( 'Payment' ) ) ) ; } return true ; }
Validates the payment method condition
@param array $values
@return boolean|string
Validates the payment method condition