processout 3.0.0 → 3.2.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.
@@ -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 ExportLayoutConfigurationConfigurationOptionsAmount
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 ExportLayoutConfigurationConfigurationOptionsAmount 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 ExportLayoutConfigurationConfigurationOptionsAmount using the current client
37
+ def new(data = {})
38
+ ExportLayoutConfigurationConfigurationOptionsAmount.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
@@ -0,0 +1,70 @@
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 ExportLayoutConfigurationConfigurationOptionsTime
10
+
11
+ attr_reader :format
12
+
13
+
14
+ def format=(val)
15
+ @format = val
16
+ end
17
+
18
+
19
+ # Initializes the ExportLayoutConfigurationConfigurationOptionsTime object
20
+ # Params:
21
+ # +client+:: +ProcessOut+ client instance
22
+ # +data+:: data that can be used to fill the object
23
+ def initialize(client, data = {})
24
+ @client = client
25
+
26
+ self.format = data.fetch(:format, nil)
27
+
28
+ end
29
+
30
+ # Create a new ExportLayoutConfigurationConfigurationOptionsTime using the current client
31
+ def new(data = {})
32
+ ExportLayoutConfigurationConfigurationOptionsTime.new(@client, data)
33
+ end
34
+
35
+ # Overrides the JSON marshaller to only send the fields we want
36
+ def to_json(options)
37
+ {
38
+ "format": self.format,
39
+ }.to_json
40
+ end
41
+
42
+ # Fills the object with data coming from the API
43
+ # Params:
44
+ # +data+:: +Hash+ of data coming from the API
45
+ def fill_with_data(data)
46
+ if data.nil?
47
+ return self
48
+ end
49
+ if data.include? "format"
50
+ self.format = data["format"]
51
+ end
52
+
53
+ self
54
+ end
55
+
56
+ # Prefills the object with the data passed as parameters
57
+ # Params:
58
+ # +data+:: +Hash+ of data
59
+ def prefill(data)
60
+ if data.nil?
61
+ return self
62
+ end
63
+ self.format = data.fetch(:format, self.format)
64
+
65
+ self
66
+ end
67
+
68
+
69
+ end
70
+ end
@@ -0,0 +1,144 @@
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 ExportLayoutConfigurationOptions
10
+
11
+ attr_reader :columns
12
+ attr_reader :time
13
+ attr_reader :amount
14
+
15
+
16
+ def columns=(val)
17
+ @columns = val
18
+ end
19
+
20
+ def time=(val)
21
+ if val.nil?
22
+ @time = val
23
+ return
24
+ end
25
+
26
+ if val.instance_of? ExportLayoutConfigurationConfigurationOptionsTime
27
+ @time = val
28
+ else
29
+ obj = ExportLayoutConfigurationConfigurationOptionsTime.new(@client)
30
+ obj.fill_with_data(val)
31
+ @time = obj
32
+ end
33
+
34
+ end
35
+
36
+ def amount=(val)
37
+ if val.nil?
38
+ @amount = val
39
+ return
40
+ end
41
+
42
+ if val.instance_of? ExportLayoutConfigurationConfigurationOptionsAmount
43
+ @amount = val
44
+ else
45
+ obj = ExportLayoutConfigurationConfigurationOptionsAmount.new(@client)
46
+ obj.fill_with_data(val)
47
+ @amount = obj
48
+ end
49
+
50
+ end
51
+
52
+
53
+ # Initializes the ExportLayoutConfigurationOptions object
54
+ # Params:
55
+ # +client+:: +ProcessOut+ client instance
56
+ # +data+:: data that can be used to fill the object
57
+ def initialize(client, data = {})
58
+ @client = client
59
+
60
+ self.columns = data.fetch(:columns, nil)
61
+ self.time = data.fetch(:time, nil)
62
+ self.amount = data.fetch(:amount, nil)
63
+
64
+ end
65
+
66
+ # Create a new ExportLayoutConfigurationOptions using the current client
67
+ def new(data = {})
68
+ ExportLayoutConfigurationOptions.new(@client, data)
69
+ end
70
+
71
+ # Overrides the JSON marshaller to only send the fields we want
72
+ def to_json(options)
73
+ {
74
+ "columns": self.columns,
75
+ "time": self.time,
76
+ "amount": self.amount,
77
+ }.to_json
78
+ end
79
+
80
+ # Fills the object with data coming from the API
81
+ # Params:
82
+ # +data+:: +Hash+ of data coming from the API
83
+ def fill_with_data(data)
84
+ if data.nil?
85
+ return self
86
+ end
87
+ if data.include? "columns"
88
+ self.columns = data["columns"]
89
+ end
90
+ if data.include? "time"
91
+ self.time = data["time"]
92
+ end
93
+ if data.include? "amount"
94
+ self.amount = data["amount"]
95
+ end
96
+
97
+ self
98
+ end
99
+
100
+ # Prefills the object with the data passed as parameters
101
+ # Params:
102
+ # +data+:: +Hash+ of data
103
+ def prefill(data)
104
+ if data.nil?
105
+ return self
106
+ end
107
+ self.columns = data.fetch(:columns, self.columns)
108
+ self.time = data.fetch(:time, self.time)
109
+ self.amount = data.fetch(:amount, self.amount)
110
+
111
+ self
112
+ end
113
+
114
+ # Fetch export layout configuration options.
115
+ # Params:
116
+ # +export_type+:: Export type
117
+ # +options+:: +Hash+ of options
118
+ def fetch(export_type, options = {})
119
+ self.prefill(options)
120
+
121
+ request = Request.new(@client)
122
+ path = "/exports/layouts/options/" + CGI.escape(export_type) + ""
123
+ data = {
124
+
125
+ }
126
+
127
+ response = Response.new(request.get(path, data, options))
128
+ return_values = Array.new
129
+
130
+ body = response.body
131
+ body = body["export_layout_configuration_options"]
132
+
133
+
134
+ obj = ExportLayoutConfigurationOptions.new(@client)
135
+ return_values.push(obj.fill_with_data(body))
136
+
137
+
138
+
139
+ return_values[0]
140
+ end
141
+
142
+
143
+ end
144
+ end
@@ -0,0 +1,70 @@
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 ExportLayoutConfigurationTime
10
+
11
+ attr_reader :format
12
+
13
+
14
+ def format=(val)
15
+ @format = val
16
+ end
17
+
18
+
19
+ # Initializes the ExportLayoutConfigurationTime object
20
+ # Params:
21
+ # +client+:: +ProcessOut+ client instance
22
+ # +data+:: data that can be used to fill the object
23
+ def initialize(client, data = {})
24
+ @client = client
25
+
26
+ self.format = data.fetch(:format, nil)
27
+
28
+ end
29
+
30
+ # Create a new ExportLayoutConfigurationTime using the current client
31
+ def new(data = {})
32
+ ExportLayoutConfigurationTime.new(@client, data)
33
+ end
34
+
35
+ # Overrides the JSON marshaller to only send the fields we want
36
+ def to_json(options)
37
+ {
38
+ "format": self.format,
39
+ }.to_json
40
+ end
41
+
42
+ # Fills the object with data coming from the API
43
+ # Params:
44
+ # +data+:: +Hash+ of data coming from the API
45
+ def fill_with_data(data)
46
+ if data.nil?
47
+ return self
48
+ end
49
+ if data.include? "format"
50
+ self.format = data["format"]
51
+ end
52
+
53
+ self
54
+ end
55
+
56
+ # Prefills the object with the data passed as parameters
57
+ # Params:
58
+ # +data+:: +Hash+ of data
59
+ def prefill(data)
60
+ if data.nil?
61
+ return self
62
+ end
63
+ self.format = data.fetch(:format, self.format)
64
+
65
+ self
66
+ end
67
+
68
+
69
+ end
70
+ end
@@ -0,0 +1,136 @@
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 ExternalThreeDS
10
+
11
+ attr_reader :xid
12
+ attr_reader :trans_status
13
+ attr_reader :eci
14
+ attr_reader :cavv
15
+ attr_reader :ds_trans_id
16
+ attr_reader :version
17
+ attr_reader :authentication_flow
18
+
19
+
20
+ def xid=(val)
21
+ @xid = val
22
+ end
23
+
24
+ def trans_status=(val)
25
+ @trans_status = val
26
+ end
27
+
28
+ def eci=(val)
29
+ @eci = val
30
+ end
31
+
32
+ def cavv=(val)
33
+ @cavv = val
34
+ end
35
+
36
+ def ds_trans_id=(val)
37
+ @ds_trans_id = val
38
+ end
39
+
40
+ def version=(val)
41
+ @version = val
42
+ end
43
+
44
+ def authentication_flow=(val)
45
+ @authentication_flow = val
46
+ end
47
+
48
+
49
+ # Initializes the ExternalThreeDS object
50
+ # Params:
51
+ # +client+:: +ProcessOut+ client instance
52
+ # +data+:: data that can be used to fill the object
53
+ def initialize(client, data = {})
54
+ @client = client
55
+
56
+ self.xid = data.fetch(:xid, nil)
57
+ self.trans_status = data.fetch(:trans_status, nil)
58
+ self.eci = data.fetch(:eci, nil)
59
+ self.cavv = data.fetch(:cavv, nil)
60
+ self.ds_trans_id = data.fetch(:ds_trans_id, nil)
61
+ self.version = data.fetch(:version, nil)
62
+ self.authentication_flow = data.fetch(:authentication_flow, nil)
63
+
64
+ end
65
+
66
+ # Create a new ExternalThreeDS using the current client
67
+ def new(data = {})
68
+ ExternalThreeDS.new(@client, data)
69
+ end
70
+
71
+ # Overrides the JSON marshaller to only send the fields we want
72
+ def to_json(options)
73
+ {
74
+ "xid": self.xid,
75
+ "trans_status": self.trans_status,
76
+ "eci": self.eci,
77
+ "cavv": self.cavv,
78
+ "ds_trans_id": self.ds_trans_id,
79
+ "version": self.version,
80
+ "authentication_flow": self.authentication_flow,
81
+ }.to_json
82
+ end
83
+
84
+ # Fills the object with data coming from the API
85
+ # Params:
86
+ # +data+:: +Hash+ of data coming from the API
87
+ def fill_with_data(data)
88
+ if data.nil?
89
+ return self
90
+ end
91
+ if data.include? "xid"
92
+ self.xid = data["xid"]
93
+ end
94
+ if data.include? "trans_status"
95
+ self.trans_status = data["trans_status"]
96
+ end
97
+ if data.include? "eci"
98
+ self.eci = data["eci"]
99
+ end
100
+ if data.include? "cavv"
101
+ self.cavv = data["cavv"]
102
+ end
103
+ if data.include? "ds_trans_id"
104
+ self.ds_trans_id = data["ds_trans_id"]
105
+ end
106
+ if data.include? "version"
107
+ self.version = data["version"]
108
+ end
109
+ if data.include? "authentication_flow"
110
+ self.authentication_flow = data["authentication_flow"]
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.xid = data.fetch(:xid, self.xid)
124
+ self.trans_status = data.fetch(:trans_status, self.trans_status)
125
+ self.eci = data.fetch(:eci, self.eci)
126
+ self.cavv = data.fetch(:cavv, self.cavv)
127
+ self.ds_trans_id = data.fetch(:ds_trans_id, self.ds_trans_id)
128
+ self.version = data.fetch(:version, self.version)
129
+ self.authentication_flow = data.fetch(:authentication_flow, self.authentication_flow)
130
+
131
+ self
132
+ end
133
+
134
+
135
+ end
136
+ end
@@ -822,6 +822,8 @@ module ProcessOut
822
822
  "auto_capture_at" => options.fetch(:auto_capture_at, nil),
823
823
  "metadata" => options.fetch(:metadata, nil),
824
824
  "override_mac_blocking" => options.fetch(:override_mac_blocking, nil),
825
+ "external_three_d_s" => options.fetch(:external_three_d_s, nil),
826
+ "save_source" => options.fetch(:save_source, nil),
825
827
  "source" => source
826
828
  }
827
829
 
@@ -862,6 +864,8 @@ module ProcessOut
862
864
  "metadata" => options.fetch(:metadata, nil),
863
865
  "capture_statement_descriptor" => options.fetch(:capture_statement_descriptor, nil),
864
866
  "override_mac_blocking" => options.fetch(:override_mac_blocking, nil),
867
+ "external_three_d_s" => options.fetch(:external_three_d_s, nil),
868
+ "save_source" => options.fetch(:save_source, nil),
865
869
  "source" => source
866
870
  }
867
871
 
@@ -1225,6 +1229,64 @@ module ProcessOut
1225
1229
  return_values.push(response.success)
1226
1230
 
1227
1231
 
1232
+ return_values[0]
1233
+ end
1234
+
1235
+ # Refresh invoice by its ID with PSP.
1236
+ # Params:
1237
+ # +invoice_id+:: ID of the invoice
1238
+ # +options+:: +Hash+ of options
1239
+ def sync_with_psp(invoice_id, options = {})
1240
+ self.prefill(options)
1241
+
1242
+ request = Request.new(@client)
1243
+ path = "/invoices/" + CGI.escape(invoice_id) + "/sync-with-psp"
1244
+ data = {
1245
+
1246
+ }
1247
+
1248
+ response = Response.new(request.put(path, data, options))
1249
+ return_values = Array.new
1250
+
1251
+ body = response.body
1252
+ body = body["invoice"]
1253
+
1254
+
1255
+ obj = Invoice.new(@client)
1256
+ return_values.push(obj.fill_with_data(body))
1257
+
1258
+
1259
+
1260
+ return_values[0]
1261
+ end
1262
+
1263
+ # Update invoice by its ID.
1264
+ # Params:
1265
+ # +invoice_id+:: ID of the invoice
1266
+ # +options+:: +Hash+ of options
1267
+ def update(invoice_id, options = {})
1268
+ self.prefill(options)
1269
+
1270
+ request = Request.new(@client)
1271
+ path = "/invoices/" + CGI.escape(invoice_id) + ""
1272
+ data = {
1273
+ "amount" => @amount,
1274
+ "tax" => @tax,
1275
+ "details" => @details,
1276
+ "shipping" => @shipping
1277
+ }
1278
+
1279
+ response = Response.new(request.put(path, data, options))
1280
+ return_values = Array.new
1281
+
1282
+ body = response.body
1283
+ body = body["invoice"]
1284
+
1285
+
1286
+ return_values.push(self.fill_with_data(body))
1287
+
1288
+
1289
+
1228
1290
  return_values[0]
1229
1291
  end
1230
1292
 
@@ -13,7 +13,7 @@ module ProcessOut
13
13
  req.basic_auth @client.project_id, @client.project_secret
14
14
  req.content_type = "application/json"
15
15
  req["API-Version"] = "1.4.0.0"
16
- req["User-Agent"] = "ProcessOut Ruby-Bindings/3.0.0"
16
+ req["User-Agent"] = "ProcessOut Ruby-Bindings/3.2.0"
17
17
 
18
18
  unless options.nil?
19
19
  req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
@@ -439,9 +439,13 @@ module ProcessOut
439
439
 
440
440
  return_values.push(self.fill_with_data(body))
441
441
 
442
+ body = response.body
443
+ body = body["customer_action"]
444
+ customer_action = CustomerAction.new(@client)
445
+ return_values.push(customer_action.fill_with_data(body))
442
446
 
443
447
 
444
- return_values[0]
448
+ return_values
445
449
  end
446
450
 
447
451
  # Save the updated customer attributes.
@@ -26,12 +26,14 @@ module ProcessOut
26
26
  attr_reader :gateway_operation_id
27
27
  attr_reader :arn
28
28
  attr_reader :error_code
29
+ attr_reader :error_message
29
30
  attr_reader :gateway_data
30
31
  attr_reader :payment_data_three_d_s_request
31
32
  attr_reader :payment_data_three_d_s_authentication
32
33
  attr_reader :payment_data_network_authentication
33
34
  attr_reader :initial_scheme_transaction_id
34
35
  attr_reader :scheme_id
36
+ attr_reader :processed_with_network_token
35
37
  attr_reader :payment_type
36
38
  attr_reader :metadata
37
39
  attr_reader :gateway_fee
@@ -158,6 +160,10 @@ module ProcessOut
158
160
  @error_code = val
159
161
  end
160
162
 
163
+ def error_message=(val)
164
+ @error_message = val
165
+ end
166
+
161
167
  def gateway_data=(val)
162
168
  @gateway_data = val
163
169
  end
@@ -218,6 +224,10 @@ module ProcessOut
218
224
  @scheme_id = val
219
225
  end
220
226
 
227
+ def processed_with_network_token=(val)
228
+ @processed_with_network_token = val
229
+ end
230
+
221
231
  def payment_type=(val)
222
232
  @payment_type = val
223
233
  end
@@ -260,12 +270,14 @@ module ProcessOut
260
270
  self.gateway_operation_id = data.fetch(:gateway_operation_id, nil)
261
271
  self.arn = data.fetch(:arn, nil)
262
272
  self.error_code = data.fetch(:error_code, nil)
273
+ self.error_message = data.fetch(:error_message, nil)
263
274
  self.gateway_data = data.fetch(:gateway_data, nil)
264
275
  self.payment_data_three_d_s_request = data.fetch(:payment_data_three_d_s_request, nil)
265
276
  self.payment_data_three_d_s_authentication = data.fetch(:payment_data_three_d_s_authentication, nil)
266
277
  self.payment_data_network_authentication = data.fetch(:payment_data_network_authentication, nil)
267
278
  self.initial_scheme_transaction_id = data.fetch(:initial_scheme_transaction_id, nil)
268
279
  self.scheme_id = data.fetch(:scheme_id, nil)
280
+ self.processed_with_network_token = data.fetch(:processed_with_network_token, nil)
269
281
  self.payment_type = data.fetch(:payment_type, nil)
270
282
  self.metadata = data.fetch(:metadata, nil)
271
283
  self.gateway_fee = data.fetch(:gateway_fee, nil)
@@ -299,12 +311,14 @@ module ProcessOut
299
311
  "gateway_operation_id": self.gateway_operation_id,
300
312
  "arn": self.arn,
301
313
  "error_code": self.error_code,
314
+ "error_message": self.error_message,
302
315
  "gateway_data": self.gateway_data,
303
316
  "payment_data_three_d_s_request": self.payment_data_three_d_s_request,
304
317
  "payment_data_three_d_s_authentication": self.payment_data_three_d_s_authentication,
305
318
  "payment_data_network_authentication": self.payment_data_network_authentication,
306
319
  "initial_scheme_transaction_id": self.initial_scheme_transaction_id,
307
320
  "scheme_id": self.scheme_id,
321
+ "processed_with_network_token": self.processed_with_network_token,
308
322
  "payment_type": self.payment_type,
309
323
  "metadata": self.metadata,
310
324
  "gateway_fee": self.gateway_fee,
@@ -373,6 +387,9 @@ module ProcessOut
373
387
  if data.include? "error_code"
374
388
  self.error_code = data["error_code"]
375
389
  end
390
+ if data.include? "error_message"
391
+ self.error_message = data["error_message"]
392
+ end
376
393
  if data.include? "gateway_data"
377
394
  self.gateway_data = data["gateway_data"]
378
395
  end
@@ -391,6 +408,9 @@ module ProcessOut
391
408
  if data.include? "scheme_id"
392
409
  self.scheme_id = data["scheme_id"]
393
410
  end
411
+ if data.include? "processed_with_network_token"
412
+ self.processed_with_network_token = data["processed_with_network_token"]
413
+ end
394
414
  if data.include? "payment_type"
395
415
  self.payment_type = data["payment_type"]
396
416
  end
@@ -432,12 +452,14 @@ module ProcessOut
432
452
  self.gateway_operation_id = data.fetch(:gateway_operation_id, self.gateway_operation_id)
433
453
  self.arn = data.fetch(:arn, self.arn)
434
454
  self.error_code = data.fetch(:error_code, self.error_code)
455
+ self.error_message = data.fetch(:error_message, self.error_message)
435
456
  self.gateway_data = data.fetch(:gateway_data, self.gateway_data)
436
457
  self.payment_data_three_d_s_request = data.fetch(:payment_data_three_d_s_request, self.payment_data_three_d_s_request)
437
458
  self.payment_data_three_d_s_authentication = data.fetch(:payment_data_three_d_s_authentication, self.payment_data_three_d_s_authentication)
438
459
  self.payment_data_network_authentication = data.fetch(:payment_data_network_authentication, self.payment_data_network_authentication)
439
460
  self.initial_scheme_transaction_id = data.fetch(:initial_scheme_transaction_id, self.initial_scheme_transaction_id)
440
461
  self.scheme_id = data.fetch(:scheme_id, self.scheme_id)
462
+ self.processed_with_network_token = data.fetch(:processed_with_network_token, self.processed_with_network_token)
441
463
  self.payment_type = data.fetch(:payment_type, self.payment_type)
442
464
  self.metadata = data.fetch(:metadata, self.metadata)
443
465
  self.gateway_fee = data.fetch(:gateway_fee, self.gateway_fee)