lib/dineromail/notification.rb in dineromail-0.1.2 vs lib/dineromail/notification.rb in dineromail-0.1.3

- old
+ new

@@ -1,13 +1,13 @@ require 'happymapper' module Dineromail class Notification include HappyMapper - tag 'OPERACION' - element :transaction_id, Integer, :tag => 'ID' - element :type, String, :tag => 'TIPO' + tag 'operacion' + element :transaction_id, Integer, :tag => 'id' + element :type, String, :tag => 'tipo' def initialize(options = {}) @options = options.symbolize_keys end @@ -24,9 +24,15 @@ def method_missing(symbol, *args) unless status_report.operations.empty? status_report.operations.first.send(symbol, *args) end + end + + def self.parse(xml) + #Convert tags to lowercase + xml = xml.gsub(/<(.*?)[> ]/){|tag| tag.downcase} + super(xml) end end end \ No newline at end of file