processout 2.14.0 → 2.16.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,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 InvoiceExternalFraudTools
10
+
11
+ attr_reader :forter
12
+
13
+
14
+ def forter=(val)
15
+ @forter = val
16
+ end
17
+
18
+
19
+ # Initializes the InvoiceExternalFraudTools 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.forter = data.fetch(:forter, nil)
27
+
28
+ end
29
+
30
+ # Create a new InvoiceExternalFraudTools using the current client
31
+ def new(data = {})
32
+ InvoiceExternalFraudTools.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
+ "forter": self.forter,
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? "forter"
50
+ self.forter = data["forter"]
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.forter = data.fetch(:forter, self.forter)
64
+
65
+ self
66
+ end
67
+
68
+
69
+ end
70
+ 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 InvoiceTax
10
+
11
+ attr_reader :amount
12
+ attr_reader :rate
13
+
14
+
15
+ def amount=(val)
16
+ @amount = val
17
+ end
18
+
19
+ def rate=(val)
20
+ @rate = val
21
+ end
22
+
23
+
24
+ # Initializes the InvoiceTax 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.amount = data.fetch(:amount, nil)
32
+ self.rate = data.fetch(:rate, nil)
33
+
34
+ end
35
+
36
+ # Create a new InvoiceTax using the current client
37
+ def new(data = {})
38
+ InvoiceTax.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
+ "amount": self.amount,
45
+ "rate": self.rate,
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? "amount"
57
+ self.amount = data["amount"]
58
+ end
59
+ if data.include? "rate"
60
+ self.rate = data["rate"]
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.amount = data.fetch(:amount, self.amount)
74
+ self.rate = data.fetch(:rate, self.rate)
75
+
76
+ self
77
+ end
78
+
79
+
80
+ end
81
+ end
@@ -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/2.14.0"
16
+ req["User-Agent"] = "ProcessOut Ruby-Bindings/2.16.0"
17
17
 
18
18
  unless options.nil?
19
19
  req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
@@ -0,0 +1,158 @@
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 ThreeDS
10
+
11
+ attr_reader :version
12
+ attr_reader :status
13
+ attr_reader :fingerprinted
14
+ attr_reader :challenged
15
+ attr_reader :ares_trans_status
16
+ attr_reader :cres_trans_status
17
+ attr_reader :ds_trans_id
18
+ attr_reader :fingerprint_completion_indicator
19
+ attr_reader :server_trans_id
20
+
21
+
22
+ def version=(val)
23
+ @version = val
24
+ end
25
+
26
+ def status=(val)
27
+ @status = val
28
+ end
29
+
30
+ def fingerprinted=(val)
31
+ @fingerprinted = val
32
+ end
33
+
34
+ def challenged=(val)
35
+ @challenged = val
36
+ end
37
+
38
+ def ares_trans_status=(val)
39
+ @ares_trans_status = val
40
+ end
41
+
42
+ def cres_trans_status=(val)
43
+ @cres_trans_status = val
44
+ end
45
+
46
+ def ds_trans_id=(val)
47
+ @ds_trans_id = val
48
+ end
49
+
50
+ def fingerprint_completion_indicator=(val)
51
+ @fingerprint_completion_indicator = val
52
+ end
53
+
54
+ def server_trans_id=(val)
55
+ @server_trans_id = val
56
+ end
57
+
58
+
59
+ # Initializes the ThreeDS object
60
+ # Params:
61
+ # +client+:: +ProcessOut+ client instance
62
+ # +data+:: data that can be used to fill the object
63
+ def initialize(client, data = {})
64
+ @client = client
65
+
66
+ self.version = data.fetch(:version, nil)
67
+ self.status = data.fetch(:status, nil)
68
+ self.fingerprinted = data.fetch(:fingerprinted, nil)
69
+ self.challenged = data.fetch(:challenged, nil)
70
+ self.ares_trans_status = data.fetch(:ares_trans_status, nil)
71
+ self.cres_trans_status = data.fetch(:cres_trans_status, nil)
72
+ self.ds_trans_id = data.fetch(:ds_trans_id, nil)
73
+ self.fingerprint_completion_indicator = data.fetch(:fingerprint_completion_indicator, nil)
74
+ self.server_trans_id = data.fetch(:server_trans_id, nil)
75
+
76
+ end
77
+
78
+ # Create a new ThreeDS using the current client
79
+ def new(data = {})
80
+ ThreeDS.new(@client, data)
81
+ end
82
+
83
+ # Overrides the JSON marshaller to only send the fields we want
84
+ def to_json(options)
85
+ {
86
+ "version": self.version,
87
+ "status": self.status,
88
+ "fingerprinted": self.fingerprinted,
89
+ "challenged": self.challenged,
90
+ "ares_trans_status": self.ares_trans_status,
91
+ "cres_trans_status": self.cres_trans_status,
92
+ "ds_trans_id": self.ds_trans_id,
93
+ "fingerprint_completion_indicator": self.fingerprint_completion_indicator,
94
+ "server_trans_id": self.server_trans_id,
95
+ }.to_json
96
+ end
97
+
98
+ # Fills the object with data coming from the API
99
+ # Params:
100
+ # +data+:: +Hash+ of data coming from the API
101
+ def fill_with_data(data)
102
+ if data.nil?
103
+ return self
104
+ end
105
+ if data.include? "version"
106
+ self.version = data["version"]
107
+ end
108
+ if data.include? "status"
109
+ self.status = data["status"]
110
+ end
111
+ if data.include? "fingerprinted"
112
+ self.fingerprinted = data["fingerprinted"]
113
+ end
114
+ if data.include? "challenged"
115
+ self.challenged = data["challenged"]
116
+ end
117
+ if data.include? "ares_trans_status"
118
+ self.ares_trans_status = data["ares_trans_status"]
119
+ end
120
+ if data.include? "cres_trans_status"
121
+ self.cres_trans_status = data["cres_trans_status"]
122
+ end
123
+ if data.include? "ds_trans_id"
124
+ self.ds_trans_id = data["ds_trans_id"]
125
+ end
126
+ if data.include? "fingerprint_completion_indicator"
127
+ self.fingerprint_completion_indicator = data["fingerprint_completion_indicator"]
128
+ end
129
+ if data.include? "server_trans_id"
130
+ self.server_trans_id = data["server_trans_id"]
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Prefills the object with the data passed as parameters
137
+ # Params:
138
+ # +data+:: +Hash+ of data
139
+ def prefill(data)
140
+ if data.nil?
141
+ return self
142
+ end
143
+ self.version = data.fetch(:version, self.version)
144
+ self.status = data.fetch(:status, self.status)
145
+ self.fingerprinted = data.fetch(:fingerprinted, self.fingerprinted)
146
+ self.challenged = data.fetch(:challenged, self.challenged)
147
+ self.ares_trans_status = data.fetch(:ares_trans_status, self.ares_trans_status)
148
+ self.cres_trans_status = data.fetch(:cres_trans_status, self.cres_trans_status)
149
+ self.ds_trans_id = data.fetch(:ds_trans_id, self.ds_trans_id)
150
+ self.fingerprint_completion_indicator = data.fetch(:fingerprint_completion_indicator, self.fingerprint_completion_indicator)
151
+ self.server_trans_id = data.fetch(:server_trans_id, self.server_trans_id)
152
+
153
+ self
154
+ end
155
+
156
+
157
+ end
158
+ end
@@ -21,8 +21,13 @@ module ProcessOut
21
21
  attr_reader :is_default
22
22
  attr_reader :return_url
23
23
  attr_reader :cancel_url
24
+ attr_reader :summary
24
25
  attr_reader :is_chargeable
25
26
  attr_reader :created_at
27
+ attr_reader :description
28
+ attr_reader :invoice
29
+ attr_reader :invoice_id
30
+ attr_reader :manual_invoice_cancellation
26
31
 
27
32
 
28
33
  def id=(val)
@@ -113,6 +118,10 @@ module ProcessOut
113
118
  @cancel_url = val
114
119
  end
115
120
 
121
+ def summary=(val)
122
+ @summary = val
123
+ end
124
+
116
125
  def is_chargeable=(val)
117
126
  @is_chargeable = val
118
127
  end
@@ -121,6 +130,34 @@ module ProcessOut
121
130
  @created_at = val
122
131
  end
123
132
 
133
+ def description=(val)
134
+ @description = val
135
+ end
136
+
137
+ def invoice=(val)
138
+ if val.nil?
139
+ @invoice = val
140
+ return
141
+ end
142
+
143
+ if val.instance_of? Invoice
144
+ @invoice = val
145
+ else
146
+ obj = Invoice.new(@client)
147
+ obj.fill_with_data(val)
148
+ @invoice = obj
149
+ end
150
+
151
+ end
152
+
153
+ def invoice_id=(val)
154
+ @invoice_id = val
155
+ end
156
+
157
+ def manual_invoice_cancellation=(val)
158
+ @manual_invoice_cancellation = val
159
+ end
160
+
124
161
 
125
162
  # Initializes the Token object
126
163
  # Params:
@@ -142,8 +179,13 @@ module ProcessOut
142
179
  self.is_default = data.fetch(:is_default, nil)
143
180
  self.return_url = data.fetch(:return_url, nil)
144
181
  self.cancel_url = data.fetch(:cancel_url, nil)
182
+ self.summary = data.fetch(:summary, nil)
145
183
  self.is_chargeable = data.fetch(:is_chargeable, nil)
146
184
  self.created_at = data.fetch(:created_at, nil)
185
+ self.description = data.fetch(:description, nil)
186
+ self.invoice = data.fetch(:invoice, nil)
187
+ self.invoice_id = data.fetch(:invoice_id, nil)
188
+ self.manual_invoice_cancellation = data.fetch(:manual_invoice_cancellation, nil)
147
189
 
148
190
  end
149
191
 
@@ -168,8 +210,13 @@ module ProcessOut
168
210
  "is_default": self.is_default,
169
211
  "return_url": self.return_url,
170
212
  "cancel_url": self.cancel_url,
213
+ "summary": self.summary,
171
214
  "is_chargeable": self.is_chargeable,
172
215
  "created_at": self.created_at,
216
+ "description": self.description,
217
+ "invoice": self.invoice,
218
+ "invoice_id": self.invoice_id,
219
+ "manual_invoice_cancellation": self.manual_invoice_cancellation,
173
220
  }.to_json
174
221
  end
175
222
 
@@ -219,12 +266,27 @@ module ProcessOut
219
266
  if data.include? "cancel_url"
220
267
  self.cancel_url = data["cancel_url"]
221
268
  end
269
+ if data.include? "summary"
270
+ self.summary = data["summary"]
271
+ end
222
272
  if data.include? "is_chargeable"
223
273
  self.is_chargeable = data["is_chargeable"]
224
274
  end
225
275
  if data.include? "created_at"
226
276
  self.created_at = data["created_at"]
227
277
  end
278
+ if data.include? "description"
279
+ self.description = data["description"]
280
+ end
281
+ if data.include? "invoice"
282
+ self.invoice = data["invoice"]
283
+ end
284
+ if data.include? "invoice_id"
285
+ self.invoice_id = data["invoice_id"]
286
+ end
287
+ if data.include? "manual_invoice_cancellation"
288
+ self.manual_invoice_cancellation = data["manual_invoice_cancellation"]
289
+ end
228
290
 
229
291
  self
230
292
  end
@@ -249,8 +311,13 @@ module ProcessOut
249
311
  self.is_default = data.fetch(:is_default, self.is_default)
250
312
  self.return_url = data.fetch(:return_url, self.return_url)
251
313
  self.cancel_url = data.fetch(:cancel_url, self.cancel_url)
314
+ self.summary = data.fetch(:summary, self.summary)
252
315
  self.is_chargeable = data.fetch(:is_chargeable, self.is_chargeable)
253
316
  self.created_at = data.fetch(:created_at, self.created_at)
317
+ self.description = data.fetch(:description, self.description)
318
+ self.invoice = data.fetch(:invoice, self.invoice)
319
+ self.invoice_id = data.fetch(:invoice_id, self.invoice_id)
320
+ self.manual_invoice_cancellation = data.fetch(:manual_invoice_cancellation, self.manual_invoice_cancellation)
254
321
 
255
322
  self
256
323
  end
@@ -327,6 +394,9 @@ module ProcessOut
327
394
  "metadata" => @metadata,
328
395
  "return_url" => @return_url,
329
396
  "cancel_url" => @cancel_url,
397
+ "description" => @description,
398
+ "invoice_id" => @invoice_id,
399
+ "manual_invoice_cancellation" => @manual_invoice_cancellation,
330
400
  "source" => options.fetch(:source, nil),
331
401
  "settings" => options.fetch(:settings, nil),
332
402
  "device" => options.fetch(:device, nil),
@@ -38,6 +38,7 @@ module ProcessOut
38
38
  attr_reader :available_amount_local
39
39
  attr_reader :currency
40
40
  attr_reader :error_code
41
+ attr_reader :error_message
41
42
  attr_reader :gateway_name
42
43
  attr_reader :three_d_s_status
43
44
  attr_reader :status
@@ -58,6 +59,9 @@ module ProcessOut
58
59
  attr_reader :created_at
59
60
  attr_reader :chargedback_at
60
61
  attr_reader :refunded_at
62
+ attr_reader :three_d_s
63
+ attr_reader :cvc_check
64
+ attr_reader :avs_check
61
65
 
62
66
 
63
67
  def id=(val)
@@ -296,6 +300,10 @@ module ProcessOut
296
300
  @error_code = val
297
301
  end
298
302
 
303
+ def error_message=(val)
304
+ @error_message = val
305
+ end
306
+
299
307
  def gateway_name=(val)
300
308
  @gateway_name = val
301
309
  end
@@ -376,6 +384,30 @@ module ProcessOut
376
384
  @refunded_at = val
377
385
  end
378
386
 
387
+ def three_d_s=(val)
388
+ if val.nil?
389
+ @three_d_s = val
390
+ return
391
+ end
392
+
393
+ if val.instance_of? ThreeDS
394
+ @three_d_s = val
395
+ else
396
+ obj = ThreeDS.new(@client)
397
+ obj.fill_with_data(val)
398
+ @three_d_s = obj
399
+ end
400
+
401
+ end
402
+
403
+ def cvc_check=(val)
404
+ @cvc_check = val
405
+ end
406
+
407
+ def avs_check=(val)
408
+ @avs_check = val
409
+ end
410
+
379
411
 
380
412
  # Initializes the Transaction object
381
413
  # Params:
@@ -414,6 +446,7 @@ module ProcessOut
414
446
  self.available_amount_local = data.fetch(:available_amount_local, nil)
415
447
  self.currency = data.fetch(:currency, nil)
416
448
  self.error_code = data.fetch(:error_code, nil)
449
+ self.error_message = data.fetch(:error_message, nil)
417
450
  self.gateway_name = data.fetch(:gateway_name, nil)
418
451
  self.three_d_s_status = data.fetch(:three_d_s_status, nil)
419
452
  self.status = data.fetch(:status, nil)
@@ -434,6 +467,9 @@ module ProcessOut
434
467
  self.created_at = data.fetch(:created_at, nil)
435
468
  self.chargedback_at = data.fetch(:chargedback_at, nil)
436
469
  self.refunded_at = data.fetch(:refunded_at, nil)
470
+ self.three_d_s = data.fetch(:three_d_s, nil)
471
+ self.cvc_check = data.fetch(:cvc_check, nil)
472
+ self.avs_check = data.fetch(:avs_check, nil)
437
473
 
438
474
  end
439
475
 
@@ -475,6 +511,7 @@ module ProcessOut
475
511
  "available_amount_local": self.available_amount_local,
476
512
  "currency": self.currency,
477
513
  "error_code": self.error_code,
514
+ "error_message": self.error_message,
478
515
  "gateway_name": self.gateway_name,
479
516
  "three_d_s_status": self.three_d_s_status,
480
517
  "status": self.status,
@@ -495,6 +532,9 @@ module ProcessOut
495
532
  "created_at": self.created_at,
496
533
  "chargedback_at": self.chargedback_at,
497
534
  "refunded_at": self.refunded_at,
535
+ "three_d_s": self.three_d_s,
536
+ "cvc_check": self.cvc_check,
537
+ "avs_check": self.avs_check,
498
538
  }.to_json
499
539
  end
500
540
 
@@ -595,6 +635,9 @@ module ProcessOut
595
635
  if data.include? "error_code"
596
636
  self.error_code = data["error_code"]
597
637
  end
638
+ if data.include? "error_message"
639
+ self.error_message = data["error_message"]
640
+ end
598
641
  if data.include? "gateway_name"
599
642
  self.gateway_name = data["gateway_name"]
600
643
  end
@@ -655,6 +698,15 @@ module ProcessOut
655
698
  if data.include? "refunded_at"
656
699
  self.refunded_at = data["refunded_at"]
657
700
  end
701
+ if data.include? "three_d_s"
702
+ self.three_d_s = data["three_d_s"]
703
+ end
704
+ if data.include? "cvc_check"
705
+ self.cvc_check = data["cvc_check"]
706
+ end
707
+ if data.include? "avs_check"
708
+ self.avs_check = data["avs_check"]
709
+ end
658
710
 
659
711
  self
660
712
  end
@@ -696,6 +748,7 @@ module ProcessOut
696
748
  self.available_amount_local = data.fetch(:available_amount_local, self.available_amount_local)
697
749
  self.currency = data.fetch(:currency, self.currency)
698
750
  self.error_code = data.fetch(:error_code, self.error_code)
751
+ self.error_message = data.fetch(:error_message, self.error_message)
699
752
  self.gateway_name = data.fetch(:gateway_name, self.gateway_name)
700
753
  self.three_d_s_status = data.fetch(:three_d_s_status, self.three_d_s_status)
701
754
  self.status = data.fetch(:status, self.status)
@@ -716,6 +769,9 @@ module ProcessOut
716
769
  self.created_at = data.fetch(:created_at, self.created_at)
717
770
  self.chargedback_at = data.fetch(:chargedback_at, self.chargedback_at)
718
771
  self.refunded_at = data.fetch(:refunded_at, self.refunded_at)
772
+ self.three_d_s = data.fetch(:three_d_s, self.three_d_s)
773
+ self.cvc_check = data.fetch(:cvc_check, self.cvc_check)
774
+ self.avs_check = data.fetch(:avs_check, self.avs_check)
719
775
 
720
776
  self
721
777
  end
@@ -1,3 +1,3 @@
1
1
  module ProcessOut
2
- VERSION = "2.14.0"
2
+ VERSION = "2.16.0"
3
3
  end
data/lib/processout.rb CHANGED
@@ -4,6 +4,8 @@ require "processout/activity"
4
4
  require "processout/addon"
5
5
  require "processout/api_request"
6
6
  require "processout/api_version"
7
+ require "processout/balances"
8
+ require "processout/balance"
7
9
  require "processout/card"
8
10
  require "processout/card_information"
9
11
  require "processout/coupon"
@@ -14,6 +16,8 @@ require "processout/event"
14
16
  require "processout/gateway"
15
17
  require "processout/gateway_configuration"
16
18
  require "processout/invoice"
19
+ require "processout/invoice_tax"
20
+ require "processout/invoice_external_fraud_tools"
17
21
  require "processout/invoice_risk"
18
22
  require "processout/invoice_device"
19
23
  require "processout/invoice_shipping"
@@ -28,6 +32,7 @@ require "processout/project"
28
32
  require "processout/refund"
29
33
  require "processout/subscription"
30
34
  require "processout/transaction"
35
+ require "processout/three_ds"
31
36
  require "processout/payment_data_three_ds_request"
32
37
  require "processout/payment_data_network_authentication"
33
38
  require "processout/payment_data_three_ds_authentication"
@@ -66,6 +71,16 @@ module ProcessOut
66
71
  obj = APIVersion.new(self, data)
67
72
  end
68
73
 
74
+ # Create a new Balances instance
75
+ def balances(data = {})
76
+ obj = Balances.new(self, data)
77
+ end
78
+
79
+ # Create a new Balance instance
80
+ def balance(data = {})
81
+ obj = Balance.new(self, data)
82
+ end
83
+
69
84
  # Create a new Card instance
70
85
  def card(data = {})
71
86
  obj = Card.new(self, data)
@@ -116,6 +131,16 @@ module ProcessOut
116
131
  obj = Invoice.new(self, data)
117
132
  end
118
133
 
134
+ # Create a new InvoiceTax instance
135
+ def invoice_tax(data = {})
136
+ obj = InvoiceTax.new(self, data)
137
+ end
138
+
139
+ # Create a new InvoiceExternalFraudTools instance
140
+ def invoice_external_fraud_tools(data = {})
141
+ obj = InvoiceExternalFraudTools.new(self, data)
142
+ end
143
+
119
144
  # Create a new InvoiceRisk instance
120
145
  def invoice_risk(data = {})
121
146
  obj = InvoiceRisk.new(self, data)
@@ -186,6 +211,11 @@ module ProcessOut
186
211
  obj = Transaction.new(self, data)
187
212
  end
188
213
 
214
+ # Create a new ThreeDS instance
215
+ def three_ds(data = {})
216
+ obj = ThreeDS.new(self, data)
217
+ end
218
+
189
219
  # Create a new PaymentDataThreeDSRequest instance
190
220
  def payment_data_three_ds_request(data = {})
191
221
  obj = PaymentDataThreeDSRequest.new(self, data)