protected function cullForGateway(&$fields, $defaults = array())
    {
        if (!$this->gateway) {
            return;
        }

        $selected = array_merge($defaults, GatewayInfo::requiredFields($this->gateway));
        foreach ($fields as $name => $field) {
            if (!in_array($name, $selected)) {
                unset($fields[$name]);
            }
        }
    }
protected function cullForGateway(&$fields, $defaults = array())
    {
        if (!$this->gateway) {
            return;
        }

        $selected = array_merge($defaults, GatewayInfo::requiredFields($this->gateway));
        foreach ($fields as $name => $field) {
            if (!in_array($name, $selected)) {
                unset($fields[$name]);
            }
        }
    }
protected function cullForGateway ( & $ fields , $ defaults = array ( ) ) { if ( ! $ this -> gateway ) { return ; } $ selected = array_merge ( $ defaults , GatewayInfo :: requiredFields ( $ this -> gateway ) ) ; foreach ( $ fields as $ name => $ field ) { if ( ! in_array ( $ name , $ selected ) ) { unset ( $ fields [ $ name ] ) ; } } }
Clear all fields that are not required by the gateway. Does nothing if gateway is null
@param $fields
@param array $defaults
Clear all fields that are not required by the gateway . Does nothing if gateway is null