processout 2.13.0 → 2.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +5 -5
  2. data/lib/processout/activity.rb +14 -0
  3. data/lib/processout/addon.rb +21 -0
  4. data/lib/processout/api_request.rb +21 -0
  5. data/lib/processout/api_version.rb +10 -0
  6. data/lib/processout/card.rb +79 -0
  7. data/lib/processout/card_information.rb +14 -0
  8. data/lib/processout/coupon.rb +20 -0
  9. data/lib/processout/customer.rb +62 -24
  10. data/lib/processout/customer_action.rb +9 -0
  11. data/lib/processout/discount.rb +21 -0
  12. data/lib/processout/dunning_action.rb +9 -0
  13. data/lib/processout/event.rb +14 -31
  14. data/lib/processout/gateway.rb +18 -0
  15. data/lib/processout/gateway_configuration.rb +18 -0
  16. data/lib/processout/invoice.rb +166 -2
  17. data/lib/processout/invoice_detail.rb +22 -0
  18. data/lib/processout/invoice_device.rb +20 -0
  19. data/lib/processout/invoice_external_fraud_tools.rb +70 -0
  20. data/lib/processout/invoice_risk.rb +9 -0
  21. data/lib/processout/invoice_shipping.rb +19 -0
  22. data/lib/processout/invoice_tax.rb +81 -0
  23. data/lib/processout/networking/request.rb +1 -1
  24. data/lib/processout/payment_data_network_authentication.rb +8 -0
  25. data/lib/processout/payment_data_three_ds_authentication.rb +8 -0
  26. data/lib/processout/payment_data_three_ds_request.rb +11 -0
  27. data/lib/processout/payout.rb +27 -0
  28. data/lib/processout/payout_item.rb +20 -0
  29. data/lib/processout/plan.rb +21 -0
  30. data/lib/processout/product.rb +19 -0
  31. data/lib/processout/project.rb +18 -27
  32. data/lib/processout/refund.rb +17 -0
  33. data/lib/processout/subscription.rb +42 -0
  34. data/lib/processout/three_ds.rb +158 -0
  35. data/lib/processout/token.rb +93 -30
  36. data/lib/processout/transaction.rb +113 -0
  37. data/lib/processout/transaction_operation.rb +52 -0
  38. data/lib/processout/version.rb +1 -1
  39. data/lib/processout/webhook.rb +21 -0
  40. data/lib/processout/webhook_endpoint.rb +14 -0
  41. data/lib/processout.rb +18 -0
  42. metadata +6 -4
@@ -1,6 +1,7 @@
1
1
  # The content of this file was automatically generated
2
2
 
3
3
  require "cgi"
4
+ require "json"
4
5
  require "processout/networking/request"
5
6
  require "processout/networking/response"
6
7
 
@@ -37,6 +38,7 @@ module ProcessOut
37
38
  attr_reader :available_amount_local
38
39
  attr_reader :currency
39
40
  attr_reader :error_code
41
+ attr_reader :error_message
40
42
  attr_reader :gateway_name
41
43
  attr_reader :three_d_s_status
42
44
  attr_reader :status
@@ -57,6 +59,9 @@ module ProcessOut
57
59
  attr_reader :created_at
58
60
  attr_reader :chargedback_at
59
61
  attr_reader :refunded_at
62
+ attr_reader :three_d_s
63
+ attr_reader :cvc_check
64
+ attr_reader :avs_check
60
65
 
61
66
 
62
67
  def id=(val)
@@ -295,6 +300,10 @@ module ProcessOut
295
300
  @error_code = val
296
301
  end
297
302
 
303
+ def error_message=(val)
304
+ @error_message = val
305
+ end
306
+
298
307
  def gateway_name=(val)
299
308
  @gateway_name = val
300
309
  end
@@ -375,6 +384,30 @@ module ProcessOut
375
384
  @refunded_at = val
376
385
  end
377
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
+
378
411
 
379
412
  # Initializes the Transaction object
380
413
  # Params:
@@ -413,6 +446,7 @@ module ProcessOut
413
446
  self.available_amount_local = data.fetch(:available_amount_local, nil)
414
447
  self.currency = data.fetch(:currency, nil)
415
448
  self.error_code = data.fetch(:error_code, nil)
449
+ self.error_message = data.fetch(:error_message, nil)
416
450
  self.gateway_name = data.fetch(:gateway_name, nil)
417
451
  self.three_d_s_status = data.fetch(:three_d_s_status, nil)
418
452
  self.status = data.fetch(:status, nil)
@@ -433,6 +467,9 @@ module ProcessOut
433
467
  self.created_at = data.fetch(:created_at, nil)
434
468
  self.chargedback_at = data.fetch(:chargedback_at, nil)
435
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)
436
473
 
437
474
  end
438
475
 
@@ -441,6 +478,66 @@ module ProcessOut
441
478
  Transaction.new(@client, data)
442
479
  end
443
480
 
481
+ # Overrides the JSON marshaller to only send the fields we want
482
+ def to_json(options)
483
+ {
484
+ "id": self.id,
485
+ "project": self.project,
486
+ "project_id": self.project_id,
487
+ "invoice": self.invoice,
488
+ "invoice_id": self.invoice_id,
489
+ "customer": self.customer,
490
+ "customer_id": self.customer_id,
491
+ "subscription": self.subscription,
492
+ "subscription_id": self.subscription_id,
493
+ "token": self.token,
494
+ "token_id": self.token_id,
495
+ "card": self.card,
496
+ "card_id": self.card_id,
497
+ "gateway_configuration": self.gateway_configuration,
498
+ "gateway_configuration_id": self.gateway_configuration_id,
499
+ "operations": self.operations,
500
+ "refunds": self.refunds,
501
+ "name": self.name,
502
+ "amount": self.amount,
503
+ "amount_local": self.amount_local,
504
+ "authorized_amount": self.authorized_amount,
505
+ "authorized_amount_local": self.authorized_amount_local,
506
+ "captured_amount": self.captured_amount,
507
+ "captured_amount_local": self.captured_amount_local,
508
+ "refunded_amount": self.refunded_amount,
509
+ "refunded_amount_local": self.refunded_amount_local,
510
+ "available_amount": self.available_amount,
511
+ "available_amount_local": self.available_amount_local,
512
+ "currency": self.currency,
513
+ "error_code": self.error_code,
514
+ "error_message": self.error_message,
515
+ "gateway_name": self.gateway_name,
516
+ "three_d_s_status": self.three_d_s_status,
517
+ "status": self.status,
518
+ "authorized": self.authorized,
519
+ "captured": self.captured,
520
+ "voided": self.voided,
521
+ "refunded": self.refunded,
522
+ "chargedback": self.chargedback,
523
+ "received_fraud_notification": self.received_fraud_notification,
524
+ "received_retrieval_request": self.received_retrieval_request,
525
+ "processout_fee": self.processout_fee,
526
+ "estimated_fee": self.estimated_fee,
527
+ "gateway_fee": self.gateway_fee,
528
+ "gateway_fee_local": self.gateway_fee_local,
529
+ "currency_fee": self.currency_fee,
530
+ "metadata": self.metadata,
531
+ "sandbox": self.sandbox,
532
+ "created_at": self.created_at,
533
+ "chargedback_at": self.chargedback_at,
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,
538
+ }.to_json
539
+ end
540
+
444
541
  # Fills the object with data coming from the API
445
542
  # Params:
446
543
  # +data+:: +Hash+ of data coming from the API
@@ -538,6 +635,9 @@ module ProcessOut
538
635
  if data.include? "error_code"
539
636
  self.error_code = data["error_code"]
540
637
  end
638
+ if data.include? "error_message"
639
+ self.error_message = data["error_message"]
640
+ end
541
641
  if data.include? "gateway_name"
542
642
  self.gateway_name = data["gateway_name"]
543
643
  end
@@ -598,6 +698,15 @@ module ProcessOut
598
698
  if data.include? "refunded_at"
599
699
  self.refunded_at = data["refunded_at"]
600
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
601
710
 
602
711
  self
603
712
  end
@@ -639,6 +748,7 @@ module ProcessOut
639
748
  self.available_amount_local = data.fetch(:available_amount_local, self.available_amount_local)
640
749
  self.currency = data.fetch(:currency, self.currency)
641
750
  self.error_code = data.fetch(:error_code, self.error_code)
751
+ self.error_message = data.fetch(:error_message, self.error_message)
642
752
  self.gateway_name = data.fetch(:gateway_name, self.gateway_name)
643
753
  self.three_d_s_status = data.fetch(:three_d_s_status, self.three_d_s_status)
644
754
  self.status = data.fetch(:status, self.status)
@@ -659,6 +769,9 @@ module ProcessOut
659
769
  self.created_at = data.fetch(:created_at, self.created_at)
660
770
  self.chargedback_at = data.fetch(:chargedback_at, self.chargedback_at)
661
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)
662
775
 
663
776
  self
664
777
  end
@@ -1,6 +1,7 @@
1
1
  # The content of this file was automatically generated
2
2
 
3
3
  require "cgi"
4
+ require "json"
4
5
  require "processout/networking/request"
5
6
  require "processout/networking/response"
6
7
 
@@ -17,11 +18,13 @@ module ProcessOut
17
18
  attr_reader :gateway_configuration
18
19
  attr_reader :gateway_configuration_id
19
20
  attr_reader :amount
21
+ attr_reader :currency
20
22
  attr_reader :is_attempt
21
23
  attr_reader :has_failed
22
24
  attr_reader :is_accountable
23
25
  attr_reader :type
24
26
  attr_reader :gateway_operation_id
27
+ attr_reader :arn
25
28
  attr_reader :error_code
26
29
  attr_reader :gateway_data
27
30
  attr_reader :payment_data_three_d_s_request
@@ -120,6 +123,10 @@ module ProcessOut
120
123
  @amount = val
121
124
  end
122
125
 
126
+ def currency=(val)
127
+ @currency = val
128
+ end
129
+
123
130
  def is_attempt=(val)
124
131
  @is_attempt = val
125
132
  end
@@ -140,6 +147,10 @@ module ProcessOut
140
147
  @gateway_operation_id = val
141
148
  end
142
149
 
150
+ def arn=(val)
151
+ @arn = val
152
+ end
153
+
143
154
  def error_code=(val)
144
155
  @error_code = val
145
156
  end
@@ -226,11 +237,13 @@ module ProcessOut
226
237
  self.gateway_configuration = data.fetch(:gateway_configuration, nil)
227
238
  self.gateway_configuration_id = data.fetch(:gateway_configuration_id, nil)
228
239
  self.amount = data.fetch(:amount, nil)
240
+ self.currency = data.fetch(:currency, nil)
229
241
  self.is_attempt = data.fetch(:is_attempt, nil)
230
242
  self.has_failed = data.fetch(:has_failed, nil)
231
243
  self.is_accountable = data.fetch(:is_accountable, nil)
232
244
  self.type = data.fetch(:type, nil)
233
245
  self.gateway_operation_id = data.fetch(:gateway_operation_id, nil)
246
+ self.arn = data.fetch(:arn, nil)
234
247
  self.error_code = data.fetch(:error_code, nil)
235
248
  self.gateway_data = data.fetch(:gateway_data, nil)
236
249
  self.payment_data_three_d_s_request = data.fetch(:payment_data_three_d_s_request, nil)
@@ -247,6 +260,37 @@ module ProcessOut
247
260
  TransactionOperation.new(@client, data)
248
261
  end
249
262
 
263
+ # Overrides the JSON marshaller to only send the fields we want
264
+ def to_json(options)
265
+ {
266
+ "id": self.id,
267
+ "transaction": self.transaction,
268
+ "transaction_id": self.transaction_id,
269
+ "token": self.token,
270
+ "token_id": self.token_id,
271
+ "card": self.card,
272
+ "card_id": self.card_id,
273
+ "gateway_configuration": self.gateway_configuration,
274
+ "gateway_configuration_id": self.gateway_configuration_id,
275
+ "amount": self.amount,
276
+ "currency": self.currency,
277
+ "is_attempt": self.is_attempt,
278
+ "has_failed": self.has_failed,
279
+ "is_accountable": self.is_accountable,
280
+ "type": self.type,
281
+ "gateway_operation_id": self.gateway_operation_id,
282
+ "arn": self.arn,
283
+ "error_code": self.error_code,
284
+ "gateway_data": self.gateway_data,
285
+ "payment_data_three_d_s_request": self.payment_data_three_d_s_request,
286
+ "payment_data_three_d_s_authentication": self.payment_data_three_d_s_authentication,
287
+ "payment_data_network_authentication": self.payment_data_network_authentication,
288
+ "metadata": self.metadata,
289
+ "gateway_fee": self.gateway_fee,
290
+ "created_at": self.created_at,
291
+ }.to_json
292
+ end
293
+
250
294
  # Fills the object with data coming from the API
251
295
  # Params:
252
296
  # +data+:: +Hash+ of data coming from the API
@@ -284,6 +328,9 @@ module ProcessOut
284
328
  if data.include? "amount"
285
329
  self.amount = data["amount"]
286
330
  end
331
+ if data.include? "currency"
332
+ self.currency = data["currency"]
333
+ end
287
334
  if data.include? "is_attempt"
288
335
  self.is_attempt = data["is_attempt"]
289
336
  end
@@ -299,6 +346,9 @@ module ProcessOut
299
346
  if data.include? "gateway_operation_id"
300
347
  self.gateway_operation_id = data["gateway_operation_id"]
301
348
  end
349
+ if data.include? "arn"
350
+ self.arn = data["arn"]
351
+ end
302
352
  if data.include? "error_code"
303
353
  self.error_code = data["error_code"]
304
354
  end
@@ -344,11 +394,13 @@ module ProcessOut
344
394
  self.gateway_configuration = data.fetch(:gateway_configuration, self.gateway_configuration)
345
395
  self.gateway_configuration_id = data.fetch(:gateway_configuration_id, self.gateway_configuration_id)
346
396
  self.amount = data.fetch(:amount, self.amount)
397
+ self.currency = data.fetch(:currency, self.currency)
347
398
  self.is_attempt = data.fetch(:is_attempt, self.is_attempt)
348
399
  self.has_failed = data.fetch(:has_failed, self.has_failed)
349
400
  self.is_accountable = data.fetch(:is_accountable, self.is_accountable)
350
401
  self.type = data.fetch(:type, self.type)
351
402
  self.gateway_operation_id = data.fetch(:gateway_operation_id, self.gateway_operation_id)
403
+ self.arn = data.fetch(:arn, self.arn)
352
404
  self.error_code = data.fetch(:error_code, self.error_code)
353
405
  self.gateway_data = data.fetch(:gateway_data, self.gateway_data)
354
406
  self.payment_data_three_d_s_request = data.fetch(:payment_data_three_d_s_request, self.payment_data_three_d_s_request)
@@ -1,3 +1,3 @@
1
1
  module ProcessOut
2
- VERSION = "2.13.0"
2
+ VERSION = "2.15.1"
3
3
  end
@@ -1,6 +1,7 @@
1
1
  # The content of this file was automatically generated
2
2
 
3
3
  require "cgi"
4
+ require "json"
4
5
  require "processout/networking/request"
5
6
  require "processout/networking/response"
6
7
 
@@ -133,6 +134,26 @@ module ProcessOut
133
134
  Webhook.new(@client, data)
134
135
  end
135
136
 
137
+ # Overrides the JSON marshaller to only send the fields we want
138
+ def to_json(options)
139
+ {
140
+ "id": self.id,
141
+ "project": self.project,
142
+ "project_id": self.project_id,
143
+ "event": self.event,
144
+ "event_id": self.event_id,
145
+ "request_url": self.request_url,
146
+ "request_method": self.request_method,
147
+ "response_body": self.response_body,
148
+ "response_code": self.response_code,
149
+ "response_headers": self.response_headers,
150
+ "response_time_ms": self.response_time_ms,
151
+ "status": self.status,
152
+ "created_at": self.created_at,
153
+ "release_at": self.release_at,
154
+ }.to_json
155
+ end
156
+
136
157
  # Fills the object with data coming from the API
137
158
  # Params:
138
159
  # +data+:: +Hash+ of data coming from the API
@@ -1,6 +1,7 @@
1
1
  # The content of this file was automatically generated
2
2
 
3
3
  require "cgi"
4
+ require "json"
4
5
  require "processout/networking/request"
5
6
  require "processout/networking/response"
6
7
 
@@ -80,6 +81,19 @@ module ProcessOut
80
81
  WebhookEndpoint.new(@client, data)
81
82
  end
82
83
 
84
+ # Overrides the JSON marshaller to only send the fields we want
85
+ def to_json(options)
86
+ {
87
+ "id": self.id,
88
+ "project": self.project,
89
+ "project_id": self.project_id,
90
+ "url": self.url,
91
+ "events_whitelist": self.events_whitelist,
92
+ "sandbox": self.sandbox,
93
+ "created_at": self.created_at,
94
+ }.to_json
95
+ end
96
+
83
97
  # Fills the object with data coming from the API
84
98
  # Params:
85
99
  # +data+:: +Hash+ of data coming from the API
data/lib/processout.rb CHANGED
@@ -14,6 +14,8 @@ require "processout/event"
14
14
  require "processout/gateway"
15
15
  require "processout/gateway_configuration"
16
16
  require "processout/invoice"
17
+ require "processout/invoice_tax"
18
+ require "processout/invoice_external_fraud_tools"
17
19
  require "processout/invoice_risk"
18
20
  require "processout/invoice_device"
19
21
  require "processout/invoice_shipping"
@@ -28,6 +30,7 @@ require "processout/project"
28
30
  require "processout/refund"
29
31
  require "processout/subscription"
30
32
  require "processout/transaction"
33
+ require "processout/three_ds"
31
34
  require "processout/payment_data_three_ds_request"
32
35
  require "processout/payment_data_network_authentication"
33
36
  require "processout/payment_data_three_ds_authentication"
@@ -116,6 +119,16 @@ module ProcessOut
116
119
  obj = Invoice.new(self, data)
117
120
  end
118
121
 
122
+ # Create a new InvoiceTax instance
123
+ def invoice_tax(data = {})
124
+ obj = InvoiceTax.new(self, data)
125
+ end
126
+
127
+ # Create a new InvoiceExternalFraudTools instance
128
+ def invoice_external_fraud_tools(data = {})
129
+ obj = InvoiceExternalFraudTools.new(self, data)
130
+ end
131
+
119
132
  # Create a new InvoiceRisk instance
120
133
  def invoice_risk(data = {})
121
134
  obj = InvoiceRisk.new(self, data)
@@ -186,6 +199,11 @@ module ProcessOut
186
199
  obj = Transaction.new(self, data)
187
200
  end
188
201
 
202
+ # Create a new ThreeDS instance
203
+ def three_ds(data = {})
204
+ obj = ThreeDS.new(self, data)
205
+ end
206
+
189
207
  # Create a new PaymentDataThreeDSRequest instance
190
208
  def payment_data_three_ds_request(data = {})
191
209
  obj = PaymentDataThreeDSRequest.new(self, data)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: processout
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.0
4
+ version: 2.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel HUEZ
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-05 00:00:00.000000000 Z
11
+ date: 2021-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,8 +94,10 @@ files:
94
94
  - lib/processout/invoice.rb
95
95
  - lib/processout/invoice_detail.rb
96
96
  - lib/processout/invoice_device.rb
97
+ - lib/processout/invoice_external_fraud_tools.rb
97
98
  - lib/processout/invoice_risk.rb
98
99
  - lib/processout/invoice_shipping.rb
100
+ - lib/processout/invoice_tax.rb
99
101
  - lib/processout/networking/request.rb
100
102
  - lib/processout/networking/response.rb
101
103
  - lib/processout/payment_data_network_authentication.rb
@@ -108,6 +110,7 @@ files:
108
110
  - lib/processout/project.rb
109
111
  - lib/processout/refund.rb
110
112
  - lib/processout/subscription.rb
113
+ - lib/processout/three_ds.rb
111
114
  - lib/processout/token.rb
112
115
  - lib/processout/transaction.rb
113
116
  - lib/processout/transaction_operation.rb
@@ -134,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
137
  - !ruby/object:Gem::Version
135
138
  version: '0'
136
139
  requirements: []
137
- rubyforge_project:
138
- rubygems_version: 2.5.2.3
140
+ rubygems_version: 3.0.3
139
141
  signing_key:
140
142
  specification_version: 4
141
143
  summary: Ruby bindings for the ProcessOut API