Skip to content

Commit

Permalink
Send a 202 response with an empty body
Browse files Browse the repository at this point in the history
  • Loading branch information
gcatanese authored Mar 11, 2024
1 parent ba621ac commit 0302045
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/checkout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ def adyen_webhooks(notifications)
if validator.valid_notification_hmac?(notification, hmacKey)
puts notification["eventCode"]
puts notification["merchantReference"]
"[accepted]"
# Send a 202 response with an empty body
[202, {}, ['']]
else
# In case of invalid hmac, do not send [accepted] response
# In case of invalid hmac
raise "Invalid HMAC Signature"
end
end
Expand Down

0 comments on commit 0302045

Please sign in to comment.