def validate_payment_transaction(payment_transaction)
      validate_query_config payment_transaction

      error_message   = ''
      missed_fields   = []
      invalid_fields  = []

      request_fields_definition.each do |field_name, property_path, is_field_required, validation_rule|
        field_value = PropertyAccessor.get_value payment_transaction, property_path, false

        if field_value
          begin
            Validator.validate_by_rule field_value, validation_rule
          rescue ValidationError => error
            invalid_fields << "Field '#{field_name}' from property path '#{property_path}', #{error.message}."
          end
        elsif is_field_required
          missed_fields << "Field '#{field_name}' from property path '#{property_path}' missed or empty."
        end
      end

      unless missed_fields.empty?
        error_message << "Some required fields missed or empty in PaymentTransaction: \n#{missed_fields.join "\n"}\n"
      end

      unless invalid_fields.empty?
        error_message << "Some fields invalid in PaymentTransaction: \n#{invalid_fields.join "\n"}\n"
      end

      unless error_message.empty?
        raise ValidationError, error_message
      end
    end
def validate_payment_transaction(payment_transaction)
      validate_query_config payment_transaction

      error_message   = ''
      missed_fields   = []
      invalid_fields  = []

      request_fields_definition.each do |field_name, property_path, is_field_required, validation_rule|
        field_value = PropertyAccessor.get_value payment_transaction, property_path, false

        if field_value
          begin
            Validator.validate_by_rule field_value, validation_rule
          rescue ValidationError => error
            invalid_fields << "Field '#{field_name}' from property path '#{property_path}', #{error.message}."
          end
        elsif is_field_required
          missed_fields << "Field '#{field_name}' from property path '#{property_path}' missed or empty."
        end
      end

      unless missed_fields.empty?
        error_message << "Some required fields missed or empty in PaymentTransaction: \n#{missed_fields.join "\n"}\n"
      end

      unless invalid_fields.empty?
        error_message << "Some fields invalid in PaymentTransaction: \n#{invalid_fields.join "\n"}\n"
      end

      unless error_message.empty?
        raise ValidationError, error_message
      end
    end
Validates payment transaction before request constructing

 @param    payment_transaction   [PaymentTransaction]    Payment transaction for validation