Class: Launchpad::IEO::OrderRefundWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
app/workers/launchpad/ieo/order_refund_worker.rb

Instance Method Summary collapse

Instance Method Details

#perform(ogid) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'app/workers/launchpad/ieo/order_refund_worker.rb', line 7

def perform(ogid)
  order = GlobalID::Locator.locate_signed(ogid, for: 'order_refund')

  order.close!
  Rails.logger.info { "Refunding #{order.id} order" }
rescue AASM::InvalidTransition => e
  Rails.logger.error order_id: order.id,
                    message: 'Failed to refund',
                    error: e.message
end