app/controllers/spree/api/retailops/settlement_controller.rb
# The Spree core appears to reflect two schools of thought on
# refunding.  The user guide suggests that one reason you might edit
# orders is if you could not ship them, which suggests handling short
# ships by modifying the order itself, then refunding by the difference
# between the new order value and the payment.  The core code itself
# handles returns by creating an Adjustment for the returned
# merchandise, and leaving the line items alone.
#
# We follow the latter approach because it allows us to keep RetailOps
# as the sole authoritative source of refund values, avoiding useless
# mismatch warnings.
The Spree core appears to reflect two schools of thought on
refunding.  The user guide suggests that one reason you might edit
orders is if you could not ship them, which suggests handling short
ships by modifying the order itself, then refunding by the difference
between the new order value and the payment.  The core code itself
handles returns by creating an Adjustment for the returned
merchandise, and leaving the line items alone.

We follow the latter approach because it allows us to keep RetailOps
as the sole authoritative source of refund values, avoiding useless
mismatch warnings.
The Spree core appears to reflect two schools of thought on refunding . The user guide suggests that one reason you might edit orders is if you could not ship them which suggests handling short ships by modifying the order itself then refunding by the difference between the new order value and the payment . The core code itself handles returns by creating an Adjustment for the returned merchandise and leaving the line items alone . We follow the latter approach because it allows us to keep RetailOps as the sole authoritative source of refund values avoiding useless mismatch warnings .
def mark_complete
          ActiveRecord::Base.transaction do
            find_order
            ship_price = @order_helper.effective_shipping_price
            assert_refund_adjustments params['refund_items'], true
            @order_helper.apply_shipment_price(ship_price)
          end
          settle_payments_if_desired
          render text: @settlement_results.to_json
        end
def mark_complete ActiveRecord :: Base . transaction do find_order ship_price = @order_helper . effective_shipping_price assert_refund_adjustments params [ 'refund_items' ] , true @order_helper . apply_shipment_price ( ship_price ) end settle_payments_if_desired render text : @settlement_results . to_json end
The Spree core appears to reflect two schools of thought on
refunding.
The Spree core appears to reflect two schools of thought on refunding .