Class: Vpago::WingSdk::PaymentRequestUpdater
- Inherits:
-
PaymentRequestUpdater
- Object
- PaymentRequestUpdater
- Vpago::WingSdk::PaymentRequestUpdater
- Defined in:
- lib/vpago/wing_sdk/payment_request_updater.rb
Instance Attribute Summary
Attributes inherited from PaymentRequestUpdater
Instance Method Summary collapse
Methods inherited from PaymentRequestUpdater
#ignore_on_failed?, #initialize, #success?
Constructor Details
This class inherits a constructor from Vpago::PaymentRequestUpdater
Instance Method Details
#call ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/vpago/wing_sdk/payment_request_updater.rb', line 4 def call return if @payment.order.paid? checker = check_wing_status if checker.success? = nil checker_result = { status: true, description: nil, transaction_id: checker.result['transaction_id'], wing_response: checker.result } = .merge(checker_result) marker = ::Vpago::PaymentStatusMarker.new(@payment, ) marker.call elsif !ignore_on_failed? = checker.[0...255] = .merge(status: false, description: ) marker = ::Vpago::PaymentStatusMarker.new(@payment, ) marker.call end end |
#ensure_payment ⇒ Object
31 32 33 34 35 |
# File 'lib/vpago/wing_sdk/payment_request_updater.rb', line 31 def ensure_payment return if @payment.present? @payment = find_payment end |