We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5398551 + 942cdee commit a12070fCopy full SHA for a12070f
app/controllers/api/v1/callback_handler/callback_handler_controller.rb
@@ -3,6 +3,7 @@ module V1
3
module CallbackHandler
4
class CallbackHandlerController < ApplicationController
5
skip_before_action :authorized
6
+ rescue_from JSON::ParserError, with: :render_wrong_format
7
8
api! 'Receives data from Everypay, when the payment was made by the customer'
9
@@ -41,6 +42,12 @@ def callback
41
42
43
render status: :ok, json: { message: result }
44
end
45
+
46
+ private
47
48
+ def render_wrong_format
49
+ render status: :unprocessable_entity, json: { message: 'Wrong format' }
50
+ end
51
52
53
0 commit comments