Class: Workarea::GlobalE::Merchant::CustomerDetails
- Inherits:
-
Object
- Object
- Workarea::GlobalE::Merchant::CustomerDetails
- Defined in:
- app/services/workarea/global_e/merchant/customer_details.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#url_encoded ⇒ Object
readonly
Returns the value of attribute url_encoded.
Instance Method Summary collapse
-
#address1 ⇒ String
Address line 1.
-
#address2 ⇒ String
Address line 2.
-
#address_book_id ⇒ String
Id of the current address from within the address book.
-
#address_book_name ⇒ String
Name of the current address from within the address book.
-
#city ⇒ String
City name.
-
#company ⇒ Object
Company name.
-
#country_code ⇒ String
2-char ISO country code.
-
#country_name ⇒ String
Country name.
-
#email ⇒ String
E-mail address.
-
#fax ⇒ String
Fax.
-
#first_name ⇒ String
First Name.
-
#initialize(hash, url_encoded: false) ⇒ CustomerDetails
constructor
A new instance of CustomerDetails.
-
#last_name ⇒ String
Last name.
-
#middle_name ⇒ String
Middle name.
-
#phone1 ⇒ String
Phone 1.
-
#phone2 ⇒ String
Phone 2.
-
#salutation ⇒ String
Salutation or title (e.g. Dr., Mr., etc.).
-
#save_address ⇒ Boolean
Indicates that the current address should be saved in merchant platform.
-
#state_code ⇒ String
State or province ISO code such as AZ for Arizona (if applicable).
-
#state_or_province ⇒ String
State or province name.
-
#workarea_address_attributes ⇒ Hash
Attributes used for saving to a Address.
-
#zip ⇒ String
Zip or postal code.
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
#hash ⇒ Object (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_encoded ⇒ Object (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
#address1 ⇒ String
Address line 1
107 108 109 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 107 def address1 decode hash["Address1"] end |
#address2 ⇒ String
Address line 2
115 116 117 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 115 def address2 decode hash["Address2"] end |
#address_book_id ⇒ String
Id of the current address from within the address book
171 172 173 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 171 def address_book_id hash["AddressBookId"] end |
#address_book_name ⇒ String
Name of the current address from within the address book
179 180 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 179 def address_book_name end |
#city ⇒ String
City name
123 124 125 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 123 def city decode hash["City"] end |
#company ⇒ Object
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_code ⇒ String
2-char ISO country code
155 156 157 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 155 def country_code decode hash["CountryCode"] end |
#country_name ⇒ String
Country name
163 164 165 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 163 def country_name decode hash["CountryName"] end |
#email ⇒ String
E-mail address
91 92 93 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 91 def email decode hash["Email"] end |
#fax ⇒ String
Fax
83 84 85 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 83 def fax decode hash["Fax"] end |
#first_name ⇒ String
First Name
35 36 37 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 35 def first_name decode hash["FirstName"] end |
#last_name ⇒ String
Last name
43 44 45 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 43 def last_name decode hash["LastName"] end |
#middle_name ⇒ String
Middle name
51 52 53 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 51 def middle_name decode hash["MiddleName"] end |
#phone1 ⇒ String
Phone 1
67 68 69 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 67 def phone1 decode hash["Phone1"] end |
#phone2 ⇒ String
Phone 2
75 76 77 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 75 def phone2 decode hash["Phone2"] end |
#salutation ⇒ String
Salutation or title (e.g. Dr., Mr., etc.)
59 60 61 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 59 def salutation decode hash["Salutation"] end |
#save_address ⇒ Boolean
Indicates that the current address should be saved in merchant platform
186 187 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 186 def save_address end |
#state_code ⇒ String
State or province ISO code such as AZ for Arizona (if applicable)
139 140 141 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 139 def state_code decode hash["StateCode"] end |
#state_or_province ⇒ String
State or province name
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_attributes ⇒ Hash
Attributes used for saving to a Address
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 |
#zip ⇒ String
Zip or postal code
147 148 149 |
# File 'app/services/workarea/global_e/merchant/customer_details.rb', line 147 def zip decode hash["Zip"] end |