Class: Vpago::Payway::PaymentStatusMarker

Inherits:
Object
  • Object
show all
Defined in:
lib/vpago/payway/payment_status_marker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payment, options = {}) ⇒ PaymentStatusMarker

:status, :description, :updated_by_user_id, updated_reason



7
8
9
10
11
12
# File 'lib/vpago/payway/payment_status_marker.rb', line 7

def initialize(payment, options = {})
  @payment = payment
  @options = options

  @options[:status] = @options[:status] || false
end

Instance Attribute Details

#error_messageObject

Returns the value of attribute error_message.



4
5
6
# File 'lib/vpago/payway/payment_status_marker.rb', line 4

def error_message
  @error_message
end

#paymentObject

Returns the value of attribute payment.



4
5
6
# File 'lib/vpago/payway/payment_status_marker.rb', line 4

def payment
  @payment
end

Instance Method Details

#callObject



14
15
16
17
18
19
# File 'lib/vpago/payway/payment_status_marker.rb', line 14

def call
  ActiveRecord::Base.transaction do
    update_payment_source
    update_payment_and_order
  end
end