Class: Paytureman::PaymentWithSession

Inherits:
Payment
  • Object
show all
Defined in:
lib/payments/payment_with_session.rb

Instance Attribute Summary

Attributes inherited from Payment

#gateway, #order_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Payment

#current, new_from_payment

Constructor Details

#initialize(order_id, amount, session_id, gateway = nil) ⇒ PaymentWithSession

Returns a new instance of PaymentWithSession.



5
6
7
8
# File 'lib/payments/payment_with_session.rb', line 5

def initialize(order_id, amount, session_id, gateway = nil)
  super(order_id, amount, gateway)
  @session_id = session_id
end

Class Method Details

.new_from_memento(memento) ⇒ Object



15
16
17
# File 'lib/payments/payment_with_session.rb', line 15

def self.new_from_memento(memento)
  new(memento.order_id, memento.amount, memento.session_id, memento.gateway)
end

Instance Method Details

#save_to_memento(memento) ⇒ Object



10
11
12
13
# File 'lib/payments/payment_with_session.rb', line 10

def save_to_memento(memento)
  memento.session_id = session_id
  super(memento)
end