lib/payments/payment_new.rb in paytureman-0.7.0 vs lib/payments/payment_new.rb in paytureman-1.0.0
- old
+ new
@@ -1,12 +1,23 @@
module Paytureman
- class PaymentDescription < Struct.new(:product, :total, :template_tag, :language)
+ VALID_OPTIONS = [
+ :template_tag,
+ :language,
+ :url,
+ :total,
+ :product
+ ]
- def to_h
- super.select { |_, v| v.present? }
+ class PaymentDescription
+ def initialize(description = {})
+ @description = description.dup
+ @description.assert_valid_keys(*VALID_OPTIONS)
end
+ def to_h
+ @description.select { |_, v| v.present? }
+ end
end
class PaymentNew < Payment
def initialize(order_id, amount, ip, gateway = nil)