Class: DineroMailIpn::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/dinero_mail_ipn/reporter.rb

Constant Summary collapse

VALID_REPORT_STATUS =

Report status list

1
MALFORMED_REPORT_STATUS =
2
INVALID_ACCOUNT_NUMBER_REPORT_STATUS =
3
INVALID_PASSWORD_REPORT_STATUS =
4
INVALID_REQUEST_TYPE_STATUS =
5
INVALID_TRANSACTION_ID_REQUEST_STATUS =
6
INVALID_PASSWORD_OR_ACCOUNT_NUMBER_REQUEST_STATUS =
7
TRANSACTION_NOT_FOUND_REQUEST_STATUS =
8

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml_response) ⇒ Reporter

Returns a new instance of Reporter.



18
19
20
21
# File 'lib/dinero_mail_ipn/reporter.rb', line 18

def initialize(xml_response)
  @doc = Nokogiri::XML(xml_response.downcase)
  @reports = build_reports
end

Instance Attribute Details

#reportsObject (readonly)

Returns the value of attribute reports.



16
17
18
# File 'lib/dinero_mail_ipn/reporter.rb', line 16

def reports
  @reports
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/dinero_mail_ipn/reporter.rb', line 23

def valid?
  @doc.xpath("//estadoreporte").first.content.to_i == VALID_REPORT_STATUS
end