gotransverse-tract-api 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cef07b156224ed0d85c0b1bbdbe73bdf385b64c3
4
- data.tar.gz: 5d01d42c56c86f27dab0ba5d2db3339e785d5365
3
+ metadata.gz: 55d484a878c67280004af5c6716a43dc246328c6
4
+ data.tar.gz: 095a7793ccb0fb6475c0e5bb9c4a847d5bef12ee
5
5
  SHA512:
6
- metadata.gz: 717d72bff927582220a90f9fd98c64b66435e85a070ddbe4b82c820e11b65ab3a5881dbb25f4c2497aab0507a07e05cd0b1122c47e7fe2576d5dfef339085568
7
- data.tar.gz: 5f9c2d3fa8eafe8f197cba41b4d0f57f4edaa63066e95125c9bf0b8190e0aaa4901709a2ed8e95d5dea8e9d33b85add6d1c652681ede6257e19009d4b75f1dd3
6
+ metadata.gz: 44ff5f925a24282ce277f76f18c9be0c80cc1ca66a4d7e971e4c6ceed6c3a7c2c306f45f63a1a426db7f10544b580183b2f84195db88db92ee73b6eb85fbe9e0
7
+ data.tar.gz: 72bf96c6bd4c17cbc83edd09974a60ed1c2742156d76e0ad8d9418b77193ccc7c2492ffbad51e1b1e2cbb26ea589118db35328c0dd166d2dbda6d6e3d852ca11
@@ -39,17 +39,24 @@ module GoTransverseTractApi
39
39
  def self.add_address eid, address
40
40
  data = {
41
41
  addAddressToParty: {},
42
- person: {eid: eid},
43
- postalAddress: {
44
- purpose: address[:purpose],
45
- country: address[:country],
46
- city: address[:city],
47
- regionOrState: address[:region_or_state],
48
- postalCode: address[:postal_code],
49
- line1: address[:line1]
50
- }
51
42
  }
52
43
 
44
+ if (address.has_key?(:person))
45
+ data.merge!({ person: {eid: eid} })
46
+ else
47
+ data.merge!({ organization: {eid: eid} })
48
+ end
49
+
50
+ if (address.has_key?(:postal_address))
51
+ data.merge!({ postalAddress: address[:postal_address] })
52
+ end
53
+ if (address.has_key?(:email_address))
54
+ data.merge!({ emailAddress: address[:email_address] })
55
+ end
56
+ if (address.has_key?(:telecom_address))
57
+ data.merge!({ telecomAddress: address[:telecom_address] })
58
+ end
59
+
53
60
  xml_data = GoTransverseTractApi.generateXML(data, 'addAddressToParty')
54
61
  GoTransverseTractApi.post_request_for(self, {eid: eid}, xml_data, "addAddress")
55
62
  end
@@ -1,6 +1,6 @@
1
1
  module GoTransverseTractApi
2
2
 
3
- VERSION = "0.7.2"
3
+ VERSION = "0.7.3"
4
4
  TARGET_API_VERSION = "1.29"
5
5
 
6
6
  end
@@ -12,12 +12,23 @@ module GoTransverseTractApi
12
12
  eid = '48406'
13
13
 
14
14
  data = {
15
- city: 'fsfsfs',
16
- country: 'USA',
17
- line1: 'wefsvgg ggdgdgd',
18
- postal_code: '232433',
19
- purpose: 'Billing',
20
- region_or_state: 'CA'
15
+ person: {eid: eid},
16
+ postal_address: {
17
+ city: 'fsfsfs',
18
+ country: 'USA',
19
+ line1: 'wefsvgg ggdgdgd',
20
+ postal_code: '232433',
21
+ purpose: 'Billing',
22
+ region_or_state: 'CA'
23
+ },
24
+ email_address: {
25
+ email: 'test@test.com'
26
+ },
27
+ telecom_address: {
28
+ country_code: '001',
29
+ area_code: '925',
30
+ number: '123-3214'
31
+ }
21
32
  }
22
33
 
23
34
  allow(subject).to receive(:add_address).with(eid, data).and_return(response)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gotransverse-tract-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien DeFrance