gotransverse-tract-api 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48f41714e64767b6c7273705a2fe3af7f6c9dd2c
4
- data.tar.gz: cbb1a75f305bb14d79ebae9657dd83995609d22b
3
+ metadata.gz: 39273a34efe26729015c58794493d067d77fb5cd
4
+ data.tar.gz: 86d2f3318800808d0652354d463fd0d5e8e74330
5
5
  SHA512:
6
- metadata.gz: 622f1f761d62bcef02d21f1ad3b14a82768688703fca15161b422d7a655eae8b8b75dd0cccd73db28a329b7b2266ca5312bc6e2029d0657649cc8fc368b931b5
7
- data.tar.gz: a1a75a6ca2b79f459ce59abd511f267abc0435ca4b5570b4e8b4816a2768f558084100ca272441af38c7a20e8032ec65b7aa28a220687adf0697603dc4b9c039
6
+ metadata.gz: 62d15c95a86c9491350cbd04544c4016528eb72b73bad702eb0335554d99cc94b5ce49b393079f2004c177ed09a227001c175cfda5f565e19e208dceaa4815ce
7
+ data.tar.gz: c006707b3070931745c4bbb891dc15189a0512647568df3867c862d56bc35937ee3ee21f3882c08e0f559659c2ff3ad2c62a492c8ec0d999ed3874eaf2e40bc0
@@ -1,5 +1,7 @@
1
1
  require "gotransverse-tract-api/version"
2
+
2
3
  require "gotransverse-tract-api/configuration"
4
+ require "gotransverse-tract-api/hash"
3
5
 
4
6
  require "gotransverse-tract-api/billing_account/adjustment"
5
7
  require "gotransverse-tract-api/billing_account/adjustment_application"
@@ -217,9 +219,10 @@ module GoTransverseTractApi
217
219
  xml_response = Nokogiri::XML(response.body.to_s)
218
220
 
219
221
  klass = klass.to_s.split("::").last
220
- hsh = Hash.from_xml(xml_response.to_s)
222
+ hsh = Hash.from_xml(xml_response.to_s).recursive_symbolize_keys!
223
+
221
224
  if method == :get
222
- hsh = hsh[klass.pluralize.camelize(:lower)][klass.camelize(:lower)] rescue Hash.from_xml(xml_response.to_s)[klass.camelize(:lower)]
225
+ hsh = hsh[klass.pluralize.camelize(:lower).to_sym][klass.camelize(:lower).to_sym] rescue Hash.from_xml(xml_response.to_s)[klass.camelize(:lower).to_sym]
223
226
  end
224
227
 
225
228
  return hsh
@@ -65,7 +65,7 @@ module GoTransverseTractApi
65
65
  <completeUrl>#{complete_url}</completeUrl>
66
66
  </generatePaymentCollectionReferrerToken>"
67
67
 
68
- GoTransverseTractApi.post_request_for(self, body, "referrerToken")
68
+ GoTransverseTractApi.post_request_for(self, body, "referrerToken")[:referrer][:referrerToken]
69
69
  end
70
70
 
71
71
  #
@@ -0,0 +1,10 @@
1
+ class Hash
2
+ def recursive_symbolize_keys!
3
+ symbolize_keys!
4
+ # symbolize each hash in .values
5
+ values.each{|h| h.recursive_symbolize_keys! if h.is_a?(Hash) }
6
+ # symbolize each hash inside an array in .values
7
+ values.select{|v| v.is_a?(Array) }.flatten.each{|h| h.recursive_symbolize_keys! if h.is_a?(Hash) }
8
+ self
9
+ end
10
+ end
@@ -1,6 +1,6 @@
1
1
  module GoTransverseTractApi
2
2
 
3
- VERSION = "0.3.3"
3
+ VERSION = "0.3.4"
4
4
  TARGET_API_VERSION = "1.28"
5
5
 
6
6
  end
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.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien DeFrance
@@ -147,6 +147,7 @@ files:
147
147
  - lib/gotransverse-tract-api/general_ledger/gl_invoice_accounting_transaction.rb
148
148
  - lib/gotransverse-tract-api/general_ledger/gl_payment_accounting_transaction.rb
149
149
  - lib/gotransverse-tract-api/general_ledger/gl_transaction_batch.rb
150
+ - lib/gotransverse-tract-api/hash.rb
150
151
  - lib/gotransverse-tract-api/order/adjustment_category.rb
151
152
  - lib/gotransverse-tract-api/order/agreement.rb
152
153
  - lib/gotransverse-tract-api/order/bill_cycle.rb