Class: Spree::Api::Returnly::RefundsController
Instance Method Summary
collapse
#refund_calculator_class, #refunder_class, #return_item_amount_calculator_class, #return_item_restock_policy_class
#set_headers
Instance Method Details
#create ⇒ Object
12
13
14
15
16
17
18
19
20
|
# File 'app/controllers/spree/api/returnly/refunds_controller.rb', line 12
def create
authorize! :create, Order
refunds = refunder_class.new order: order,
line_items: line_items_params,
product_refund_amount: product_refund_amount_param,
shipping_refund_amount: shipping_refund_amount_param
render json: refunds.proceed!
end
|
#estimate ⇒ Object
7
8
9
10
|
# File 'app/controllers/spree/api/returnly/refunds_controller.rb', line 7
def estimate
authorize! :create, Order
render json: refund_calculator_class.process(order, line_items_params)
end
|