sidekiq provides string keys not symbols

This commit is contained in:
Kyle Drake 2023-11-26 17:27:58 +00:00
parent 6d237600fd
commit 7e49bd96a4

View file

@ -4,26 +4,24 @@ class StopForumSpamWorker
def perform(opts) def perform(opts)
txn = Minfraud::Components::Report::Transaction.new( txn = Minfraud::Components::Report::Transaction.new(
ip_address: opts[:ip], ip_address: opts['ip'],
tag: :spam_or_abuse, tag: :spam_or_abuse,
# The following key/values are not mandatory but are encouraged # The following key/values are not mandatory but are encouraged
maxmind_id: $config['minfraud_account_id'], #maxmind_id: 'noideawhatthisis',
#minfraud_id: '01c25cb0-f067-4e02-8ed0-a094c580f5e4', #minfraud_id: '01c25cb0-f067-4e02-8ed0-a094c580f5e4',
#transaction_id: 'txn123' #transaction_id: 'txn123'
#chargeback_code: 'BL' #chargeback_code: 'BL'
notes: opts[:classifier] notes: opts['classifier']
) )
reporter = Minfraud::Report.new transaction: txn reporter = Minfraud::Report.new transaction: txn
res = reporter.report_transaction reporter.report_transaction
puts res.inspect
res = HTTP.post 'https://stopforumspam.com/add', form: { HTTP.post 'https://stopforumspam.com/add', form: {
api_key: $config['stop_forum_spam_api_key'], api_key: $config['stop_forum_spam_api_key'],
username: opts[:username], username: opts['username'],
email: opts[:email], email: opts['email'],
ip: opts[:ip] ip: opts['ip']
} }
puts res.inspect
end end
end end