Module: SpreeCmCommissioner::Checkout::CompleteDecorator

Defined in:
app/services/spree_cm_commissioner/checkout/complete_decorator.rb

Instance Method Summary collapse

Instance Method Details

#call(order:) ⇒ Object

Override to bypass the order state machine for ticket transfer orders.

Transfer orders skip guest finalization, inventory unstocking, notifications, and all other callbacks that normally fire on completion.



8
9
10
11
12
13
14
15
# File 'app/services/spree_cm_commissioner/checkout/complete_decorator.rb', line 8

def call(order:)
  if order.ticket_transfer?
    order.update_columns(state: 'complete', completed_at: Time.current) # rubocop:disable Rails/SkipsModelValidations
    success(order)
  else
    super
  end
end