Sha256: 5a6e7fb7966d0a1797fcb62e20c5a8549c0da980c07a37fb5e5c51b4ab0c3b44
Contents?: true
Size: 1.04 KB
Versions: 1
Compression:
Stored size: 1.04 KB
Contents
module Spree module Api module Returnly class RefundsController < ApiController def estimate authorize! :create, Order render json: Solidus::Returnly::Calculator.process(order, line_items_params) end def create authorize! :create, Order refunds = Solidus::Returnly::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) end def order @order ||= Spree::Order.find_by!(number: params[:order_id]) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
solidus-returnly-0.3.0 | app/controllers/spree/api/returnly/refunds_controller.rb |