mastercard_api_core 1.2.0 → 1.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/mastercard/core/controller.rb +17 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c8630c06a9245987849c8dd7ee177d818255174
|
4
|
+
data.tar.gz: 94b4c81402a092e3730b6e2b55aa019e13ebb556
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a37f3a37d9f27fb80852f3382d2cf60670945f6b14fb09a8ea7504206e666078b831cfa81f2d1facd39054750708579015f4d24952d08a282de28062178b4cbe
|
7
|
+
data.tar.gz: 830d89624aaf5ee17dcb7eeb9c8527e3f48dac7fa0468ddb564b62dd7d7cb7d8478a8a9364f6d21c1830f0b5d97d079f42b3b0b616a0406b564468398595aaea
|
@@ -74,12 +74,17 @@ module MasterCard
|
|
74
74
|
#Check preconditions for execute
|
75
75
|
preCheck()
|
76
76
|
|
77
|
-
|
78
|
-
|
77
|
+
resolvedHost = @baseURL
|
78
|
+
unless metadata.getHost().nil?
|
79
|
+
resolvedHost = metadata.getHost()
|
80
|
+
end
|
79
81
|
|
80
|
-
uri = URI.parse(
|
82
|
+
uri = URI.parse(resolvedHost)
|
81
83
|
#Get the http object
|
82
84
|
http = getHTTPObject(uri)
|
85
|
+
|
86
|
+
#Get the request Object
|
87
|
+
request = getRequestObject(config,metadata,input)
|
83
88
|
|
84
89
|
if Config.isDebug
|
85
90
|
puts "---- Request ----"
|
@@ -231,28 +236,29 @@ module MasterCard
|
|
231
236
|
#Get the body
|
232
237
|
body = getBody(config.getAction(),input)
|
233
238
|
|
239
|
+
#add url parameters to path
|
240
|
+
fullUrl = encode_path_params(fullUrl,pathParams)
|
241
|
+
|
242
|
+
uri = URI(fullUrl)
|
234
243
|
|
235
244
|
#Retuns the request object based on action
|
236
245
|
case config.getAction().upcase
|
237
246
|
when ACTION_LIST, ACTION_READ, ACTION_QUERY
|
238
|
-
|
247
|
+
request = Net::HTTP::Get.new uri
|
239
248
|
|
240
249
|
when ACTION_CREATE
|
241
|
-
|
250
|
+
request = Net::HTTP::Post.new uri
|
242
251
|
|
243
252
|
when ACTION_DELETE
|
244
|
-
|
253
|
+
request = Net::HTTP::Delete.new uri
|
245
254
|
|
246
255
|
when ACTION_UPDATE
|
247
|
-
|
256
|
+
request = Net::HTTP::Put.new uri
|
248
257
|
else
|
249
258
|
raise APIException.new "Invalid action #{config.getAction()}"
|
250
259
|
end
|
251
260
|
|
252
|
-
|
253
|
-
fullUrl = encode_path_params(fullUrl,pathParams)
|
254
|
-
|
255
|
-
request = verb.new(fullUrl)
|
261
|
+
|
256
262
|
|
257
263
|
#Add default headers
|
258
264
|
request.add_field(KEY_ACCEPT,APPLICATION_JSON)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mastercard_api_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MasterCard Worldwide
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|