Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Log score for success and failure
Browse files Browse the repository at this point in the history
  • Loading branch information
osahyoun committed Apr 17, 2020
1 parent 27278e0 commit daa5044
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/api/payment/braintree_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ def valid_user?(user)
def verify_bot
action = 'donate/' + params[:page_id]
@captcha = Recaptcha3.new(token: params[:recaptcha_token], action: action)
Rails.logger.info("Transaction captcha score: #{@captcha.score} - #{params}")
unless @captcha.human?
msg = @captcha.errors.present? ? @captcha.errors : 'Invalid request'
Rails.logger.error("Transaction rejected [recaptcha failure] - #{params}")
Rails.logger.error("Transaction rejected [recaptcha failure] - score: #{@captcha.score} - #{params}")
render json: { success: false, message: msg }, status: :unprocessable_entity
return false
end
Rails.logger.info("Transaction recaptcha score: #{@captcha.score} - #{params}")
end

def member_matches_payload
Expand Down

0 comments on commit daa5044

Please sign in to comment.