Class: Google4R::Checkout::AnonymousAddress

Inherits:
Object
  • Object
show all
Defined in:
lib/google4r/checkout/shared.rb

Overview

This address is used in merchant calculation callback

Direct Known Subclasses

Address

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#address_idObject

The address ID (String)



1146
1147
1148
# File 'lib/google4r/checkout/shared.rb', line 1146

def address_id
  @address_id
end

#cityObject

The buyer’s city name (String).



1149
1150
1151
# File 'lib/google4r/checkout/shared.rb', line 1149

def city
  @city
end

#country_codeObject

The buyer’s country code (String, 2 chars, ISO 3166).



1158
1159
1160
# File 'lib/google4r/checkout/shared.rb', line 1158

def country_code
  @country_code
end

#postal_codeObject

The buyers postal/zip code (String).



1152
1153
1154
# File 'lib/google4r/checkout/shared.rb', line 1152

def postal_code
  @postal_code
end

#regionObject

The buyer’s geographical region (String).



1155
1156
1157
# File 'lib/google4r/checkout/shared.rb', line 1155

def region
  @region
end

Class Method Details

.create_from_element(element) ⇒ Object

Creates a new AnonymousAddress from the given REXML::Element instance.



1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
# File 'lib/google4r/checkout/shared.rb', line 1161

def self.create_from_element(element)
  result = AnonymousAddress.new
  
  result.address_id = element.attributes['id']
  result.city = element.elements['city'].text
  result.country_code = element.elements['country-code'].text
  result.postal_code = element.elements['postal-code'].text
  result.region = element.elements['region'].text
  return result
end