Class: Google4R::Checkout::Address
- Inherits:
-
Object
- Object
- Google4R::Checkout::Address
- Defined in:
- lib/google4r/checkout/notifications.rb
Overview
Address instances are used in NewOrderNotification objects for the buyer’s billing and buyer’s shipping address.
Instance Attribute Summary collapse
-
#address1 ⇒ Object
Second Address line (String).
-
#address2 ⇒ Object
Second Address line (String optional).
-
#city ⇒ Object
The buyer’s city name (String).
-
#company_name ⇒ Object
The buyer’s company name (String; optional).
-
#contact_name ⇒ Object
Contact name (String, optional).
-
#country_code ⇒ Object
The buyer’s country code (String, 2 chars, ISO 3166).
-
#email ⇒ Object
The buyer’s email address (String; optional).
-
#fax ⇒ Object
The buyer’s phone number (String; optional).
-
#phone ⇒ Object
The buyer’s phone number (String; Optional, can be enforced in CheckoutCommand).).
-
#postal_code ⇒ Object
The buyers postal/zip code (String).
-
#region ⇒ Object
The buyer’s geographical region (String).
Class Method Summary collapse
-
.create_from_element(element) ⇒ Object
Creates a new Address from the given REXML::Element instance.
Instance Attribute Details
#address1 ⇒ Object
Second Address line (String).
275 276 277 |
# File 'lib/google4r/checkout/notifications.rb', line 275 def address1 @address1 end |
#address2 ⇒ Object
Second Address line (String optional).
278 279 280 |
# File 'lib/google4r/checkout/notifications.rb', line 278 def address2 @address2 end |
#city ⇒ Object
The buyer’s city name (String).
281 282 283 |
# File 'lib/google4r/checkout/notifications.rb', line 281 def city @city end |
#company_name ⇒ Object
The buyer’s company name (String; optional).
284 285 286 |
# File 'lib/google4r/checkout/notifications.rb', line 284 def company_name @company_name end |
#contact_name ⇒ Object
Contact name (String, optional).
272 273 274 |
# File 'lib/google4r/checkout/notifications.rb', line 272 def contact_name @contact_name end |
#country_code ⇒ Object
The buyer’s country code (String, 2 chars, ISO 3166).
287 288 289 |
# File 'lib/google4r/checkout/notifications.rb', line 287 def country_code @country_code end |
#email ⇒ Object
The buyer’s email address (String; optional).
290 291 292 |
# File 'lib/google4r/checkout/notifications.rb', line 290 def email @email end |
#fax ⇒ Object
The buyer’s phone number (String; optional).
293 294 295 |
# File 'lib/google4r/checkout/notifications.rb', line 293 def fax @fax end |
#phone ⇒ Object
The buyer’s phone number (String; Optional, can be enforced in CheckoutCommand).)
296 297 298 |
# File 'lib/google4r/checkout/notifications.rb', line 296 def phone @phone end |
#postal_code ⇒ Object
The buyers postal/zip code (String).
299 300 301 |
# File 'lib/google4r/checkout/notifications.rb', line 299 def postal_code @postal_code end |
#region ⇒ Object
The buyer’s geographical region (String).
302 303 304 |
# File 'lib/google4r/checkout/notifications.rb', line 302 def region @region end |
Class Method Details
.create_from_element(element) ⇒ Object
Creates a new Address from the given REXML::Element instance.
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/google4r/checkout/notifications.rb', line 305 def self.create_from_element(element) result = Address.new result.address1 = element.elements['address1'].text result.address2 = element.elements['address2'].text rescue nil result.city = element.elements['city'].text result.company_name = element.elements['company-name'].text rescue nil result.contact_name = element.elements['contact-name'].text rescue nil result.country_code = element.elements['country-code'].text result.email = element.elements['email'].text rescue nil result.fax = element.elements['fax'].text rescue nil result.phone = element.elements['phone'].text rescue nil result.postal_code = element.elements['postal-code'].text result.region = element.elements['region'].text return result end |