lib/pagseguro/notification.rb in pagseguro-0.1.11.beta1 vs lib/pagseguro/notification.rb in pagseguro-0.1.11.beta2

- old
+ new

@@ -31,11 +31,12 @@ # PAYMENT_METHOD = { "Cartão de Crédito" => :credit_card, "Boleto" => :invoice, "Pagamento" => :pagseguro, - "Pagamento online" => :online_transfer + "Pagamento Online" => :online_transfer, + "Doação" => :donation } # The Rails params hash. # attr_accessor :params @@ -165,9 +166,17 @@ # def valid?(force=false) @valid = nil if force @valid = validates? if @valid.nil? @valid + end + + # Return all useful properties in a single hash. + # + def to_hash + MAPPING.inject({}) do |buffer, (name,value)| + buffer.merge(name => __send__(name)) + end end private def each_value(hash, &blk) # :nodoc: hash.each do |key, value|