def parse
      return unless valid?

      type = @doc.xpath("//tiponotificacion").text

      operations = @doc.xpath("//operacion").inject([]) do |result, operation|
        result << [operation.xpath('tipo').text, operation.xpath('id').text]
        result
      end

      notification = Notification.new(type, operations)

      notification
    end
def parse
      return unless valid?

      type = @doc.xpath("//tiponotificacion").text

      operations = @doc.xpath("//operacion").inject([]) do |result, operation|
        result << [operation.xpath('tipo').text, operation.xpath('id').text]
        result
      end

      notification = Notification.new(type, operations)

      notification
    end
@param [String] XML file containing DM IPNv2 operations.
 @param [Hash] a Hash of optional parameters.
 Parses the XML notification POSTed by DineroMail IPNv2
 notification system.

 @return [DineroMailIpn::Notification] a parsed Notification