mastercard_api_core 1.4.7 → 1.4.8

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: 296da60bdee286979c6ca87713a51d0948f8f076
4
- data.tar.gz: c2c7df86096d2ea0e8b7caf525f745864b1924c5
3
+ metadata.gz: d025f8d54349a5e5990074b4358c7818a4fe6738
4
+ data.tar.gz: a8bc805f67ae082e55f10c07f25cf0c6f205bfd5
5
5
  SHA512:
6
- metadata.gz: 3818063fe52ea1acd907190a5b5661984de49fa75d1e7839463ba6e5710ab71e825617dcc61a666abf9792296a00dafa8e02eb2d2e688ab2296b3c3973c79160
7
- data.tar.gz: b0f2e048f0fcb5676f559f1784d866651762e57da000d3a900eeb61081e8c3f65a03ae0dce3b5606bf033b33a4832763d1dccc7184b107c320908aa66aac4641
6
+ metadata.gz: 146608b792c726769cc495b55c305f965159484d14f430b27e7427bf711c8642b2657029fbe9cf94b93707d5211b0b5a6be90b884708b10d084ab9f7de989390
7
+ data.tar.gz: b52eccc7f00f1722c1c310a3d7abe8c2abe8db96ad26765bd30e7b3d841834d7116fe8519c2d4bd814bedc339a805724b5b1f887e6827b17ca78110930f73716
@@ -213,6 +213,11 @@ module MasterCard
213
213
  #We need to resolve the host
214
214
  resolvedHost = metadata.getHost()
215
215
 
216
+ contentType = APPLICATION_JSON
217
+ if !metadata.getContentTypeOverride().nil?
218
+ contentType = metadata.getContentTypeOverride() + "; charset=UTF-8"
219
+ end
220
+
216
221
  resourcePath = config.getResoucePath().dup
217
222
  if (resourcePath.index("#env"))
218
223
  contenxt = ""
@@ -244,30 +249,30 @@ module MasterCard
244
249
 
245
250
  #Retuns the request object based on action
246
251
  case config.getAction().upcase
247
- when ACTION_LIST, ACTION_READ, ACTION_QUERY
248
- request = Net::HTTP::Get.new uri
252
+ when ACTION_LIST, ACTION_READ, ACTION_QUERY
253
+ request = Net::HTTP::Get.new uri
249
254
 
250
- when ACTION_CREATE
251
- request = Net::HTTP::Post.new uri
255
+ when ACTION_CREATE
256
+ request = Net::HTTP::Post.new uri
252
257
 
253
- when ACTION_DELETE
254
- request = Net::HTTP::Delete.new uri
258
+ when ACTION_DELETE
259
+ request = Net::HTTP::Delete.new uri
255
260
 
256
- when ACTION_UPDATE
257
- request = Net::HTTP::Put.new uri
258
- else
259
- raise APIException.new "Invalid action #{config.getAction()}"
261
+ when ACTION_UPDATE
262
+ request = Net::HTTP::Put.new uri
263
+ else
264
+ raise APIException.new "Invalid action #{config.getAction()}"
260
265
  end
261
266
 
262
267
 
263
268
 
264
269
  #Add default headers
265
- request[KEY_ACCEPT] = APPLICATION_JSON
270
+ request[KEY_ACCEPT] = contentType
266
271
  request[KEY_USER_AGENT] =Constants::getCoreVersion()+"/"+metadata.getVersion()
267
272
 
268
273
  #Add body
269
274
  unless body.nil?
270
- request[KEY_CONTENT_TYPE] = APPLICATION_JSON
275
+ request[KEY_CONTENT_TYPE] = contentType
271
276
  request.body = body.to_json
272
277
  end
273
278
 
@@ -362,8 +362,7 @@ module MasterCard
362
362
  end
363
363
 
364
364
  def setAll(map)
365
- properties = parseMap(map)
366
- super(map)
365
+ super(parseMap(map))
367
366
  end
368
367
 
369
368
  private
@@ -414,11 +413,12 @@ module MasterCard
414
413
 
415
414
  class OperationMetadata
416
415
 
417
- def initialize(version, host, context = nil, jsonNative = false)
416
+ def initialize(version, host, context = nil, jsonNative = false, contentTypeOverride = nil)
418
417
  @version = version
419
418
  @host = host
420
419
  @context = context
421
420
  @jsonNative = jsonNative
421
+ @contentTypeOverride = contentTypeOverride
422
422
  end
423
423
 
424
424
  def getVersion()
@@ -436,6 +436,10 @@ module MasterCard
436
436
  def isJsonNative()
437
437
  return @jsonNative
438
438
  end
439
+
440
+ def getContentTypeOverride()
441
+ return @contentTypeOverride
442
+ end
439
443
 
440
444
  end
441
445
 
@@ -31,7 +31,7 @@ Gem::Specification.new do |gem|
31
31
  gem.summary = %q{MasterCard core SDK}
32
32
  gem.description = %q{This is the MasterCard OpenAPI core SDK. This provides the base functionality for all MasterCard APIs}
33
33
  gem.homepage = "https://developer.mastercard.com"
34
- gem.version = "1.4.7"
34
+ gem.version = "1.4.8"
35
35
  gem.license = "BSD-2-Clause"
36
36
 
37
37
  gem.files = Dir["{bin,spec,lib}/**/*"]+ Dir["data/*"] + ["mastercard_api_core.gemspec"]
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.4.7
4
+ version: 1.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - MasterCard Worldwide
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-15 00:00:00.000000000 Z
11
+ date: 2017-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov