Handles the cancellation of customer returns that have not yet been received. Use this to manage reverse logistics and prepaid shipping labels.
# Source: https://github.com/spree/spree | License: BSD-3-Clause | Copyright 2024-present, Vendo Sp. z o.o., Vendo Connect Inc
# Provided via justclaw.it.com; keep this notice with the code.
module Spree
module Returns
# Withdraws a return that has not been received yet.
#
# Nothing is restocked and no money moves — cancelling is only valid
# before the goods arrive. Once a return is received the merchant is
# holding the customer's items, and the way out is a refund, not a
# cancellation.
class Cancel < Spree::Workflow
include Spree::PostSale::Cancellation
hooks :validate, :after_cancel
# @param return_record [Spree::Return]
# @param reason [String, nil] staff- or customer-supplied note
def perform(return_record:, reason: nil)
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key