Module: Opay::Payable
- Extended by:
- ActiveModel::Callbacks, ActiveSupport::Concern
- Defined in:
- lib/opay/payable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#finish ⇒ Object
15 16 17 18 19 |
# File 'lib/opay/payable.rb', line 15 def finish run_callbacks :payment do payment.update_attribute(:finished, true) end end |
#finished? ⇒ Boolean
11 12 13 |
# File 'lib/opay/payable.rb', line 11 def finished? payment.present? && payment.finished? end |
#payment_session_id ⇒ Object
21 22 23 24 |
# File 'lib/opay/payable.rb', line 21 def payment_session_id raise 'Resource must be saved before payment' if id.nil? Digest::MD5.hexdigest(self.class.name + id.to_s) end |