processout 2.12.0 → 2.15.0

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.rb +18 -0
  3. data/lib/processout/activity.rb +14 -0
  4. data/lib/processout/addon.rb +21 -0
  5. data/lib/processout/api_request.rb +21 -0
  6. data/lib/processout/api_version.rb +10 -0
  7. data/lib/processout/card.rb +79 -0
  8. data/lib/processout/card_information.rb +14 -0
  9. data/lib/processout/coupon.rb +20 -0
  10. data/lib/processout/customer.rb +62 -24
  11. data/lib/processout/customer_action.rb +9 -0
  12. data/lib/processout/discount.rb +21 -0
  13. data/lib/processout/dunning_action.rb +9 -0
  14. data/lib/processout/event.rb +14 -31
  15. data/lib/processout/gateway.rb +18 -0
  16. data/lib/processout/gateway_configuration.rb +19 -1
  17. data/lib/processout/invoice.rb +187 -1
  18. data/lib/processout/invoice_detail.rb +22 -0
  19. data/lib/processout/invoice_device.rb +20 -0
  20. data/lib/processout/invoice_external_fraud_tools.rb +70 -0
  21. data/lib/processout/invoice_risk.rb +9 -0
  22. data/lib/processout/invoice_shipping.rb +19 -0
  23. data/lib/processout/invoice_tax.rb +81 -0
  24. data/lib/processout/networking/request.rb +1 -1
  25. data/lib/processout/payment_data_network_authentication.rb +8 -0
  26. data/lib/processout/payment_data_three_ds_authentication.rb +8 -0
  27. data/lib/processout/payment_data_three_ds_request.rb +11 -0
  28. data/lib/processout/payout.rb +27 -0
  29. data/lib/processout/payout_item.rb +20 -0
  30. data/lib/processout/plan.rb +21 -0
  31. data/lib/processout/product.rb +19 -0
  32. data/lib/processout/project.rb +18 -27
  33. data/lib/processout/refund.rb +17 -0
  34. data/lib/processout/subscription.rb +42 -0
  35. data/lib/processout/three_ds.rb +103 -0
  36. data/lib/processout/token.rb +108 -23
  37. data/lib/processout/transaction.rb +113 -0
  38. data/lib/processout/transaction_operation.rb +84 -0
  39. data/lib/processout/version.rb +1 -1
  40. data/lib/processout/webhook.rb +21 -0
  41. data/lib/processout/webhook_endpoint.rb +14 -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
 
@@ -14,12 +15,16 @@ module ProcessOut
14
15
  attr_reader :token_id
15
16
  attr_reader :card
16
17
  attr_reader :card_id
18
+ attr_reader :gateway_configuration
19
+ attr_reader :gateway_configuration_id
17
20
  attr_reader :amount
21
+ attr_reader :currency
18
22
  attr_reader :is_attempt
19
23
  attr_reader :has_failed
20
24
  attr_reader :is_accountable
21
25
  attr_reader :type
22
26
  attr_reader :gateway_operation_id
27
+ attr_reader :arn
23
28
  attr_reader :error_code
24
29
  attr_reader :gateway_data
25
30
  attr_reader :payment_data_three_d_s_request
@@ -94,10 +99,34 @@ module ProcessOut
94
99
  @card_id = val
95
100
  end
96
101
 
102
+ def gateway_configuration=(val)
103
+ if val.nil?
104
+ @gateway_configuration = val
105
+ return
106
+ end
107
+
108
+ if val.instance_of? GatewayConfiguration
109
+ @gateway_configuration = val
110
+ else
111
+ obj = GatewayConfiguration.new(@client)
112
+ obj.fill_with_data(val)
113
+ @gateway_configuration = obj
114
+ end
115
+
116
+ end
117
+
118
+ def gateway_configuration_id=(val)
119
+ @gateway_configuration_id = val
120
+ end
121
+
97
122
  def amount=(val)
98
123
  @amount = val
99
124
  end
100
125
 
126
+ def currency=(val)
127
+ @currency = val
128
+ end
129
+
101
130
  def is_attempt=(val)
102
131
  @is_attempt = val
103
132
  end
@@ -118,6 +147,10 @@ module ProcessOut
118
147
  @gateway_operation_id = val
119
148
  end
120
149
 
150
+ def arn=(val)
151
+ @arn = val
152
+ end
153
+
121
154
  def error_code=(val)
122
155
  @error_code = val
123
156
  end
@@ -201,12 +234,16 @@ module ProcessOut
201
234
  self.token_id = data.fetch(:token_id, nil)
202
235
  self.card = data.fetch(:card, nil)
203
236
  self.card_id = data.fetch(:card_id, nil)
237
+ self.gateway_configuration = data.fetch(:gateway_configuration, nil)
238
+ self.gateway_configuration_id = data.fetch(:gateway_configuration_id, nil)
204
239
  self.amount = data.fetch(:amount, nil)
240
+ self.currency = data.fetch(:currency, nil)
205
241
  self.is_attempt = data.fetch(:is_attempt, nil)
206
242
  self.has_failed = data.fetch(:has_failed, nil)
207
243
  self.is_accountable = data.fetch(:is_accountable, nil)
208
244
  self.type = data.fetch(:type, nil)
209
245
  self.gateway_operation_id = data.fetch(:gateway_operation_id, nil)
246
+ self.arn = data.fetch(:arn, nil)
210
247
  self.error_code = data.fetch(:error_code, nil)
211
248
  self.gateway_data = data.fetch(:gateway_data, nil)
212
249
  self.payment_data_three_d_s_request = data.fetch(:payment_data_three_d_s_request, nil)
@@ -223,6 +260,37 @@ module ProcessOut
223
260
  TransactionOperation.new(@client, data)
224
261
  end
225
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
+
226
294
  # Fills the object with data coming from the API
227
295
  # Params:
228
296
  # +data+:: +Hash+ of data coming from the API
@@ -251,9 +319,18 @@ module ProcessOut
251
319
  if data.include? "card_id"
252
320
  self.card_id = data["card_id"]
253
321
  end
322
+ if data.include? "gateway_configuration"
323
+ self.gateway_configuration = data["gateway_configuration"]
324
+ end
325
+ if data.include? "gateway_configuration_id"
326
+ self.gateway_configuration_id = data["gateway_configuration_id"]
327
+ end
254
328
  if data.include? "amount"
255
329
  self.amount = data["amount"]
256
330
  end
331
+ if data.include? "currency"
332
+ self.currency = data["currency"]
333
+ end
257
334
  if data.include? "is_attempt"
258
335
  self.is_attempt = data["is_attempt"]
259
336
  end
@@ -269,6 +346,9 @@ module ProcessOut
269
346
  if data.include? "gateway_operation_id"
270
347
  self.gateway_operation_id = data["gateway_operation_id"]
271
348
  end
349
+ if data.include? "arn"
350
+ self.arn = data["arn"]
351
+ end
272
352
  if data.include? "error_code"
273
353
  self.error_code = data["error_code"]
274
354
  end
@@ -311,12 +391,16 @@ module ProcessOut
311
391
  self.token_id = data.fetch(:token_id, self.token_id)
312
392
  self.card = data.fetch(:card, self.card)
313
393
  self.card_id = data.fetch(:card_id, self.card_id)
394
+ self.gateway_configuration = data.fetch(:gateway_configuration, self.gateway_configuration)
395
+ self.gateway_configuration_id = data.fetch(:gateway_configuration_id, self.gateway_configuration_id)
314
396
  self.amount = data.fetch(:amount, self.amount)
397
+ self.currency = data.fetch(:currency, self.currency)
315
398
  self.is_attempt = data.fetch(:is_attempt, self.is_attempt)
316
399
  self.has_failed = data.fetch(:has_failed, self.has_failed)
317
400
  self.is_accountable = data.fetch(:is_accountable, self.is_accountable)
318
401
  self.type = data.fetch(:type, self.type)
319
402
  self.gateway_operation_id = data.fetch(:gateway_operation_id, self.gateway_operation_id)
403
+ self.arn = data.fetch(:arn, self.arn)
320
404
  self.error_code = data.fetch(:error_code, self.error_code)
321
405
  self.gateway_data = data.fetch(:gateway_data, self.gateway_data)
322
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.12.0"
2
+ VERSION = "2.15.0"
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
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.12.0
4
+ version: 2.15.0
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-06-24 00:00:00.000000000 Z
11
+ date: 2021-08-11 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