Skip to content

Commit

Permalink
Merge pull request #92 from internetee/json-error-parse-rescue
Browse files Browse the repository at this point in the history
json error parse rescue
  • Loading branch information
vohmar authored Nov 21, 2023
2 parents 5398551 + 942cdee commit a12070f
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module V1
module CallbackHandler
class CallbackHandlerController < ApplicationController
skip_before_action :authorized
rescue_from JSON::ParserError, with: :render_wrong_format

api! 'Receives data from Everypay, when the payment was made by the customer'

Expand Down Expand Up @@ -41,6 +42,12 @@ def callback

render status: :ok, json: { message: result }
end

private

def render_wrong_format
render status: :unprocessable_entity, json: { message: 'Wrong format' }
end
end
end
end
Expand Down

0 comments on commit a12070f

Please sign in to comment.