Class: CrowdPay::Verification

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::AttributeMethods, ActiveModel::Validations, CrowdPay
Defined in:
lib/crowd_pay/verification.rb

Constant Summary

Constants included from CrowdPay

VERSION

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from CrowdPay

included

Instance Attribute Details

#addressObject

Returns the value of attribute address.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def address
  @address
end

#birthDayObject

Returns the value of attribute birthDay.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def birthDay
  @birthDay
end

#birthMonthObject

Returns the value of attribute birthMonth.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def birthMonth
  @birthMonth
end

#birthYearObject

Returns the value of attribute birthYear.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def birthYear
  @birthYear
end

#cityObject

Returns the value of attribute city.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def city
  @city
end

#created_by_ip_addressObject

Returns the value of attribute created_by_ip_address.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def created_by_ip_address
  @created_by_ip_address
end

#firstNameObject

Returns the value of attribute firstName.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def firstName
  @firstName
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def id
  @id
end

#keyObject

Returns the value of attribute key.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def key
  @key
end

#lastNameObject

Returns the value of attribute lastName.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def lastName
  @lastName
end

#messageObject

Returns the value of attribute message.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def message
  @message
end

#qualifiersObject

Returns the value of attribute qualifiers.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def qualifiers
  @qualifiers
end

#questionsObject

Returns the value of attribute questions.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def questions
  @questions
end

#request_dataObject

Returns the value of attribute request_data.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def request_data
  @request_data
end

#response_bodyObject

Returns the value of attribute response_body.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def response_body
  @response_body
end

#stateObject

Returns the value of attribute state.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def state
  @state
end

#summaryObject

Returns the value of attribute summary.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def summary
  @summary
end

#taxpayerIdObject

Returns the value of attribute taxpayerId.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def taxpayerId
  @taxpayerId
end

#zipObject

Returns the value of attribute zip.



7
8
9
# File 'lib/crowd_pay/verification.rb', line 7

def zip
  @zip
end

Class Method Details

.verify(data, bypass_validation) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/crowd_pay/verification.rb', line 12

def self.verify(data, bypass_validation)
  url = 'identification/api/v1/ops/verify-identity'
  response = post(url, data, bypass_validation)
  obj = parse(response)
  obj.response_body = response.body
  obj.request_data = data.to_s
  obj
end

.verify_answers(data) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/crowd_pay/verification.rb', line 21

def self.verify_answers(data)
  url = 'identification/api/v1/ops/verify-answers'
  response = post(url, data)
  obj = parse(response)
  obj.response_body = response.body
  obj.request_data = data.to_s
  obj
end

Instance Method Details

#fail?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/crowd_pay/verification.rb', line 34

def fail?
  !pass?
end

#pass?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/crowd_pay/verification.rb', line 30

def pass?
  message.downcase == 'pass' || summary.try(:downcase) == 'pass'
end

#soft_fail?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/crowd_pay/verification.rb', line 38

def soft_fail?
  !questions.nil?
end