mastercard_qkr 1.0.2 → 1.1.0

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mastercard/api/qkr/auth.rb +130 -0
  3. data/lib/mastercard/api/qkr/beneficiary.rb +166 -0
  4. data/lib/mastercard/api/qkr/{pospayment.rb → beneficiarycustomfield.rb} +33 -32
  5. data/lib/mastercard/api/qkr/card.rb +102 -102
  6. data/lib/mastercard/api/qkr/cart.rb +82 -82
  7. data/lib/mastercard/api/qkr/cartitem.rb +71 -71
  8. data/lib/mastercard/api/qkr/country.rb +53 -53
  9. data/lib/mastercard/api/qkr/creditnote.rb +116 -0
  10. data/lib/mastercard/api/qkr/externaltrans.rb +63 -63
  11. data/lib/mastercard/api/qkr/forgottenpassword.rb +32 -32
  12. data/lib/mastercard/api/qkr/form.rb +99 -0
  13. data/lib/mastercard/api/qkr/formsubmission.rb +104 -0
  14. data/lib/mastercard/api/qkr/lightbox.rb +53 -53
  15. data/lib/mastercard/api/qkr/machine.rb +43 -43
  16. data/lib/mastercard/api/qkr/menu.rb +32 -32
  17. data/lib/mastercard/api/qkr/merchant.rb +53 -53
  18. data/lib/mastercard/api/qkr/order.rb +92 -92
  19. data/lib/mastercard/api/qkr/orderahead.rb +32 -32
  20. data/lib/mastercard/api/qkr/orderaheadmenu.rb +32 -32
  21. data/lib/mastercard/api/qkr/ordercalendar.rb +99 -0
  22. data/lib/mastercard/api/qkr/orderslot.rb +32 -32
  23. data/lib/mastercard/api/qkr/ordertotal.rb +32 -32
  24. data/lib/mastercard/api/qkr/posorder.rb +42 -42
  25. data/lib/mastercard/api/qkr/pospaymentnotification.rb +32 -32
  26. data/lib/mastercard/api/qkr/prodgroup.rb +43 -43
  27. data/lib/mastercard/api/qkr/refund.rb +32 -32
  28. data/lib/mastercard/api/qkr/resendotp.rb +32 -32
  29. data/lib/mastercard/api/qkr/resourceconfig.rb +54 -54
  30. data/lib/mastercard/api/qkr/securityquestion.rb +32 -32
  31. data/lib/mastercard/api/qkr/trans.rb +73 -73
  32. data/lib/mastercard/api/qkr/updatepassword.rb +32 -32
  33. data/lib/mastercard/api/qkr/user.rb +52 -52
  34. data/lib/mastercard/api/qkr/{payment.rb → userimage.rb} +32 -32
  35. data/lib/mastercard/api/qkr/usersession.rb +32 -32
  36. data/lib/mastercard/api/qkr/vendingsession.rb +61 -61
  37. data/lib/mastercard/api/qkr/verifyotp.rb +32 -32
  38. data/lib/mastercard_qkr.rb +8 -2
  39. metadata +12 -6
@@ -30,74 +30,74 @@ require "mastercard/core/model"
30
30
  require "mastercard/core/baseobject"
31
31
 
32
32
  module MasterCard
33
- module API
34
- module Qkr
35
- class Cart < MasterCard::Core::Model::BaseObject
36
- include MasterCard::Core::Model
37
- #
33
+ module API
34
+ module Qkr
35
+ class Cart < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
38
 
39
- @__store = {
40
- 'aaeb3387-f6bd-47e2-8986-19ec157f05a9' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cart/{id}", "delete", ["X-Auth-Token"], []),
41
- '2a8c0034-0338-420d-900f-34f669092002' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cart", "query", ["X-Auth-Token"], []),
42
- '32383045-71e5-4545-a4ae-07bca62c5624' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cart/{id}", "read", ["X-Auth-Token"], []),
43
-
44
- }
39
+ @__store = {
40
+ '0c8c717f-1959-441b-826a-48568b018b3e' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cart/{id}", "delete", ["X-Auth-Token"], []),
41
+ 'e52acde8-d4bd-4426-a6ba-5ff088eabf57' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cart", "query", ["X-Auth-Token"], []),
42
+ '34c62b69-28af-47d3-9218-8af8f8a759a5' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cart/{id}", "read", ["X-Auth-Token"], []),
43
+
44
+ }
45
45
 
46
- protected
46
+ protected
47
47
 
48
- def self.getOperationConfig(operationUUID)
49
- if @__store.key?(operationUUID)
50
- return @__store[operationUUID]
51
- end
52
- raise NotImplementedError.new("Invalid operationUUID supplied:"+ operationUUID)
53
- end
48
+ def self.getOperationConfig(operationUUID)
49
+ if @__store.key?(operationUUID)
50
+ return @__store[operationUUID]
51
+ end
52
+ raise NotImplementedError.new("Invalid operationUUID supplied:"+ operationUUID)
53
+ end
54
54
 
55
- def self.getOperationMetadata()
56
- return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative(), ResourceConfig.instance.getContentTypeOverride())
57
- end
55
+ def self.getOperationMetadata()
56
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative(), ResourceConfig.instance.getContentTypeOverride())
57
+ end
58
58
 
59
- public
59
+ public
60
60
 
61
61
 
62
62
 
63
63
 
64
64
 
65
- def self.deleteById(id, map = nil)
66
- #Delete object of type Cart by id
65
+ def self.deleteById(id, map = nil)
66
+ #Delete object of type Cart by id
67
67
 
68
- #@param [String] id
69
- #@param [Dict] map, containing additional parameters
70
- #@return [Cart] of the response of the deleted instance.
71
- #@raise [APIException] an exception from the response status
68
+ #@param [String] id
69
+ #@param [Dict] map, containing additional parameters
70
+ #@return [Cart] of the response of the deleted instance.
71
+ #@raise [APIException] an exception from the response status
72
72
 
73
73
 
74
- mapObj = Cart.new
75
- if !(id.nil? || id.to_s.empty?)
76
- mapObj.set("id", id)
77
- end
78
- if !map.nil?
79
- if map.instance_of? RequestMap
80
- mapObj.setAll(map.getObject())
81
- else
82
- mapObj.setAll(map)
83
- end
84
- end
74
+ mapObj = Cart.new
75
+ if !(id.nil? || id.to_s.empty?)
76
+ mapObj.set("id", id)
77
+ end
78
+ if !map.nil?
79
+ if map.instance_of? RequestMap
80
+ mapObj.setAll(map.getObject())
81
+ else
82
+ mapObj.setAll(map)
83
+ end
84
+ end
85
85
 
86
- return self.execute("aaeb3387-f6bd-47e2-8986-19ec157f05a9", mapObj)
87
- end
86
+ return self.execute("0c8c717f-1959-441b-826a-48568b018b3e", mapObj)
87
+ end
88
88
 
89
89
 
90
- def delete
91
- #
92
- #Delete object of type Cart
90
+ def delete
91
+ #
92
+ #Delete object of type Cart
93
93
 
94
- #@param [String] id
95
- #@return [Cart] of the response of the deleted instance.
96
- #@raise [APIException] an exception from the response status
97
- #
94
+ #@param [String] id
95
+ #@return [Cart] of the response of the deleted instance.
96
+ #@raise [APIException] an exception from the response status
97
+ #
98
98
 
99
- return self.class.execute("aaeb3387-f6bd-47e2-8986-19ec157f05a9", self)
100
- end
99
+ return self.class.execute("0c8c717f-1959-441b-826a-48568b018b3e", self)
100
+ end
101
101
 
102
102
 
103
103
 
@@ -107,50 +107,50 @@ module MasterCard
107
107
 
108
108
 
109
109
 
110
- def self.query(criteria)
111
- #
112
- #Query objects of type Cart by id and optional criteria
113
- #@param [Dict] criteria
114
- #@return [Cart] object representing the response.
115
- #@raise [APIException] an exception from the response status
116
- #
110
+ def self.query(criteria)
111
+ #
112
+ #Query objects of type Cart by id and optional criteria
113
+ #@param [Dict] criteria
114
+ #@return [Cart] object representing the response.
115
+ #@raise [APIException] an exception from the response status
116
+ #
117
117
 
118
- return self.execute("2a8c0034-0338-420d-900f-34f669092002",Cart.new(criteria))
119
- end
118
+ return self.execute("e52acde8-d4bd-4426-a6ba-5ff088eabf57",Cart.new(criteria))
119
+ end
120
120
 
121
121
 
122
122
 
123
123
 
124
124
 
125
125
 
126
- def self.read(id, criteria = nil)
127
- #
128
- #Returns objects of type Cart by id and optional criteria
129
- #@param [String] id
130
- #@param [Dict] criteria
131
- #@return [Cart] object representing the response
132
- #@raise [APIException] an exception from the response status
126
+ def self.read(id, criteria = nil)
127
+ #
128
+ #Returns objects of type Cart by id and optional criteria
129
+ #@param [String] id
130
+ #@param [Dict] criteria
131
+ #@return [Cart] object representing the response
132
+ #@raise [APIException] an exception from the response status
133
133
 
134
- mapObj = Cart.new
135
- if !(id.nil? || id.to_s.empty?)
136
- mapObj.set("id", id)
137
- end
138
- if !criteria.nil?
139
- if criteria.instance_of? RequestMap
140
- mapObj.setAll(criteria.getObject())
141
- else
142
- mapObj.setAll(criteria)
143
- end
144
- end
134
+ mapObj = Cart.new
135
+ if !(id.nil? || id.to_s.empty?)
136
+ mapObj.set("id", id)
137
+ end
138
+ if !criteria.nil?
139
+ if criteria.instance_of? RequestMap
140
+ mapObj.setAll(criteria.getObject())
141
+ else
142
+ mapObj.setAll(criteria)
143
+ end
144
+ end
145
145
 
146
- return self.execute("32383045-71e5-4545-a4ae-07bca62c5624",Cart.new(mapObj))
147
- end
146
+ return self.execute("34c62b69-28af-47d3-9218-8af8f8a759a5",Cart.new(mapObj))
147
+ end
148
148
 
149
149
 
150
150
 
151
- end
152
- end
153
- end
151
+ end
152
+ end
153
+ end
154
154
  end
155
155
 
156
156
 
@@ -30,44 +30,44 @@ require "mastercard/core/model"
30
30
  require "mastercard/core/baseobject"
31
31
 
32
32
  module MasterCard
33
- module API
34
- module Qkr
35
- class CartItem < MasterCard::Core::Model::BaseObject
36
- include MasterCard::Core::Model
37
- #
33
+ module API
34
+ module Qkr
35
+ class CartItem < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
38
 
39
- @__store = {
40
- 'fe8aef51-9426-443b-87b0-f60e3552c6f0' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cartItem", "create", ["X-Auth-Token"], []),
41
- '8d470f7a-384d-49a1-a4b8-b181220c5580' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cartItem/{id}", "delete", ["X-Auth-Token"], []),
42
- 'e8653141-482b-4519-b6b5-aebae7a63cff' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cartItem/{id}", "update", ["X-Auth-Token"], []),
43
-
44
- }
39
+ @__store = {
40
+ '2f4bc0c6-58a0-4ed7-b2d3-5a3654953b96' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cartItem", "create", ["X-Auth-Token"], []),
41
+ 'faf1b8ee-d7a1-4ded-b3a4-98e2a3aef015' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cartItem/{id}", "delete", ["X-Auth-Token"], []),
42
+ '9a05781d-a319-4af7-b7b5-34e008f125d3' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/cartItem/{id}", "update", ["X-Auth-Token"], []),
43
+
44
+ }
45
45
 
46
- protected
46
+ protected
47
47
 
48
- def self.getOperationConfig(operationUUID)
49
- if @__store.key?(operationUUID)
50
- return @__store[operationUUID]
51
- end
52
- raise NotImplementedError.new("Invalid operationUUID supplied:"+ operationUUID)
53
- end
48
+ def self.getOperationConfig(operationUUID)
49
+ if @__store.key?(operationUUID)
50
+ return @__store[operationUUID]
51
+ end
52
+ raise NotImplementedError.new("Invalid operationUUID supplied:"+ operationUUID)
53
+ end
54
54
 
55
- def self.getOperationMetadata()
56
- return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative(), ResourceConfig.instance.getContentTypeOverride())
57
- end
55
+ def self.getOperationMetadata()
56
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative(), ResourceConfig.instance.getContentTypeOverride())
57
+ end
58
58
 
59
- public
59
+ public
60
60
 
61
61
 
62
- def self.create(mapObj)
63
- #
64
- #Creates object of type CartItem
65
- #
66
- #@param Dict mapObj, containing the required parameters to create a new object
67
- #@return [CartItem] of the response of created instance.
68
- #@raise [APIException] an exception from the response status
69
- return self.execute("fe8aef51-9426-443b-87b0-f60e3552c6f0", CartItem.new(mapObj))
70
- end
62
+ def self.create(mapObj)
63
+ #
64
+ #Creates object of type CartItem
65
+ #
66
+ #@param Dict mapObj, containing the required parameters to create a new object
67
+ #@return [CartItem] of the response of created instance.
68
+ #@raise [APIException] an exception from the response status
69
+ return self.execute("2f4bc0c6-58a0-4ed7-b2d3-5a3654953b96", CartItem.new(mapObj))
70
+ end
71
71
 
72
72
 
73
73
 
@@ -78,56 +78,56 @@ module MasterCard
78
78
 
79
79
 
80
80
 
81
- def self.deleteById(id, map = nil)
82
- #Delete object of type CartItem by id
81
+ def self.deleteById(id, map = nil)
82
+ #Delete object of type CartItem by id
83
83
 
84
- #@param [String] id
85
- #@param [Dict] map, containing additional parameters
86
- #@return [CartItem] of the response of the deleted instance.
87
- #@raise [APIException] an exception from the response status
84
+ #@param [String] id
85
+ #@param [Dict] map, containing additional parameters
86
+ #@return [CartItem] of the response of the deleted instance.
87
+ #@raise [APIException] an exception from the response status
88
88
 
89
89
 
90
- mapObj = CartItem.new
91
- if !(id.nil? || id.to_s.empty?)
92
- mapObj.set("id", id)
93
- end
94
- if !map.nil?
95
- if map.instance_of? RequestMap
96
- mapObj.setAll(map.getObject())
97
- else
98
- mapObj.setAll(map)
99
- end
100
- end
90
+ mapObj = CartItem.new
91
+ if !(id.nil? || id.to_s.empty?)
92
+ mapObj.set("id", id)
93
+ end
94
+ if !map.nil?
95
+ if map.instance_of? RequestMap
96
+ mapObj.setAll(map.getObject())
97
+ else
98
+ mapObj.setAll(map)
99
+ end
100
+ end
101
101
 
102
- return self.execute("8d470f7a-384d-49a1-a4b8-b181220c5580", mapObj)
103
- end
102
+ return self.execute("faf1b8ee-d7a1-4ded-b3a4-98e2a3aef015", mapObj)
103
+ end
104
104
 
105
105
 
106
- def delete
107
- #
108
- #Delete object of type CartItem
106
+ def delete
107
+ #
108
+ #Delete object of type CartItem
109
109
 
110
- #@param [String] id
111
- #@return [CartItem] of the response of the deleted instance.
112
- #@raise [APIException] an exception from the response status
113
- #
110
+ #@param [String] id
111
+ #@return [CartItem] of the response of the deleted instance.
112
+ #@raise [APIException] an exception from the response status
113
+ #
114
114
 
115
- return self.class.execute("8d470f7a-384d-49a1-a4b8-b181220c5580", self)
116
- end
115
+ return self.class.execute("faf1b8ee-d7a1-4ded-b3a4-98e2a3aef015", self)
116
+ end
117
117
 
118
118
 
119
119
 
120
120
 
121
121
 
122
- def update
123
- #
124
- #Updates an object of type CartItem
125
- #
126
- #@return [CartItem] object representing the response.
127
- #@raise [APIException] an exception from the response status
128
- #
129
- return self.class.execute("e8653141-482b-4519-b6b5-aebae7a63cff",self)
130
- end
122
+ def update
123
+ #
124
+ #Updates an object of type CartItem
125
+ #
126
+ #@return [CartItem] object representing the response.
127
+ #@raise [APIException] an exception from the response status
128
+ #
129
+ return self.class.execute("9a05781d-a319-4af7-b7b5-34e008f125d3",self)
130
+ end
131
131
 
132
132
 
133
133
 
@@ -135,9 +135,9 @@ module MasterCard
135
135
 
136
136
 
137
137
 
138
- end
139
- end
140
- end
138
+ end
139
+ end
140
+ end
141
141
  end
142
142
 
143
143
 
@@ -30,32 +30,32 @@ require "mastercard/core/model"
30
30
  require "mastercard/core/baseobject"
31
31
 
32
32
  module MasterCard
33
- module API
34
- module Qkr
35
- class Country < MasterCard::Core::Model::BaseObject
36
- include MasterCard::Core::Model
37
- #
33
+ module API
34
+ module Qkr
35
+ class Country < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
38
 
39
- @__store = {
40
- '103fcb26-f116-4c0c-b494-4dc209806fd7' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/country", "query", [], []),
41
- 'da49a4b7-75b3-4e5d-953f-9e62bf1c2d08' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/country/{id}", "read", [], []),
42
-
43
- }
39
+ @__store = {
40
+ '45b41fc4-0196-42b8-923a-daeb0180d06d' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/country", "query", [], []),
41
+ '1571ee9a-8cf8-475c-ba5e-55b8ce715676' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/country/{id}", "read", [], []),
42
+
43
+ }
44
44
 
45
- protected
45
+ protected
46
46
 
47
- def self.getOperationConfig(operationUUID)
48
- if @__store.key?(operationUUID)
49
- return @__store[operationUUID]
50
- end
51
- raise NotImplementedError.new("Invalid operationUUID supplied:"+ operationUUID)
52
- end
47
+ def self.getOperationConfig(operationUUID)
48
+ if @__store.key?(operationUUID)
49
+ return @__store[operationUUID]
50
+ end
51
+ raise NotImplementedError.new("Invalid operationUUID supplied:"+ operationUUID)
52
+ end
53
53
 
54
- def self.getOperationMetadata()
55
- return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative(), ResourceConfig.instance.getContentTypeOverride())
56
- end
54
+ def self.getOperationMetadata()
55
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative(), ResourceConfig.instance.getContentTypeOverride())
56
+ end
57
57
 
58
- public
58
+ public
59
59
 
60
60
 
61
61
 
@@ -63,50 +63,50 @@ module MasterCard
63
63
 
64
64
 
65
65
 
66
- def self.query(criteria)
67
- #
68
- #Query objects of type Country by id and optional criteria
69
- #@param [Dict] criteria
70
- #@return [Country] object representing the response.
71
- #@raise [APIException] an exception from the response status
72
- #
66
+ def self.query(criteria)
67
+ #
68
+ #Query objects of type Country by id and optional criteria
69
+ #@param [Dict] criteria
70
+ #@return [Country] object representing the response.
71
+ #@raise [APIException] an exception from the response status
72
+ #
73
73
 
74
- return self.execute("103fcb26-f116-4c0c-b494-4dc209806fd7",Country.new(criteria))
75
- end
74
+ return self.execute("45b41fc4-0196-42b8-923a-daeb0180d06d",Country.new(criteria))
75
+ end
76
76
 
77
77
 
78
78
 
79
79
 
80
80
 
81
81
 
82
- def self.read(id, criteria = nil)
83
- #
84
- #Returns objects of type Country by id and optional criteria
85
- #@param [String] id
86
- #@param [Dict] criteria
87
- #@return [Country] object representing the response
88
- #@raise [APIException] an exception from the response status
82
+ def self.read(id, criteria = nil)
83
+ #
84
+ #Returns objects of type Country by id and optional criteria
85
+ #@param [String] id
86
+ #@param [Dict] criteria
87
+ #@return [Country] object representing the response
88
+ #@raise [APIException] an exception from the response status
89
89
 
90
- mapObj = Country.new
91
- if !(id.nil? || id.to_s.empty?)
92
- mapObj.set("id", id)
93
- end
94
- if !criteria.nil?
95
- if criteria.instance_of? RequestMap
96
- mapObj.setAll(criteria.getObject())
97
- else
98
- mapObj.setAll(criteria)
99
- end
100
- end
90
+ mapObj = Country.new
91
+ if !(id.nil? || id.to_s.empty?)
92
+ mapObj.set("id", id)
93
+ end
94
+ if !criteria.nil?
95
+ if criteria.instance_of? RequestMap
96
+ mapObj.setAll(criteria.getObject())
97
+ else
98
+ mapObj.setAll(criteria)
99
+ end
100
+ end
101
101
 
102
- return self.execute("da49a4b7-75b3-4e5d-953f-9e62bf1c2d08",Country.new(mapObj))
103
- end
102
+ return self.execute("1571ee9a-8cf8-475c-ba5e-55b8ce715676",Country.new(mapObj))
103
+ end
104
104
 
105
105
 
106
106
 
107
- end
108
- end
109
- end
107
+ end
108
+ end
109
+ end
110
110
  end
111
111
 
112
112
 
@@ -0,0 +1,116 @@
1
+ #
2
+ # Copyright (c) 2016 MasterCard International Incorporated
3
+ # All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without modification, are
6
+ # permitted provided that the following conditions are met:
7
+ #
8
+ # Redistributions of source code must retain the above copyright notice, this list of
9
+ # conditions and the following disclaimer.
10
+ # Redistributions in binary form must reproduce the above copyright notice, this list of
11
+ # conditions and the following disclaimer in the documentation and/or other materials
12
+ # provided with the distribution.
13
+ # Neither the name of the MasterCard International Incorporated nor the names of its
14
+ # contributors may be used to endorse or promote products derived from this software
15
+ # without specific prior written permission.
16
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
17
+ # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18
+ # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
19
+ # SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21
+ # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22
+ # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
23
+ # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24
+ # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25
+ # SUCH DAMAGE.
26
+ #
27
+
28
+
29
+ require "mastercard/core/model"
30
+ require "mastercard/core/baseobject"
31
+
32
+ module MasterCard
33
+ module API
34
+ module Qkr
35
+ class CreditNote < MasterCard::Core::Model::BaseObject
36
+ include MasterCard::Core::Model
37
+ #
38
+
39
+ @__store = {
40
+ '07df56b4-8f02-4218-9251-1a05ef373a8f' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/creditNote", "create", ["X-Auth-Token"], []),
41
+ '77b78cd8-ca53-4ca7-8a52-382942736788' => OperationConfig.new("/labs/proxy/qkr2/internal/api2/creditNote/{id}", "read", ["X-Auth-Token"], []),
42
+
43
+ }
44
+
45
+ protected
46
+
47
+ def self.getOperationConfig(operationUUID)
48
+ if @__store.key?(operationUUID)
49
+ return @__store[operationUUID]
50
+ end
51
+ raise NotImplementedError.new("Invalid operationUUID supplied:"+ operationUUID)
52
+ end
53
+
54
+ def self.getOperationMetadata()
55
+ return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext(), ResourceConfig.instance.getJsonNative(), ResourceConfig.instance.getContentTypeOverride())
56
+ end
57
+
58
+ public
59
+
60
+
61
+ def self.create(mapObj)
62
+ #
63
+ #Creates object of type CreditNote
64
+ #
65
+ #@param Dict mapObj, containing the required parameters to create a new object
66
+ #@return [CreditNote] of the response of created instance.
67
+ #@raise [APIException] an exception from the response status
68
+ return self.execute("07df56b4-8f02-4218-9251-1a05ef373a8f", CreditNote.new(mapObj))
69
+ end
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ def self.read(id, criteria = nil)
82
+ #
83
+ #Returns objects of type CreditNote by id and optional criteria
84
+ #@param [String] id
85
+ #@param [Dict] criteria
86
+ #@return [CreditNote] object representing the response
87
+ #@raise [APIException] an exception from the response status
88
+
89
+ mapObj = CreditNote.new
90
+ if !(id.nil? || id.to_s.empty?)
91
+ mapObj.set("id", id)
92
+ end
93
+ if !criteria.nil?
94
+ if criteria.instance_of? RequestMap
95
+ mapObj.setAll(criteria.getObject())
96
+ else
97
+ mapObj.setAll(criteria)
98
+ end
99
+ end
100
+
101
+ return self.execute("77b78cd8-ca53-4ca7-8a52-382942736788",CreditNote.new(mapObj))
102
+ end
103
+
104
+
105
+
106
+ end
107
+ end
108
+ end
109
+ end
110
+
111
+
112
+
113
+
114
+
115
+
116
+