mastercard_p2p 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mastercard/api/p2p/accountinfo.rb +35 -31
- data/lib/mastercard/api/p2p/accountverification.rb +35 -32
- data/lib/mastercard/api/p2p/consumer.rb +120 -107
- data/lib/mastercard/api/p2p/consumeraccount.rb +109 -97
- data/lib/mastercard/api/p2p/consumercontactid.rb +109 -97
- data/lib/mastercard/api/p2p/consumergovernmentid.rb +109 -97
- data/lib/mastercard/api/p2p/paymenttransfer.rb +68 -61
- data/lib/mastercard/api/p2p/{skdconfig.rb → resourceconfig.rb} +70 -22
- data/lib/mastercard/api/p2p/sanctionscreening.rb +35 -31
- data/lib/mastercard_p2p.rb +9 -7
- metadata +7 -7
@@ -27,153 +27,165 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
require "mastercard/core/model"
|
30
|
+
require "mastercard/core/baseobject"
|
30
31
|
|
31
32
|
module MasterCard
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
module API
|
34
|
+
module P2p
|
35
|
+
class ConsumerGovernmentID < MasterCard::Core::Model::BaseObject
|
36
|
+
include MasterCard::Core::Model
|
37
|
+
#
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
39
|
+
@__store = {
|
40
|
+
'1055efc4-6bd6-452c-8ced-75286c70d409' => OperationConfig.new("/send/v1/partners/{partnerId}/consumers/{consumerId}/government_ids", "create", [], []),
|
41
|
+
'1b0d922f-ec80-4ed7-857b-dc0f5c1c75b7' => OperationConfig.new("/send/v1/partners/{partnerId}/consumers/{consumerId}/government_ids/{governmentId}", "delete", [], []),
|
42
|
+
'f9d8d117-d933-4176-8adb-8cb3c3a8876a' => OperationConfig.new("/send/v1/partners/{partnerId}/consumers/{consumerId}/government_ids/{governmentId}", "read", [], []),
|
43
|
+
'02fcea21-d3bb-4cda-8439-83d7adc0589e' => OperationConfig.new("/send/v1/partners/{partnerId}/consumers/{consumerId}/government_ids", "query", [], []),
|
44
|
+
'a31214a3-8035-4108-9b3b-6e913b11c16a' => OperationConfig.new("/send/v1/partners/{partnerId}/consumers/{consumerId}/government_ids/{governmentId}", "update", [], []),
|
45
|
+
|
46
|
+
}
|
46
47
|
|
47
|
-
|
48
|
+
protected
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
def self.getOperationConfig(uuid)
|
51
|
+
if @__store.key?(uuid)
|
52
|
+
return @__store[uuid]
|
53
|
+
end
|
54
|
+
raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
|
55
|
+
end
|
55
56
|
|
56
|
-
|
57
|
-
|
58
|
-
|
57
|
+
def self.getOperationMetadata()
|
58
|
+
return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
|
59
|
+
end
|
59
60
|
|
60
|
-
|
61
|
+
public
|
61
62
|
|
62
63
|
|
64
|
+
def self.create(mapObj)
|
65
|
+
#
|
66
|
+
#Creates object of type ConsumerGovernmentID
|
67
|
+
#
|
68
|
+
#@param Dict mapObj, containing the required parameters to create a new object
|
69
|
+
#@return [ConsumerGovernmentID] of the response of created instance.
|
70
|
+
#@raise [APIException] an exception from the response status
|
71
|
+
return self.execute("1055efc4-6bd6-452c-8ced-75286c70d409", ConsumerGovernmentID.new(mapObj))
|
72
|
+
end
|
63
73
|
|
64
74
|
|
65
75
|
|
66
76
|
|
67
|
-
def self.listAll(criteria)
|
68
|
-
#
|
69
|
-
#Query objects of type ConsumerGovernmentID by id and optional criteria
|
70
|
-
#@param type criteria
|
71
|
-
#@return ConsumerGovernmentID object representing the response.
|
72
|
-
#
|
73
77
|
|
74
|
-
return self.execute("a1084965-3822-4ff8-bda6-134d4d92ef1d",ConsumerGovernmentID.new(criteria))
|
75
|
-
end
|
76
78
|
|
77
|
-
def self.create(mapObj)
|
78
|
-
#
|
79
|
-
#Creates object of type ConsumerGovernmentID
|
80
|
-
#
|
81
|
-
#@param Dict mapObj, containing the required parameters to create a new object
|
82
|
-
#@return ConsumerGovernmentID of the response of created instance.
|
83
|
-
#
|
84
|
-
return self.execute("a054b04e-9c68-4c33-9b4a-2c8863dac8bc", ConsumerGovernmentID.new(mapObj))
|
85
|
-
end
|
86
79
|
|
87
80
|
|
88
81
|
|
89
82
|
|
83
|
+
def self.deleteById(id, map = nil)
|
84
|
+
#Delete object of type ConsumerGovernmentID by id
|
90
85
|
|
86
|
+
#@param [String] id
|
87
|
+
#@param [Dict] map, containing additional parameters
|
88
|
+
#@return [ConsumerGovernmentID] of the response of the deleted instance.
|
89
|
+
#@raise [APIException] an exception from the response status
|
91
90
|
|
92
91
|
|
92
|
+
mapObj = ConsumerGovernmentID.new
|
93
|
+
if !(id.nil? || id.to_s.empty?)
|
94
|
+
mapObj.set("id", id)
|
95
|
+
end
|
96
|
+
if !map.nil?
|
97
|
+
if map.instance_of? RequestMap
|
98
|
+
mapObj.setAll(map.getObject())
|
99
|
+
else
|
100
|
+
mapObj.setAll(map)
|
101
|
+
end
|
102
|
+
end
|
93
103
|
|
104
|
+
return self.execute("1b0d922f-ec80-4ed7-857b-dc0f5c1c75b7", mapObj)
|
105
|
+
end
|
94
106
|
|
95
107
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
#@param str id
|
100
|
-
#@param dict criteria
|
101
|
-
#@return instance of ConsumerGovernmentID
|
108
|
+
def delete
|
109
|
+
#
|
110
|
+
#Delete object of type ConsumerGovernmentID
|
102
111
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
if !criteria.nil?
|
108
|
-
if criteria.instance_of? RequestMap
|
109
|
-
mapObj.setAll(criteria.getObject())
|
110
|
-
else
|
111
|
-
mapObj.setAll(criteria)
|
112
|
-
end
|
113
|
-
end
|
112
|
+
#@param [String] id
|
113
|
+
#@return [ConsumerGovernmentID] of the response of the deleted instance.
|
114
|
+
#@raise [APIException] an exception from the response status
|
115
|
+
#
|
114
116
|
|
115
|
-
|
116
|
-
|
117
|
+
return self.class.execute("1b0d922f-ec80-4ed7-857b-dc0f5c1c75b7", self)
|
118
|
+
end
|
117
119
|
|
118
120
|
|
119
121
|
|
120
|
-
def update
|
121
|
-
#
|
122
|
-
#Updates an object of type ConsumerGovernmentID
|
123
|
-
#
|
124
|
-
#@return ConsumerGovernmentID object representing the response.
|
125
|
-
#
|
126
|
-
return self.class.execute("d80883bb-8151-4036-8ced-9dba84c7f2f8",self)
|
127
|
-
end
|
128
122
|
|
129
123
|
|
130
124
|
|
131
125
|
|
132
126
|
|
127
|
+
def self.read(id, criteria = nil)
|
128
|
+
#
|
129
|
+
#Returns objects of type ConsumerGovernmentID by id and optional criteria
|
130
|
+
#@param [String] id
|
131
|
+
#@param [Dict] criteria
|
132
|
+
#@return [ConsumerGovernmentID] object representing the response
|
133
|
+
#@raise [APIException] an exception from the response status
|
133
134
|
|
135
|
+
mapObj = ConsumerGovernmentID.new
|
136
|
+
if !(id.nil? || id.to_s.empty?)
|
137
|
+
mapObj.set("id", id)
|
138
|
+
end
|
139
|
+
if !criteria.nil?
|
140
|
+
if criteria.instance_of? RequestMap
|
141
|
+
mapObj.setAll(criteria.getObject())
|
142
|
+
else
|
143
|
+
mapObj.setAll(criteria)
|
144
|
+
end
|
145
|
+
end
|
134
146
|
|
147
|
+
return self.execute("f9d8d117-d933-4176-8adb-8cb3c3a8876a",ConsumerGovernmentID.new(mapObj))
|
148
|
+
end
|
135
149
|
|
136
150
|
|
137
|
-
def self.deleteById(id, map = nil)
|
138
|
-
#Delete object of type ConsumerGovernmentID by id
|
139
151
|
|
140
|
-
#@param str id
|
141
|
-
#@param Dict map, containing additional parameters
|
142
|
-
#@return ConsumerGovernmentID of the response of the deleted instance.
|
143
152
|
|
144
153
|
|
145
|
-
mapObj = ConsumerGovernmentID.new
|
146
|
-
if !(id.nil? || id.to_s.empty?)
|
147
|
-
mapObj.set("id", id)
|
148
|
-
end
|
149
|
-
if !map.nil?
|
150
|
-
if map.instance_of? RequestMap
|
151
|
-
mapObj.setAll(map.getObject())
|
152
|
-
else
|
153
|
-
mapObj.setAll(map)
|
154
|
-
end
|
155
|
-
end
|
156
154
|
|
157
|
-
return self.execute("7fee36ad-b660-4d0e-84d5-885b5ed07c6f", mapObj)
|
158
|
-
end
|
159
155
|
|
160
156
|
|
161
|
-
|
162
|
-
|
163
|
-
|
157
|
+
def self.listAll(criteria)
|
158
|
+
#
|
159
|
+
#Query objects of type ConsumerGovernmentID by id and optional criteria
|
160
|
+
#@param [Dict] criteria
|
161
|
+
#@return [ConsumerGovernmentID] object representing the response.
|
162
|
+
#@raise [APIException] an exception from the response status
|
163
|
+
#
|
164
164
|
|
165
|
-
|
166
|
-
|
167
|
-
#
|
165
|
+
return self.execute("02fcea21-d3bb-4cda-8439-83d7adc0589e",ConsumerGovernmentID.new(criteria))
|
166
|
+
end
|
168
167
|
|
169
|
-
return self.class.execute("7fee36ad-b660-4d0e-84d5-885b5ed07c6f", self)
|
170
|
-
end
|
171
168
|
|
172
169
|
|
170
|
+
def update
|
171
|
+
#
|
172
|
+
#Updates an object of type ConsumerGovernmentID
|
173
|
+
#
|
174
|
+
#@return [ConsumerGovernmentID] object representing the response.
|
175
|
+
#@raise [APIException] an exception from the response status
|
176
|
+
#
|
177
|
+
return self.class.execute("a31214a3-8035-4108-9b3b-6e913b11c16a",self)
|
178
|
+
end
|
173
179
|
|
174
|
-
|
175
|
-
|
176
|
-
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
177
189
|
end
|
178
190
|
|
179
191
|
|
@@ -27,96 +27,103 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
require "mastercard/core/model"
|
30
|
+
require "mastercard/core/baseobject"
|
30
31
|
|
31
32
|
module MasterCard
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
module API
|
34
|
+
module P2p
|
35
|
+
class PaymentTransfer < MasterCard::Core::Model::BaseObject
|
36
|
+
include MasterCard::Core::Model
|
37
|
+
#
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
@__store = {
|
40
|
+
'd5f2ea17-e2f7-413a-9161-65980a8d6c2c' => OperationConfig.new("/send/v1/partners/{partnerId}/transfers/payment", "create", [], []),
|
41
|
+
'849c0215-a9c0-474b-9265-d853c6b425a2' => OperationConfig.new("/send/v1/partners/{partnerId}/transfers/{transferId}", "read", [], []),
|
42
|
+
'5fcef3bb-170a-4aaa-af4a-928a9ce857e6' => OperationConfig.new("/send/v1/partners/{partnerId}/transfers", "query", [], ["ref"]),
|
43
|
+
|
44
|
+
}
|
44
45
|
|
45
|
-
|
46
|
+
protected
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
def self.getOperationConfig(uuid)
|
49
|
+
if @__store.key?(uuid)
|
50
|
+
return @__store[uuid]
|
51
|
+
end
|
52
|
+
raise NotImplementedError.new("Invalid operationUUID supplied:"+ uuid)
|
53
|
+
end
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
def self.getOperationMetadata()
|
56
|
+
return OperationMetadata.new(ResourceConfig.instance.getVersion(), ResourceConfig.instance.getHost(), ResourceConfig.instance.getContext())
|
57
|
+
end
|
57
58
|
|
58
|
-
|
59
|
+
public
|
59
60
|
|
60
61
|
|
62
|
+
def self.create(mapObj)
|
63
|
+
#
|
64
|
+
#Creates object of type PaymentTransfer
|
65
|
+
#
|
66
|
+
#@param Dict mapObj, containing the required parameters to create a new object
|
67
|
+
#@return [PaymentTransfer] of the response of created instance.
|
68
|
+
#@raise [APIException] an exception from the response status
|
69
|
+
return self.execute("d5f2ea17-e2f7-413a-9161-65980a8d6c2c", PaymentTransfer.new(mapObj))
|
70
|
+
end
|
61
71
|
|
62
72
|
|
63
73
|
|
64
74
|
|
65
|
-
def self.readByReference(criteria)
|
66
|
-
#
|
67
|
-
#Query objects of type PaymentTransfer by id and optional criteria
|
68
|
-
#@param type criteria
|
69
|
-
#@return PaymentTransfer object representing the response.
|
70
|
-
#
|
71
75
|
|
72
|
-
return self.execute("ef527a93-05a8-424c-a515-d71923463c86",PaymentTransfer.new(criteria))
|
73
|
-
end
|
74
76
|
|
75
|
-
def self.create(mapObj)
|
76
|
-
#
|
77
|
-
#Creates object of type PaymentTransfer
|
78
|
-
#
|
79
|
-
#@param Dict mapObj, containing the required parameters to create a new object
|
80
|
-
#@return PaymentTransfer of the response of created instance.
|
81
|
-
#
|
82
|
-
return self.execute("a478f31c-b345-46a9-89d0-fb62e2410bfe", PaymentTransfer.new(mapObj))
|
83
|
-
end
|
84
77
|
|
85
78
|
|
86
79
|
|
87
80
|
|
88
81
|
|
82
|
+
def self.readByID(id, criteria = nil)
|
83
|
+
#
|
84
|
+
#Returns objects of type PaymentTransfer by id and optional criteria
|
85
|
+
#@param [String] id
|
86
|
+
#@param [Dict] criteria
|
87
|
+
#@return [PaymentTransfer] object representing the response
|
88
|
+
#@raise [APIException] an exception from the response status
|
89
89
|
|
90
|
+
mapObj = PaymentTransfer.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
101
|
|
102
|
+
return self.execute("849c0215-a9c0-474b-9265-d853c6b425a2",PaymentTransfer.new(mapObj))
|
103
|
+
end
|
91
104
|
|
92
105
|
|
93
106
|
|
94
|
-
def self.readByID(id, criteria = nil)
|
95
|
-
#
|
96
|
-
#Returns objects of type PaymentTransfer by id and optional criteria
|
97
|
-
#@param str id
|
98
|
-
#@param dict criteria
|
99
|
-
#@return instance of PaymentTransfer
|
100
107
|
|
101
|
-
mapObj = PaymentTransfer.new
|
102
|
-
if !(id.nil? || id.to_s.empty?)
|
103
|
-
mapObj.set("id", id)
|
104
|
-
end
|
105
|
-
if !criteria.nil?
|
106
|
-
if criteria.instance_of? RequestMap
|
107
|
-
mapObj.setAll(criteria.getObject())
|
108
|
-
else
|
109
|
-
mapObj.setAll(criteria)
|
110
|
-
end
|
111
|
-
end
|
112
108
|
|
113
|
-
return self.execute("f29279cd-348f-4234-8e84-63b85be78631",PaymentTransfer.new(mapObj))
|
114
|
-
end
|
115
109
|
|
116
110
|
|
117
|
-
|
118
|
-
|
119
|
-
|
111
|
+
|
112
|
+
def self.readByReference(criteria)
|
113
|
+
#
|
114
|
+
#Query objects of type PaymentTransfer by id and optional criteria
|
115
|
+
#@param [Dict] criteria
|
116
|
+
#@return [PaymentTransfer] object representing the response.
|
117
|
+
#@raise [APIException] an exception from the response status
|
118
|
+
#
|
119
|
+
|
120
|
+
return self.execute("5fcef3bb-170a-4aaa-af4a-928a9ce857e6",PaymentTransfer.new(criteria))
|
121
|
+
end
|
122
|
+
|
123
|
+
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
120
127
|
end
|
121
128
|
|
122
129
|
|
@@ -24,27 +24,75 @@
|
|
24
24
|
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
25
25
|
# SUCH DAMAGE.
|
26
26
|
#
|
27
|
+
|
28
|
+
require "mastercard/core/constants"
|
29
|
+
require "mastercard/core/config"
|
30
|
+
|
27
31
|
module MasterCard
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
32
|
+
module API
|
33
|
+
module P2p
|
34
|
+
class ResourceConfig
|
35
|
+
include MasterCard::Core
|
36
|
+
|
37
|
+
@@instance = nil
|
38
|
+
|
39
|
+
def initialize
|
40
|
+
@name = "p2p"
|
41
|
+
@override = nil
|
42
|
+
@host = nil
|
43
|
+
@context = nil
|
44
|
+
@version = "1.0.2"
|
45
|
+
|
46
|
+
Config.registerResourceConfig(self)
|
47
|
+
currentEnvironment = Config.getEnvironment()
|
48
|
+
self.setEnvironment(currentEnvironment)
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
def self.instance
|
54
|
+
return @@instance
|
55
|
+
end
|
56
|
+
|
57
|
+
|
58
|
+
def getName
|
59
|
+
return @name
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
def getHost
|
64
|
+
unless @override.nil? || @override == 0
|
65
|
+
return @override
|
66
|
+
else
|
67
|
+
return @host
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def getContext
|
72
|
+
return @context
|
73
|
+
end
|
74
|
+
|
75
|
+
def getVersion
|
76
|
+
return @version
|
77
|
+
end
|
78
|
+
|
79
|
+
def setEnvironment(environmet)
|
80
|
+
if Environment::MAPPING.key?(environmet)
|
81
|
+
tuple = Environment::MAPPING[environmet]
|
82
|
+
@host = tuple[0]
|
83
|
+
@context = tuple[1]
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def setCustomEnvironment(host,context)
|
88
|
+
@host = host
|
89
|
+
@context = context
|
90
|
+
end
|
91
|
+
|
92
|
+
@@instance = ResourceConfig.new
|
93
|
+
|
94
|
+
private_class_method :new
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
50
98
|
end
|