Class: Minfraud::Report
- Inherits:
-
Object
- Object
- Minfraud::Report
- Defined in:
- lib/minfraud/report.rb
Overview
Report is used to perform minFraud Report Transaction API requests.
Instance Attribute Summary collapse
-
#transaction ⇒ Minfraud::Components::Report::Transaction?
The Report::Transaction component.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Report
constructor
A new instance of Report.
-
#report_transaction ⇒ nil
Perform a request to the minFraud Report Transaction API.
Constructor Details
#initialize(params = {}) ⇒ Report
Returns a new instance of Report.
16 17 18 |
# File 'lib/minfraud/report.rb', line 16 def initialize(params = {}) @transaction = params[:transaction] end |
Instance Attribute Details
#transaction ⇒ Minfraud::Components::Report::Transaction?
The Report::Transaction component.
11 12 13 |
# File 'lib/minfraud/report.rb', line 11 def transaction @transaction end |
Instance Method Details
#report_transaction ⇒ nil
Perform a request to the minFraud Report Transaction API.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/minfraud/report.rb', line 34 def report_transaction response = nil body = nil Minfraud.connection_pool.with do |client| response = client.post( '/minfraud/v2.0/transactions/report', json: @transaction.to_json, ) body = response.to_s end endpoint = nil locales = nil response = ::Minfraud::HTTPService::Response.new( endpoint, locales, response, body, ) ::Minfraud::ErrorHandler.examine(response) nil end |