Class: Vpago::Payway::PaymentRequestUpdater

Inherits:
Vpago::PaymentRequestUpdater show all
Defined in:
lib/vpago/payway/payment_request_updater.rb

Instance Attribute Summary

Attributes inherited from Vpago::PaymentRequestUpdater

#error_message, #payment

Instance Method Summary collapse

Methods inherited from Vpago::PaymentRequestUpdater

#ignore_on_failed?, #initialize, #success?

Constructor Details

This class inherits a constructor from Vpago::PaymentRequestUpdater

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/vpago/payway/payment_request_updater.rb', line 4

def call
  checker = check_payway_status

  if checker.success?
    @error_message = nil

    marker_options = @options.merge(status: true, description: nil)
    marker = ::Vpago::Payway::PaymentStatusMarker.new(@payment, marker_options)
    marker.call
  elsif !ignore_on_failed?
    @error_message = checker.error_message[0...255]
    marker_options = @options.merge(status: false, description: @error_message)

    marker = ::Vpago::Payway::PaymentStatusMarker.new(@payment, marker_options)
    marker.call
  end
end