processout 2.31.0 → 3.1.0

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
  SHA256:
3
- metadata.gz: 13734f421a8c68478c51080f9b3f0a4c0224262fee2119b3b64dbd9624405ef7
4
- data.tar.gz: a26a61b84735b1d9ede5a39770f92ae32575c8e333118aefc1ca4ade6d947345
3
+ metadata.gz: a014a9e7ce6325c1d9df18d3347dd8fc33a1bebd415be4e4c265f54b9c769099
4
+ data.tar.gz: a05c9e4f389fb71fea674ad001ce6596b41426986da34c7ca76537de5cbcf74b
5
5
  SHA512:
6
- metadata.gz: 297f5fbed27228dddcc8e4cccc61ca64779e0c0a0e2ef386a49aff2d489550e542405340560ffec8129c9b538b8c8dedfdc3638aaab37a5c76a6e6f5e96c26a9
7
- data.tar.gz: 89ef663f6d2964c3026052ae82b986d6a02fa374e64a6a3ba020c635c575c759ee7640d7661ec1fb13ed194cc5c1f2709e51d3bd552d24395f8439483079717e
6
+ metadata.gz: 5036200b4c89df20d20c4aeb88b032bc45d0343d7c0e8d071a97f1749f658e3fc8752b0caa8717e719a9a89f5ab222d9352cb33b9f7bdc1cec80dda7de8c9482
7
+ data.tar.gz: 62f1f4e9660a884a67f4f95f1963453a8c1775899a1440bdb668a253a2306eaa61de0d4be39290d20447a169b2302bdf26039371add7118501c44a1644e4074c
@@ -15,6 +15,9 @@ module ProcessOut
15
15
  attr_reader :country_code
16
16
  attr_reader :zip
17
17
  attr_reader :phone
18
+ attr_reader :first_name
19
+ attr_reader :last_name
20
+ attr_reader :email
18
21
 
19
22
 
20
23
  def address1=(val)
@@ -57,6 +60,18 @@ module ProcessOut
57
60
 
58
61
  end
59
62
 
63
+ def first_name=(val)
64
+ @first_name = val
65
+ end
66
+
67
+ def last_name=(val)
68
+ @last_name = val
69
+ end
70
+
71
+ def email=(val)
72
+ @email = val
73
+ end
74
+
60
75
 
61
76
  # Initializes the CardShipping object
62
77
  # Params:
@@ -72,6 +87,9 @@ module ProcessOut
72
87
  self.country_code = data.fetch(:country_code, nil)
73
88
  self.zip = data.fetch(:zip, nil)
74
89
  self.phone = data.fetch(:phone, nil)
90
+ self.first_name = data.fetch(:first_name, nil)
91
+ self.last_name = data.fetch(:last_name, nil)
92
+ self.email = data.fetch(:email, nil)
75
93
 
76
94
  end
77
95
 
@@ -90,6 +108,9 @@ module ProcessOut
90
108
  "country_code": self.country_code,
91
109
  "zip": self.zip,
92
110
  "phone": self.phone,
111
+ "first_name": self.first_name,
112
+ "last_name": self.last_name,
113
+ "email": self.email,
93
114
  }.to_json
94
115
  end
95
116
 
@@ -121,6 +142,15 @@ module ProcessOut
121
142
  if data.include? "phone"
122
143
  self.phone = data["phone"]
123
144
  end
145
+ if data.include? "first_name"
146
+ self.first_name = data["first_name"]
147
+ end
148
+ if data.include? "last_name"
149
+ self.last_name = data["last_name"]
150
+ end
151
+ if data.include? "email"
152
+ self.email = data["email"]
153
+ end
124
154
 
125
155
  self
126
156
  end
@@ -139,6 +169,9 @@ module ProcessOut
139
169
  self.country_code = data.fetch(:country_code, self.country_code)
140
170
  self.zip = data.fetch(:zip, self.zip)
141
171
  self.phone = data.fetch(:phone, self.phone)
172
+ self.first_name = data.fetch(:first_name, self.first_name)
173
+ self.last_name = data.fetch(:last_name, self.last_name)
174
+ self.email = data.fetch(:email, self.email)
142
175
 
143
176
  self
144
177
  end
@@ -8,19 +8,9 @@ require "processout/networking/response"
8
8
  module ProcessOut
9
9
  class CardUpdateRequest
10
10
 
11
- attr_reader :update_type
12
- attr_reader :update_reason
13
11
  attr_reader :preferred_scheme
14
12
 
15
13
 
16
- def update_type=(val)
17
- @update_type = val
18
- end
19
-
20
- def update_reason=(val)
21
- @update_reason = val
22
- end
23
-
24
14
  def preferred_scheme=(val)
25
15
  @preferred_scheme = val
26
16
  end
@@ -33,8 +23,6 @@ module ProcessOut
33
23
  def initialize(client, data = {})
34
24
  @client = client
35
25
 
36
- self.update_type = data.fetch(:update_type, nil)
37
- self.update_reason = data.fetch(:update_reason, nil)
38
26
  self.preferred_scheme = data.fetch(:preferred_scheme, nil)
39
27
 
40
28
  end
@@ -47,8 +35,6 @@ module ProcessOut
47
35
  # Overrides the JSON marshaller to only send the fields we want
48
36
  def to_json(options)
49
37
  {
50
- "update_type": self.update_type,
51
- "update_reason": self.update_reason,
52
38
  "preferred_scheme": self.preferred_scheme,
53
39
  }.to_json
54
40
  end
@@ -60,12 +46,6 @@ module ProcessOut
60
46
  if data.nil?
61
47
  return self
62
48
  end
63
- if data.include? "update_type"
64
- self.update_type = data["update_type"]
65
- end
66
- if data.include? "update_reason"
67
- self.update_reason = data["update_reason"]
68
- end
69
49
  if data.include? "preferred_scheme"
70
50
  self.preferred_scheme = data["preferred_scheme"]
71
51
  end
@@ -80,8 +60,6 @@ module ProcessOut
80
60
  if data.nil?
81
61
  return self
82
62
  end
83
- self.update_type = data.fetch(:update_type, self.update_type)
84
- self.update_reason = data.fetch(:update_reason, self.update_reason)
85
63
  self.preferred_scheme = data.fetch(:preferred_scheme, self.preferred_scheme)
86
64
 
87
65
  self
@@ -97,8 +75,6 @@ module ProcessOut
97
75
  request = Request.new(@client)
98
76
  path = "/cards/" + CGI.escape(card_id) + ""
99
77
  data = {
100
- "update_type" => @update_type,
101
- "update_reason" => @update_reason,
102
78
  "preferred_scheme" => @preferred_scheme
103
79
  }
104
80
 
@@ -0,0 +1,337 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class ExportLayout
10
+
11
+ attr_reader :id
12
+ attr_reader :project
13
+ attr_reader :project_id
14
+ attr_reader :created_at
15
+ attr_reader :name
16
+ attr_reader :type
17
+ attr_reader :is_default
18
+ attr_reader :configuration
19
+
20
+
21
+ def id=(val)
22
+ @id = val
23
+ end
24
+
25
+ def project=(val)
26
+ if val.nil?
27
+ @project = val
28
+ return
29
+ end
30
+
31
+ if val.instance_of? Project
32
+ @project = val
33
+ else
34
+ obj = Project.new(@client)
35
+ obj.fill_with_data(val)
36
+ @project = obj
37
+ end
38
+
39
+ end
40
+
41
+ def project_id=(val)
42
+ @project_id = val
43
+ end
44
+
45
+ def created_at=(val)
46
+ @created_at = val
47
+ end
48
+
49
+ def name=(val)
50
+ @name = val
51
+ end
52
+
53
+ def type=(val)
54
+ @type = val
55
+ end
56
+
57
+ def is_default=(val)
58
+ @is_default = val
59
+ end
60
+
61
+ def configuration=(val)
62
+ if val.nil?
63
+ @configuration = val
64
+ return
65
+ end
66
+
67
+ if val.instance_of? ExportLayoutConfiguration
68
+ @configuration = val
69
+ else
70
+ obj = ExportLayoutConfiguration.new(@client)
71
+ obj.fill_with_data(val)
72
+ @configuration = obj
73
+ end
74
+
75
+ end
76
+
77
+
78
+ # Initializes the ExportLayout object
79
+ # Params:
80
+ # +client+:: +ProcessOut+ client instance
81
+ # +data+:: data that can be used to fill the object
82
+ def initialize(client, data = {})
83
+ @client = client
84
+
85
+ self.id = data.fetch(:id, nil)
86
+ self.project = data.fetch(:project, nil)
87
+ self.project_id = data.fetch(:project_id, nil)
88
+ self.created_at = data.fetch(:created_at, nil)
89
+ self.name = data.fetch(:name, nil)
90
+ self.type = data.fetch(:type, nil)
91
+ self.is_default = data.fetch(:is_default, nil)
92
+ self.configuration = data.fetch(:configuration, nil)
93
+
94
+ end
95
+
96
+ # Create a new ExportLayout using the current client
97
+ def new(data = {})
98
+ ExportLayout.new(@client, data)
99
+ end
100
+
101
+ # Overrides the JSON marshaller to only send the fields we want
102
+ def to_json(options)
103
+ {
104
+ "id": self.id,
105
+ "project": self.project,
106
+ "project_id": self.project_id,
107
+ "created_at": self.created_at,
108
+ "name": self.name,
109
+ "type": self.type,
110
+ "is_default": self.is_default,
111
+ "configuration": self.configuration,
112
+ }.to_json
113
+ end
114
+
115
+ # Fills the object with data coming from the API
116
+ # Params:
117
+ # +data+:: +Hash+ of data coming from the API
118
+ def fill_with_data(data)
119
+ if data.nil?
120
+ return self
121
+ end
122
+ if data.include? "id"
123
+ self.id = data["id"]
124
+ end
125
+ if data.include? "project"
126
+ self.project = data["project"]
127
+ end
128
+ if data.include? "project_id"
129
+ self.project_id = data["project_id"]
130
+ end
131
+ if data.include? "created_at"
132
+ self.created_at = data["created_at"]
133
+ end
134
+ if data.include? "name"
135
+ self.name = data["name"]
136
+ end
137
+ if data.include? "type"
138
+ self.type = data["type"]
139
+ end
140
+ if data.include? "is_default"
141
+ self.is_default = data["is_default"]
142
+ end
143
+ if data.include? "configuration"
144
+ self.configuration = data["configuration"]
145
+ end
146
+
147
+ self
148
+ end
149
+
150
+ # Prefills the object with the data passed as parameters
151
+ # Params:
152
+ # +data+:: +Hash+ of data
153
+ def prefill(data)
154
+ if data.nil?
155
+ return self
156
+ end
157
+ self.id = data.fetch(:id, self.id)
158
+ self.project = data.fetch(:project, self.project)
159
+ self.project_id = data.fetch(:project_id, self.project_id)
160
+ self.created_at = data.fetch(:created_at, self.created_at)
161
+ self.name = data.fetch(:name, self.name)
162
+ self.type = data.fetch(:type, self.type)
163
+ self.is_default = data.fetch(:is_default, self.is_default)
164
+ self.configuration = data.fetch(:configuration, self.configuration)
165
+
166
+ self
167
+ end
168
+
169
+ # Get all the export layouts.
170
+ # Params:
171
+ # +options+:: +Hash+ of options
172
+ def all(options = {})
173
+ self.prefill(options)
174
+
175
+ request = Request.new(@client)
176
+ path = "/exports/layouts"
177
+ data = {
178
+
179
+ }
180
+
181
+ response = Response.new(request.get(path, data, options))
182
+ return_values = Array.new
183
+
184
+ a = Array.new
185
+ body = response.body
186
+ for v in body['export_layouts']
187
+ tmp = ExportLayout.new(@client)
188
+ tmp.fill_with_data(v)
189
+ a.push(tmp)
190
+ end
191
+
192
+ return_values.push(a)
193
+
194
+
195
+
196
+ return_values[0]
197
+ end
198
+
199
+ # Find an export layout by its ID.
200
+ # Params:
201
+ # +export_layout_id+:: ID of the export layout
202
+ # +options+:: +Hash+ of options
203
+ def find(export_layout_id, options = {})
204
+ self.prefill(options)
205
+
206
+ request = Request.new(@client)
207
+ path = "/exports/layouts/" + CGI.escape(export_layout_id) + ""
208
+ data = {
209
+
210
+ }
211
+
212
+ response = Response.new(request.get(path, data, options))
213
+ return_values = Array.new
214
+
215
+ body = response.body
216
+ body = body["export_layout"]
217
+
218
+
219
+ obj = ExportLayout.new(@client)
220
+ return_values.push(obj.fill_with_data(body))
221
+
222
+
223
+
224
+ return_values[0]
225
+ end
226
+
227
+ # Find the default export layout for given export type.
228
+ # Params:
229
+ # +export_type+:: Export type for which the default layout is assigned.
230
+ # +options+:: +Hash+ of options
231
+ def find_default(export_type, options = {})
232
+ self.prefill(options)
233
+
234
+ request = Request.new(@client)
235
+ path = "/exports/layouts/default/" + CGI.escape(export_type) + ""
236
+ data = {
237
+
238
+ }
239
+
240
+ response = Response.new(request.get(path, data, options))
241
+ return_values = Array.new
242
+
243
+ body = response.body
244
+ body = body["export_layout"]
245
+
246
+
247
+ obj = ExportLayout.new(@client)
248
+ return_values.push(obj.fill_with_data(body))
249
+
250
+
251
+
252
+ return_values[0]
253
+ end
254
+
255
+ # Create a new export layout.
256
+ # Params:
257
+ # +options+:: +Hash+ of options
258
+ def create(options = {})
259
+ self.prefill(options)
260
+
261
+ request = Request.new(@client)
262
+ path = "/exports/layouts"
263
+ data = {
264
+ "name" => @name,
265
+ "type" => @type,
266
+ "is_default" => @is_default,
267
+ "configuration" => @configuration
268
+ }
269
+
270
+ response = Response.new(request.post(path, data, options))
271
+ return_values = Array.new
272
+
273
+ body = response.body
274
+ body = body["export_layout"]
275
+
276
+
277
+ return_values.push(self.fill_with_data(body))
278
+
279
+
280
+
281
+ return_values[0]
282
+ end
283
+
284
+ # Update the export layout.
285
+ # Params:
286
+ # +export_layout_id+:: ID of the export layout
287
+ # +options+:: +Hash+ of options
288
+ def update(export_layout_id, options = {})
289
+ self.prefill(options)
290
+
291
+ request = Request.new(@client)
292
+ path = "/exports/layouts/" + CGI.escape(export_layout_id) + ""
293
+ data = {
294
+ "name" => @name,
295
+ "is_default" => @is_default,
296
+ "configuration" => @configuration
297
+ }
298
+
299
+ response = Response.new(request.put(path, data, options))
300
+ return_values = Array.new
301
+
302
+ body = response.body
303
+ body = body["export_layout"]
304
+
305
+
306
+ return_values.push(self.fill_with_data(body))
307
+
308
+
309
+
310
+ return_values[0]
311
+ end
312
+
313
+ # Delete the export layout.
314
+ # Params:
315
+ # +export_layout_id+:: ID of the export layout
316
+ # +options+:: +Hash+ of options
317
+ def delete(export_layout_id, options = {})
318
+ self.prefill(options)
319
+
320
+ request = Request.new(@client)
321
+ path = "/exports/layouts/" + CGI.escape(export_layout_id) + ""
322
+ data = {
323
+
324
+ }
325
+
326
+ response = Response.new(request.delete(path, data, options))
327
+ return_values = Array.new
328
+
329
+ return_values.push(response.success)
330
+
331
+
332
+ return_values[0]
333
+ end
334
+
335
+
336
+ end
337
+ end
@@ -0,0 +1,132 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class ExportLayoutConfiguration
10
+
11
+ attr_reader :columns
12
+ attr_reader :time
13
+ attr_reader :amount
14
+
15
+
16
+ def columns=(val)
17
+ if val.nil?
18
+ @columns = []
19
+ return
20
+ end
21
+
22
+ if val.length > 0 and val[0].instance_of? ExportLayoutConfigurationColumn
23
+ @columns = val
24
+ else
25
+ l = Array.new
26
+ for v in val
27
+ obj = ExportLayoutConfigurationColumn.new(@client)
28
+ obj.fill_with_data(v)
29
+ l.push(obj)
30
+ end
31
+ @columns = l
32
+ end
33
+
34
+ end
35
+
36
+ def time=(val)
37
+ if val.nil?
38
+ @time = val
39
+ return
40
+ end
41
+
42
+ if val.instance_of? ExportLayoutConfigurationTime
43
+ @time = val
44
+ else
45
+ obj = ExportLayoutConfigurationTime.new(@client)
46
+ obj.fill_with_data(val)
47
+ @time = obj
48
+ end
49
+
50
+ end
51
+
52
+ def amount=(val)
53
+ if val.nil?
54
+ @amount = val
55
+ return
56
+ end
57
+
58
+ if val.instance_of? ExportLayoutConfigurationAmount
59
+ @amount = val
60
+ else
61
+ obj = ExportLayoutConfigurationAmount.new(@client)
62
+ obj.fill_with_data(val)
63
+ @amount = obj
64
+ end
65
+
66
+ end
67
+
68
+
69
+ # Initializes the ExportLayoutConfiguration object
70
+ # Params:
71
+ # +client+:: +ProcessOut+ client instance
72
+ # +data+:: data that can be used to fill the object
73
+ def initialize(client, data = {})
74
+ @client = client
75
+
76
+ self.columns = data.fetch(:columns, nil)
77
+ self.time = data.fetch(:time, nil)
78
+ self.amount = data.fetch(:amount, nil)
79
+
80
+ end
81
+
82
+ # Create a new ExportLayoutConfiguration using the current client
83
+ def new(data = {})
84
+ ExportLayoutConfiguration.new(@client, data)
85
+ end
86
+
87
+ # Overrides the JSON marshaller to only send the fields we want
88
+ def to_json(options)
89
+ {
90
+ "columns": self.columns,
91
+ "time": self.time,
92
+ "amount": self.amount,
93
+ }.to_json
94
+ end
95
+
96
+ # Fills the object with data coming from the API
97
+ # Params:
98
+ # +data+:: +Hash+ of data coming from the API
99
+ def fill_with_data(data)
100
+ if data.nil?
101
+ return self
102
+ end
103
+ if data.include? "columns"
104
+ self.columns = data["columns"]
105
+ end
106
+ if data.include? "time"
107
+ self.time = data["time"]
108
+ end
109
+ if data.include? "amount"
110
+ self.amount = data["amount"]
111
+ end
112
+
113
+ self
114
+ end
115
+
116
+ # Prefills the object with the data passed as parameters
117
+ # Params:
118
+ # +data+:: +Hash+ of data
119
+ def prefill(data)
120
+ if data.nil?
121
+ return self
122
+ end
123
+ self.columns = data.fetch(:columns, self.columns)
124
+ self.time = data.fetch(:time, self.time)
125
+ self.amount = data.fetch(:amount, self.amount)
126
+
127
+ self
128
+ end
129
+
130
+
131
+ end
132
+ end
@@ -0,0 +1,81 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class ExportLayoutConfigurationAmount
10
+
11
+ attr_reader :precision
12
+ attr_reader :separator
13
+
14
+
15
+ def precision=(val)
16
+ @precision = val
17
+ end
18
+
19
+ def separator=(val)
20
+ @separator = val
21
+ end
22
+
23
+
24
+ # Initializes the ExportLayoutConfigurationAmount object
25
+ # Params:
26
+ # +client+:: +ProcessOut+ client instance
27
+ # +data+:: data that can be used to fill the object
28
+ def initialize(client, data = {})
29
+ @client = client
30
+
31
+ self.precision = data.fetch(:precision, nil)
32
+ self.separator = data.fetch(:separator, nil)
33
+
34
+ end
35
+
36
+ # Create a new ExportLayoutConfigurationAmount using the current client
37
+ def new(data = {})
38
+ ExportLayoutConfigurationAmount.new(@client, data)
39
+ end
40
+
41
+ # Overrides the JSON marshaller to only send the fields we want
42
+ def to_json(options)
43
+ {
44
+ "precision": self.precision,
45
+ "separator": self.separator,
46
+ }.to_json
47
+ end
48
+
49
+ # Fills the object with data coming from the API
50
+ # Params:
51
+ # +data+:: +Hash+ of data coming from the API
52
+ def fill_with_data(data)
53
+ if data.nil?
54
+ return self
55
+ end
56
+ if data.include? "precision"
57
+ self.precision = data["precision"]
58
+ end
59
+ if data.include? "separator"
60
+ self.separator = data["separator"]
61
+ end
62
+
63
+ self
64
+ end
65
+
66
+ # Prefills the object with the data passed as parameters
67
+ # Params:
68
+ # +data+:: +Hash+ of data
69
+ def prefill(data)
70
+ if data.nil?
71
+ return self
72
+ end
73
+ self.precision = data.fetch(:precision, self.precision)
74
+ self.separator = data.fetch(:separator, self.separator)
75
+
76
+ self
77
+ end
78
+
79
+
80
+ end
81
+ end