Sha256: ceab59d469e19da27db299b0e9ce03052864f310383a686a0c0f7ebb624f185e
Contents?: true
Size: 1.13 KB
Versions: 39
Compression:
Stored size: 1.13 KB
Contents
module Paypal module Payment class Response::Item < Base cattr_reader :attribute_mapping @@attribute_mapping = { :NAME => :name, :DESC => :description, :QTY => :quantity, :NUMBER => :number, :ITEMCATEGORY => :category, :ITEMWIDTHVALUE => :width, :ITEMHEIGHTVALUE => :height, :ITEMLENGTHVALUE => :length, :ITEMWEIGHTVALUE => :weight, :SHIPPINGAMT => :shipping, :HANDLINGAMT => :handling, :CURRENCYCODE => :currency } 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 @quantity = @quantity.to_i @amount = Common::Amount.new( :total => attrs.delete(:AMT), :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
39 entries across 39 versions & 4 rubygems