Sha256: e81f4264aa006fb46f33e310146365b5f31d9f6e8f187bc7d514afb6d0165bfc
Contents?: true
Size: 1002 Bytes
Versions: 1
Compression:
Stored size: 1002 Bytes
Contents
module Spree module Api class RefundsController < Spree::Api::BaseController def estimate authorize! :create, Order render json: SolidusReturnly::Calculator.process(order, line_items_params) end def create authorize! :create, Order refunds = SolidusReturnly::Refunds.new order: order, line_items: line_items_params, restock: refund_restock_param, transactions: transactions_params render json: refunds.proceed! end private def line_items_params params.require(:line_items) end def transactions_params params.require(:transactions) end def refund_restock_param params.require(:restock) == 'true' end def order @order ||= Spree::Order.find_by(number: params[:order_id]) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
solidus-returnly-0.0.1 | app/controllers/spree/api/refunds_controller.rb |