Sha256: ecd6d1d8234c39be5697cc7ac2d4b4b57e0ccfdc07085c0e6b7eb4aa0548990d
Contents?: true
Size: 1.24 KB
Versions: 4
Compression:
Stored size: 1.24 KB
Contents
module Paypal module Payment class Response::Info < Base cattr_reader :attribute_mapping @@attribute_mapping = { :ACK => :ack, :CURRENCYCODE => :currency_code, :ERRORCODE => :error_code, :ORDERTIME => :order_time, :PAYMENTSTATUS => :payment_status, :PAYMENTTYPE => :payment_type, :PENDINGREASON => :pending_reason, :PROTECTIONELIGIBILITY => :protection_eligibility, :PROTECTIONELIGIBILITYTYPE => :protection_eligibility_type, :REASONCODE => :reason_code, :TRANSACTIONID => :transaction_id, :TRANSACTIONTYPE => :transaction_type } attr_accessor *@@attribute_mapping.values attr_accessor :amount def initialize(attributes = {}) attrs = attributes.dup @@attribute_mapping.each do |key, value| self.send "#{value}=", attrs.delete(key) end @amount = Response::Amount.new( :total => attrs.delete(:AMT), :fee => attrs.delete(:FEEAMT), :tax => attrs.delete(:TAXAMT) ) # warn ignored params attrs.each do |key, value| Paypal.log "Ignored Parameter (#{self.class}): #{key}=#{value}", :warn end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems