Commit 4e1b9b9d by ivan Lan

Add pay_deadline validate to order

parent e5543e58
......@@ -64,6 +64,18 @@ module Shotengai
# event :soft_delete
end
def before_pay
raise Shotengai::WebError.new('订单已过期 ,无法支付,请重新提交订单。', -1, 400) if cannot_pay
end
def cannot_pay
Time.now > pay_deadline
end
def pay_deadline
created_at + 15.minutes
end
def manager
snapshots.first.manager
end
......
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