Class: Minfraud::Components::Addressable

Inherits:
Base
  • Object
show all
Defined in:
lib/minfraud/components/addressable.rb

Overview

This is a parent class for the Billing and Shipping components.

Direct Known Subclasses

Billing, Shipping

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#to_json

Constructor Details

#initialize(params = {}) ⇒ Addressable

Returns a new instance of Addressable.

Parameters:

  • params (Hash) (defaults to: {})

    Hash of parameters. Each key/value should correspond to one of the available attributes.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/minfraud/components/addressable.rb', line 79

def initialize(params = {})
  @first_name         = params[:first_name]
  @last_name          = params[:last_name]
  @company            = params[:company]
  @address            = params[:address]
  @address_2          = params[:address_2]
  @city               = params[:city]
  @region             = params[:region]
  @country            = params[:country]
  @postal             = params[:postal]
  @phone_number       = params[:phone_number]
  @phone_country_code = params[:phone_country_code]

  validate
end

Instance Attribute Details

#addressString?

The first line of the user’s billing / shipping address.

Returns:

  • (String, nil)


30
31
32
# File 'lib/minfraud/components/addressable.rb', line 30

def address
  @address
end

#address_2String?

The second line of the user’s billing / shipping address.

Returns:

  • (String, nil)


35
36
37
# File 'lib/minfraud/components/addressable.rb', line 35

def address_2
  @address_2
end

#cityString?

The city of the user’s billing / shipping address.

Returns:

  • (String, nil)


40
41
42
# File 'lib/minfraud/components/addressable.rb', line 40

def city
  @city
end

#companyString?

The company of the end user as provided in their billing / shipping information.

Returns:

  • (String, nil)


25
26
27
# File 'lib/minfraud/components/addressable.rb', line 25

def company
  @company
end

#countryString?

The two character ISO 3166-1 alpha-2 country code of the user’s billing / shipping address.

Returns:

  • (String, nil)

See Also:



56
57
58
# File 'lib/minfraud/components/addressable.rb', line 56

def country
  @country
end

#first_nameString?

The first name of the end user as provided in their billing / shipping information.

Returns:

  • (String, nil)


13
14
15
# File 'lib/minfraud/components/addressable.rb', line 13

def first_name
  @first_name
end

#last_nameString?

The last name of the end user as provided in their billing / shipping information.

Returns:

  • (String, nil)


19
20
21
# File 'lib/minfraud/components/addressable.rb', line 19

def last_name
  @last_name
end

#phone_country_codeString?

The country code for the phone number associated with the user’s billing / shipping address. If you provide this information then you must provide at least one digit.

Returns:

  • (String, nil)


75
76
77
# File 'lib/minfraud/components/addressable.rb', line 75

def phone_country_code
  @phone_country_code
end

#phone_numberString?

The phone number without the country code for the user’s billing / shipping address. Punctuation characters will be stripped. After stripping punctuation characters, the number must contain only digits.

Returns:

  • (String, nil)


68
69
70
# File 'lib/minfraud/components/addressable.rb', line 68

def phone_number
  @phone_number
end

#postalString?

The postal code of the user’s billing / shipping address.

Returns:

  • (String, nil)


61
62
63
# File 'lib/minfraud/components/addressable.rb', line 61

def postal
  @postal
end

#regionString?

The ISO 3166-2 subdivision code for the user’s billing / shipping address.

Returns:

  • (String, nil)

See Also:



48
49
50
# File 'lib/minfraud/components/addressable.rb', line 48

def region
  @region
end