Module: Stall::ArchivedPaidCartHelper

Included in:
Checkout::PaymentReturnCheckoutStep
Defined in:
lib/stall/archived_paid_cart_helper.rb

Instance Method Summary collapse

Instance Method Details

#archivable_cart?(cart) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/stall/archived_paid_cart_helper.rb', line 16

def archivable_cart?(cart)
  !cart.active? && cart.token != archived_paid_cart_token
end


11
12
13
14
# File 'lib/stall/archived_paid_cart_helper.rb', line 11

def archive_paid_cart_cookie(identifier)
  cookies.delete(cart_key(identifier))
  store_cart_cookie_for(current_cart.identifier, current_cart, namespace: :paid)
end

#archived_paid_cartObject



3
4
5
# File 'lib/stall/archived_paid_cart_helper.rb', line 3

def archived_paid_cart
  RequestStore.store[archived_paid_cart_key] ||= load_archived_paid_cart
end

#archived_paid_cart?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/stall/archived_paid_cart_helper.rb', line 7

def archived_paid_cart?
  !!archived_paid_cart
end