Class: Workarea::GlobalE::Merchant::CustomerDetails

Inherits:
Object
  • Object
show all
Defined in:
app/services/workarea/global_e/merchant/customer_details.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash, url_encoded: false) ⇒ CustomerDetails

Returns a new instance of CustomerDetails.



7
8
9
10
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 7

def initialize(hash, url_encoded: false)
  @hash = hash
  @url_encoded = url_encoded
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



5
6
7
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 5

def hash
  @hash
end

#url_encodedObject (readonly)

Returns the value of attribute url_encoded.



5
6
7
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 5

def url_encoded
  @url_encoded
end

Instance Method Details

#address1String

Address line 1

Returns:

  • (String)


107
108
109
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 107

def address1
  decode hash["Address1"]
end

#address2String

Address line 2

Returns:

  • (String)


115
116
117
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 115

def address2
  decode hash["Address2"]
end

#address_book_idString

Id of the current address from within the address book

Returns:

  • (String)


171
172
173
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 171

def address_book_id
  hash["AddressBookId"]
end

#address_book_nameString

Name of the current address from within the address book

Returns:

  • (String)


179
180
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 179

def address_book_name
end

#cityString

City name

Returns:

  • (String)


123
124
125
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 123

def city
  decode hash["City"]
end

#companyObject

Company name

@return [String]


99
100
101
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 99

def company
  decode hash["Company"]
end

#country_codeString

2-char ISO country code

Returns:

  • (String)


155
156
157
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 155

def country_code
  decode hash["CountryCode"]
end

#country_nameString

Country name

Returns:

  • (String)


163
164
165
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 163

def country_name
  decode hash["CountryName"]
end

#emailString

E-mail address

Returns:

  • (String)


91
92
93
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 91

def email
  decode hash["Email"]
end

#faxString

Fax

Returns:

  • (String)


83
84
85
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 83

def fax
  decode hash["Fax"]
end

#first_nameString

First Name

Returns:

  • (String)


35
36
37
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 35

def first_name
  decode hash["FirstName"]
end

#last_nameString

Last name

Returns:

  • (String)


43
44
45
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 43

def last_name
  decode hash["LastName"]
end

#middle_nameString

Middle name

Returns:

  • (String)


51
52
53
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 51

def middle_name
  decode hash["MiddleName"]
end

#phone1String

Phone 1

Returns:

  • (String)


67
68
69
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 67

def phone1
  decode hash["Phone1"]
end

#phone2String

Phone 2

Returns:

  • (String)


75
76
77
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 75

def phone2
  decode hash["Phone2"]
end

#salutationString

Salutation or title (e.g. Dr., Mr., etc.)

Returns:

  • (String)


59
60
61
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 59

def salutation
  decode hash["Salutation"]
end

#save_addressBoolean

Indicates that the current address should be saved in merchant platform

Returns:

  • (Boolean)


186
187
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 186

def save_address
end

#state_codeString

State or province ISO code such as AZ for Arizona (if applicable)

Returns:

  • (String)


139
140
141
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 139

def state_code
  decode hash["StateCode"]
end

#state_or_provinceString

State or province name

Returns:

  • (String)


131
132
133
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 131

def state_or_province
  decode hash["StateOrProvince"]
end

#workarea_address_attributesHash

Attributes used for saving to a Address

Returns:

  • (Hash)


16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 16

def workarea_address_attributes
  {
    first_name:           first_name,
    last_name:            last_name,
    street:               address1,
    street_2:             address2,
    city:                 city,
    region:               state_code,
    postal_code:          zip,
    country:              Country[country_code],
    phone_number:         phone1,
    skip_region_presence: true
  }
end

#zipString

Zip or postal code

Returns:

  • (String)


147
148
149
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 147

def zip
  decode hash["Zip"]
end