Class: Minfraud::Components::Addressable

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

Direct Known Subclasses

Billing, Shipping

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#to_json

Constructor Details

#initialize(params = {}) ⇒ Minfraud::Components::Addressable

Creates Minfraud::Components::Addressable instance This class is used as a parent class for Billing and Shipping components

Parameters:

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

    hash of parameters



52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/minfraud/components/addressable.rb', line 52

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]
end

Instance Attribute Details

#addressString

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

Returns:

  • (String)

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



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

def address
  @address
end

#address_2String

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

Returns:

  • (String)

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



22
23
24
# File 'lib/minfraud/components/addressable.rb', line 22

def address_2
  @address_2
end

#cityString

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

Returns:

  • (String)

    The city of the user’s billing / shipping address



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

def city
  @city
end

#companyString

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

Returns:

  • (String)

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



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

def company
  @company
end

#countryString

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

Returns:

  • (String)

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



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

def country
  @country
end

#first_nameString

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

Returns:

  • (String)

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



6
7
8
# File 'lib/minfraud/components/addressable.rb', line 6

def first_name
  @first_name
end

#last_nameString

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

Returns:

  • (String)

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



10
11
12
# File 'lib/minfraud/components/addressable.rb', line 10

def last_name
  @last_name
end

#phone_country_codeString

Returns The country code for phone number associated with the user’s billing / shipping address.

Returns:

  • (String)

    The country code for phone number associated with the user’s billing / shipping address



46
47
48
# File 'lib/minfraud/components/addressable.rb', line 46

def phone_country_code
  @phone_country_code
end

#phone_numberString

Returns The phone number without the country code for the user’s billing / shipping address.

Returns:

  • (String)

    The phone number without the country code for the user’s billing / shipping address



42
43
44
# File 'lib/minfraud/components/addressable.rb', line 42

def phone_number
  @phone_number
end

#postalString

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

Returns:

  • (String)

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



38
39
40
# File 'lib/minfraud/components/addressable.rb', line 38

def postal
  @postal
end

#regionString

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

Returns:

  • (String)

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



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

def region
  @region
end