Commit 02afbd12 by ivan Lan

Add validation to Merchant Order Controller update

parent df42df0a
...@@ -19,6 +19,11 @@ module Shotengai ...@@ -19,6 +19,11 @@ module Shotengai
) )
end end
def update
raise Shotengai::WebError.new('订单已支付,不可修改。', '-1', 403) unless @resource.order.unpaid?
super
end
private private
def resource_params def resource_params
params.require(resource_key).permit( params.require(resource_key).permit(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment