zuora_rest_client 1.2.2.0 → 1.2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zuora_rest_client/client.rb +2 -0
- data/lib/zuora_rest_client/connection.rb +18 -18
- data/lib/zuora_rest_client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f12ba038bba293e7a7f2d016f2bca54f2a85e11d9e52130e7ec16acb2abbb2f
|
4
|
+
data.tar.gz: e9f44500267bb6b5d8cc4b664d2f6eaaa18fe4fa046dde5d38febf2bf3bc7559
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f364b079454965165ff34c71444205121d343284a2e96872b36f66553829941d89082f09c9ab6e2edc9077e5bc7f9d7be12e076c86aab4b1852e4879dd7d498
|
7
|
+
data.tar.gz: 90e96f0c58f97b3d4f0cdbf58b7408a0865aaf6316d96b0900050cc6d01c02200f0682aed36fe292b3da037271a85c053fed5af5f69357a900762e52c69284e7
|
@@ -119,6 +119,24 @@ module ZuoraRestClient
|
|
119
119
|
process_response(response)
|
120
120
|
end
|
121
121
|
|
122
|
+
def zuora_endpoint
|
123
|
+
if @environment.is_a? Symbol
|
124
|
+
if @environment.to_s.start_with?('services')
|
125
|
+
rest_endpoint = "https://#{@environment.to_s}.zuora.com/apps"
|
126
|
+
app_endpoint = "https://#{@environment.to_s}.zuora.com/apps/api"
|
127
|
+
else
|
128
|
+
rest_endpoint = "#{ZUORA_ENVIRONMENTS[@environment][:rest]}"
|
129
|
+
app_endpoint = "#{ZUORA_ENVIRONMENTS[@environment][:app]}/apps/api"
|
130
|
+
end
|
131
|
+
elsif @environment.is_a? Hash
|
132
|
+
rest_endpoint = "#{@environment[:rest]}"
|
133
|
+
app_endpoint = "#{@environment[:app]}/apps/api"
|
134
|
+
else
|
135
|
+
raise 'Possible values for environment are: :production, :api_sandbox, :test, :servicesNNN or a hash with base URL values for :rest and :app.'
|
136
|
+
end
|
137
|
+
OpenStruct.new({ rest: rest_endpoint, app: app_endpoint })
|
138
|
+
end
|
139
|
+
|
122
140
|
private
|
123
141
|
|
124
142
|
ZUORA_REST_MAJOR_VERSION = 'v1'
|
@@ -213,23 +231,5 @@ module ZuoraRestClient
|
|
213
231
|
(path.start_with?('/action/') || path.start_with?('/object/'))
|
214
232
|
end
|
215
233
|
|
216
|
-
def zuora_endpoint
|
217
|
-
if @environment.is_a? Symbol
|
218
|
-
if @environment.to_s.start_with?('services')
|
219
|
-
rest_endpoint = "https://#{@environment.to_s}.zuora.com/apps"
|
220
|
-
app_endpoint = "https://#{@environment.to_s}.zuora.com/apps/api"
|
221
|
-
else
|
222
|
-
rest_endpoint = "#{ZUORA_ENVIRONMENTS[@environment][:rest]}"
|
223
|
-
app_endpoint = "#{ZUORA_ENVIRONMENTS[@environment][:app]}/apps/api"
|
224
|
-
end
|
225
|
-
elsif @environment.is_a? Hash
|
226
|
-
rest_endpoint = "#{@environment[:rest]}"
|
227
|
-
app_endpoint = "#{@environment[:app]}/apps/api"
|
228
|
-
else
|
229
|
-
raise 'Possible values for environment are: :production, :api_sandbox, :test, :servicesNNN or a hash with base URL values for :rest and :app.'
|
230
|
-
end
|
231
|
-
OpenStruct.new({ rest: rest_endpoint, app: app_endpoint })
|
232
|
-
end
|
233
|
-
|
234
234
|
end
|
235
235
|
end
|