We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49c80a3 commit 942cdeeCopy full SHA for 942cdee
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