lib/gotransverse-tract-api/order/organization.rb in gotransverse-tract-api-0.3.4 vs lib/gotransverse-tract-api/order/organization.rb in gotransverse-tract-api-0.4.0
- old
+ new
@@ -32,10 +32,24 @@
#
# @param {Long} eid
# @param {Hash} address
#
def self.add_address eid, address
- GoTransverseTractApi.post_request_for(self, {eid: eid}, address, "addAddress")
+ data = {
+ :addAddressToParty => {},
+ :person => {eid: eid},
+ :postalAddress => {
+ :purpose => address[:purpose],
+ :country => address[:country],
+ :city => address[:city],
+ :regionOrState => address[:region_or_state],
+ :postalCode => address[:postal_code],
+ :line1 => address[:line1]
+ }
+ }
+
+ xml_data = GoTransverseTractApi.generateXML(data, 'addAddressToParty')
+ GoTransverseTractApi.post_request_for(self, {eid: eid}, xml_data, "addAddress")
end
#
# @param {Long} eid
# @param {Hash} organization