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

Note:

This class is used as a parent class for Billing and Shipping components

Creates Minfraud::Components::Addressable instance

Parameters:

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

    hash of parameters



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

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



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

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



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

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



28
29
30
# File 'lib/minfraud/components/addressable.rb', line 28

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



16
17
18
# File 'lib/minfraud/components/addressable.rb', line 16

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



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

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



8
9
10
# File 'lib/minfraud/components/addressable.rb', line 8

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



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

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



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

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



44
45
46
# File 'lib/minfraud/components/addressable.rb', line 44

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



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

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



32
33
34
# File 'lib/minfraud/components/addressable.rb', line 32

def region
  @region
end