processout 3.3.0 → 4.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75601257145ef1eb4375638b5ca39be8b73645409ab8a7cf25f1d8d6b65b58e1
4
- data.tar.gz: e23c62e04974f47300b5904bf3e3eb5a4d331c236a8e14696baca24e6784ee75
3
+ metadata.gz: 5cca154d785d4ab7d1e60045fac97155a5ff15d75c57c0d23e6f0dfcce51605d
4
+ data.tar.gz: 5c832d14a0ffb515c64fd6c8be214da96a854caf5807c301e3e0310a095039a4
5
5
  SHA512:
6
- metadata.gz: a6d3bfc576fcbb6b4789d12a5be1e70e5d5f6b9878f29dd5a34e26a83e1c6312b1360846cfca14fc42630d847aa9d329744515201cdc03b1f80fea136737f724
7
- data.tar.gz: f5d3980b0c3d7b859ece2d75f5c46af5a296582b08e38d81c53f36206a4251e76b6189e8f9869e46fba697c4694dc3d424b9b589b39f7f31978e5fbd813e2727
6
+ metadata.gz: 154af01e3524d295aeb9a9ee8b3217466d36e1adabc681f9f5d1d3be1d894827543c9cd810bc5317f4cbbdddf2b71b3ffe2999de0f0f231a74c3d1ec1faecaba
7
+ data.tar.gz: 5b7ca8873a882e0647e6ff7e9b6c0bc2e12f96a5046ee131c4649d01023662c647b4030a53b1a722f21e265032b513824abb397ef1017c9f9e434cb8c0c7edc4
@@ -190,7 +190,7 @@ module ProcessOut
190
190
  return_values = Array.new
191
191
 
192
192
  body = response.body
193
- body = body["activity"]
193
+ body = body.key?("activity") ? body["activity"] : nil
194
194
 
195
195
 
196
196
  obj = Activity.new(@client)
@@ -299,7 +299,7 @@ module ProcessOut
299
299
  return_values = Array.new
300
300
 
301
301
  body = response.body
302
- body = body["addon"]
302
+ body = body.key?("addon") ? body["addon"] : nil
303
303
 
304
304
 
305
305
  return_values.push(self.fill_with_data(body))
@@ -327,7 +327,7 @@ module ProcessOut
327
327
  return_values = Array.new
328
328
 
329
329
  body = response.body
330
- body = body["addon"]
330
+ body = body.key?("addon") ? body["addon"] : nil
331
331
 
332
332
 
333
333
  obj = Addon.new(@client)
@@ -363,7 +363,7 @@ module ProcessOut
363
363
  return_values = Array.new
364
364
 
365
365
  body = response.body
366
- body = body["addon"]
366
+ body = body.key?("addon") ? body["addon"] : nil
367
367
 
368
368
 
369
369
  return_values.push(self.fill_with_data(body))
@@ -81,9 +81,11 @@ module ProcessOut
81
81
  return_values = Array.new
82
82
 
83
83
  body = response.body
84
- body = body["alternative_merchant_certificate"]
85
- alternative_merchant_certificate = AlternativeMerchantCertificate.new(@client)
86
- return_values.push(alternative_merchant_certificate.fill_with_data(body))
84
+ body = body.key?("alternative_merchant_certificate") ? body["alternative_merchant_certificate"] : nil
85
+ if !body.nil?
86
+ alternative_merchant_certificate = AlternativeMerchantCertificate.new(@client)
87
+ return_values.push(alternative_merchant_certificate.fill_with_data(body))
88
+ end
87
89
 
88
90
 
89
91
  return_values[0]
@@ -108,9 +108,11 @@ module ProcessOut
108
108
  return_values = Array.new
109
109
 
110
110
  body = response.body
111
- body = body["applepay_certificates"]
112
- apple_pay_alternative_merchant_certificates = ApplePayAlternativeMerchantCertificates.new(@client)
113
- return_values.push(apple_pay_alternative_merchant_certificates.fill_with_data(body))
111
+ body = body.key?("applepay_certificates") ? body["applepay_certificates"] : nil
112
+ if !body.nil?
113
+ apple_pay_alternative_merchant_certificates = ApplePayAlternativeMerchantCertificates.new(@client)
114
+ return_values.push(apple_pay_alternative_merchant_certificates.fill_with_data(body))
115
+ end
114
116
 
115
117
 
116
118
  return_values[0]
@@ -9,6 +9,8 @@ module ProcessOut
9
9
  class Balances
10
10
 
11
11
  attr_reader :vouchers
12
+ attr_reader :available_balance
13
+ attr_reader :customer_action
12
14
 
13
15
 
14
16
  def vouchers=(val)
@@ -31,6 +33,38 @@ module ProcessOut
31
33
 
32
34
  end
33
35
 
36
+ def available_balance=(val)
37
+ if val.nil?
38
+ @available_balance = val
39
+ return
40
+ end
41
+
42
+ if val.instance_of? Balance
43
+ @available_balance = val
44
+ else
45
+ obj = Balance.new(@client)
46
+ obj.fill_with_data(val)
47
+ @available_balance = obj
48
+ end
49
+
50
+ end
51
+
52
+ def customer_action=(val)
53
+ if val.nil?
54
+ @customer_action = val
55
+ return
56
+ end
57
+
58
+ if val.instance_of? BalancesCustomerAction
59
+ @customer_action = val
60
+ else
61
+ obj = BalancesCustomerAction.new(@client)
62
+ obj.fill_with_data(val)
63
+ @customer_action = obj
64
+ end
65
+
66
+ end
67
+
34
68
 
35
69
  # Initializes the Balances object
36
70
  # Params:
@@ -40,6 +74,8 @@ module ProcessOut
40
74
  @client = client
41
75
 
42
76
  self.vouchers = data.fetch(:vouchers, nil)
77
+ self.available_balance = data.fetch(:available_balance, nil)
78
+ self.customer_action = data.fetch(:customer_action, nil)
43
79
 
44
80
  end
45
81
 
@@ -52,6 +88,8 @@ module ProcessOut
52
88
  def to_json(options)
53
89
  {
54
90
  "vouchers": self.vouchers,
91
+ "available_balance": self.available_balance,
92
+ "customer_action": self.customer_action,
55
93
  }.to_json
56
94
  end
57
95
 
@@ -65,6 +103,12 @@ module ProcessOut
65
103
  if data.include? "vouchers"
66
104
  self.vouchers = data["vouchers"]
67
105
  end
106
+ if data.include? "available_balance"
107
+ self.available_balance = data["available_balance"]
108
+ end
109
+ if data.include? "customer_action"
110
+ self.customer_action = data["customer_action"]
111
+ end
68
112
 
69
113
  self
70
114
  end
@@ -77,6 +121,8 @@ module ProcessOut
77
121
  return self
78
122
  end
79
123
  self.vouchers = data.fetch(:vouchers, self.vouchers)
124
+ self.available_balance = data.fetch(:available_balance, self.available_balance)
125
+ self.customer_action = data.fetch(:customer_action, self.customer_action)
80
126
 
81
127
  self
82
128
  end
@@ -98,9 +144,11 @@ module ProcessOut
98
144
  return_values = Array.new
99
145
 
100
146
  body = response.body
101
- body = body["balances"]
102
- balances = Balances.new(@client)
103
- return_values.push(balances.fill_with_data(body))
147
+ body = body.key?("balances") ? body["balances"] : nil
148
+ if !body.nil?
149
+ balances = Balances.new(@client)
150
+ return_values.push(balances.fill_with_data(body))
151
+ end
104
152
 
105
153
 
106
154
  return_values[0]
@@ -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 BalancesCustomerAction
10
+
11
+ attr_reader :type
12
+ attr_reader :value
13
+
14
+
15
+ def type=(val)
16
+ @type = val
17
+ end
18
+
19
+ def value=(val)
20
+ @value = val
21
+ end
22
+
23
+
24
+ # Initializes the BalancesCustomerAction 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.type = data.fetch(:type, nil)
32
+ self.value = data.fetch(:value, nil)
33
+
34
+ end
35
+
36
+ # Create a new BalancesCustomerAction using the current client
37
+ def new(data = {})
38
+ BalancesCustomerAction.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
+ "type": self.type,
45
+ "value": self.value,
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? "type"
57
+ self.type = data["type"]
58
+ end
59
+ if data.include? "value"
60
+ self.value = data["value"]
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.type = data.fetch(:type, self.type)
74
+ self.value = data.fetch(:value, self.value)
75
+
76
+ self
77
+ end
78
+
79
+
80
+ end
81
+ end
@@ -488,7 +488,7 @@ module ProcessOut
488
488
  return_values = Array.new
489
489
 
490
490
  body = response.body
491
- body = body["card"]
491
+ body = body.key?("card") ? body["card"] : nil
492
492
 
493
493
 
494
494
  obj = Card.new(@client)
@@ -309,7 +309,7 @@ module ProcessOut
309
309
  return_values = Array.new
310
310
 
311
311
  body = response.body
312
- body = body["card"]
312
+ body = body.key?("card") ? body["card"] : nil
313
313
 
314
314
 
315
315
  return_values.push(self.fill_with_data(body))
@@ -148,7 +148,7 @@ module ProcessOut
148
148
  return_values = Array.new
149
149
 
150
150
  body = response.body
151
- body = body["card_information"]
151
+ body = body.key?("card_information") ? body["card_information"] : nil
152
152
 
153
153
 
154
154
  obj = CardInformation.new(@client)
@@ -82,7 +82,7 @@ module ProcessOut
82
82
  return_values = Array.new
83
83
 
84
84
  body = response.body
85
- body = body["card"]
85
+ body = body.key?("card") ? body["card"] : nil
86
86
 
87
87
 
88
88
  return_values.push(self.fill_with_data(body))
@@ -262,7 +262,7 @@ module ProcessOut
262
262
  return_values = Array.new
263
263
 
264
264
  body = response.body
265
- body = body["coupon"]
265
+ body = body.key?("coupon") ? body["coupon"] : nil
266
266
 
267
267
 
268
268
  return_values.push(self.fill_with_data(body))
@@ -289,7 +289,7 @@ module ProcessOut
289
289
  return_values = Array.new
290
290
 
291
291
  body = response.body
292
- body = body["coupon"]
292
+ body = body.key?("coupon") ? body["coupon"] : nil
293
293
 
294
294
 
295
295
  obj = Coupon.new(@client)
@@ -316,7 +316,7 @@ module ProcessOut
316
316
  return_values = Array.new
317
317
 
318
318
  body = response.body
319
- body = body["coupon"]
319
+ body = body.key?("coupon") ? body["coupon"] : nil
320
320
 
321
321
 
322
322
  return_values.push(self.fill_with_data(body))
@@ -39,6 +39,7 @@ module ProcessOut
39
39
  attr_reader :created_at
40
40
  attr_reader :registered_at
41
41
  attr_reader :date_of_birth
42
+ attr_reader :reference_id
42
43
 
43
44
 
44
45
  def id=(val)
@@ -249,6 +250,10 @@ module ProcessOut
249
250
  @date_of_birth = val
250
251
  end
251
252
 
253
+ def reference_id=(val)
254
+ @reference_id = val
255
+ end
256
+
252
257
 
253
258
  # Initializes the Customer object
254
259
  # Params:
@@ -288,6 +293,7 @@ module ProcessOut
288
293
  self.created_at = data.fetch(:created_at, nil)
289
294
  self.registered_at = data.fetch(:registered_at, nil)
290
295
  self.date_of_birth = data.fetch(:date_of_birth, nil)
296
+ self.reference_id = data.fetch(:reference_id, nil)
291
297
 
292
298
  end
293
299
 
@@ -330,6 +336,7 @@ module ProcessOut
330
336
  "created_at": self.created_at,
331
337
  "registered_at": self.registered_at,
332
338
  "date_of_birth": self.date_of_birth,
339
+ "reference_id": self.reference_id,
333
340
  }.to_json
334
341
  end
335
342
 
@@ -433,6 +440,9 @@ module ProcessOut
433
440
  if data.include? "date_of_birth"
434
441
  self.date_of_birth = data["date_of_birth"]
435
442
  end
443
+ if data.include? "reference_id"
444
+ self.reference_id = data["reference_id"]
445
+ end
436
446
 
437
447
  self
438
448
  end
@@ -475,6 +485,7 @@ module ProcessOut
475
485
  self.created_at = data.fetch(:created_at, self.created_at)
476
486
  self.registered_at = data.fetch(:registered_at, self.registered_at)
477
487
  self.date_of_birth = data.fetch(:date_of_birth, self.date_of_birth)
488
+ self.reference_id = data.fetch(:reference_id, self.reference_id)
478
489
 
479
490
  self
480
491
  end
@@ -556,9 +567,11 @@ module ProcessOut
556
567
  return_values = Array.new
557
568
 
558
569
  body = response.body
559
- body = body["token"]
560
- token = Token.new(@client)
561
- return_values.push(token.fill_with_data(body))
570
+ body = body.key?("token") ? body["token"] : nil
571
+ if !body.nil?
572
+ token = Token.new(@client)
573
+ return_values.push(token.fill_with_data(body))
574
+ end
562
575
 
563
576
 
564
577
  return_values[0]
@@ -675,6 +688,7 @@ module ProcessOut
675
688
  "sex" => @sex,
676
689
  "metadata" => @metadata,
677
690
  "id" => @id,
691
+ "reference_id" => @reference_id,
678
692
  "registered_at" => @registered_at,
679
693
  "phone_number" => @phone_number
680
694
  }
@@ -683,7 +697,7 @@ module ProcessOut
683
697
  return_values = Array.new
684
698
 
685
699
  body = response.body
686
- body = body["customer"]
700
+ body = body.key?("customer") ? body["customer"] : nil
687
701
 
688
702
 
689
703
  return_values.push(self.fill_with_data(body))
@@ -710,7 +724,7 @@ module ProcessOut
710
724
  return_values = Array.new
711
725
 
712
726
  body = response.body
713
- body = body["customer"]
727
+ body = body.key?("customer") ? body["customer"] : nil
714
728
 
715
729
 
716
730
  obj = Customer.new(@client)
@@ -757,7 +771,7 @@ module ProcessOut
757
771
  return_values = Array.new
758
772
 
759
773
  body = response.body
760
- body = body["customer"]
774
+ body = body.key?("customer") ? body["customer"] : nil
761
775
 
762
776
 
763
777
  return_values.push(self.fill_with_data(body))
@@ -295,7 +295,7 @@ module ProcessOut
295
295
  return_values = Array.new
296
296
 
297
297
  body = response.body
298
- body = body["discount"]
298
+ body = body.key?("discount") ? body["discount"] : nil
299
299
 
300
300
 
301
301
  return_values.push(self.fill_with_data(body))
@@ -323,7 +323,7 @@ module ProcessOut
323
323
  return_values = Array.new
324
324
 
325
325
  body = response.body
326
- body = body["discount"]
326
+ body = body.key?("discount") ? body["discount"] : nil
327
327
 
328
328
 
329
329
  obj = Discount.new(@client)
@@ -221,7 +221,7 @@ module ProcessOut
221
221
  return_values = Array.new
222
222
 
223
223
  body = response.body
224
- body = body["event"]
224
+ body = body.key?("event") ? body["event"] : nil
225
225
 
226
226
 
227
227
  obj = Event.new(@client)
@@ -213,7 +213,7 @@ module ProcessOut
213
213
  return_values = Array.new
214
214
 
215
215
  body = response.body
216
- body = body["export_layout"]
216
+ body = body.key?("export_layout") ? body["export_layout"] : nil
217
217
 
218
218
 
219
219
  obj = ExportLayout.new(@client)
@@ -241,7 +241,7 @@ module ProcessOut
241
241
  return_values = Array.new
242
242
 
243
243
  body = response.body
244
- body = body["export_layout"]
244
+ body = body.key?("export_layout") ? body["export_layout"] : nil
245
245
 
246
246
 
247
247
  obj = ExportLayout.new(@client)
@@ -271,7 +271,7 @@ module ProcessOut
271
271
  return_values = Array.new
272
272
 
273
273
  body = response.body
274
- body = body["export_layout"]
274
+ body = body.key?("export_layout") ? body["export_layout"] : nil
275
275
 
276
276
 
277
277
  return_values.push(self.fill_with_data(body))
@@ -300,7 +300,7 @@ module ProcessOut
300
300
  return_values = Array.new
301
301
 
302
302
  body = response.body
303
- body = body["export_layout"]
303
+ body = body.key?("export_layout") ? body["export_layout"] : nil
304
304
 
305
305
 
306
306
  return_values.push(self.fill_with_data(body))
@@ -128,7 +128,7 @@ module ProcessOut
128
128
  return_values = Array.new
129
129
 
130
130
  body = response.body
131
- body = body["export_layout_configuration_options"]
131
+ body = body.key?("export_layout_configuration_options") ? body["export_layout_configuration_options"] : nil
132
132
 
133
133
 
134
134
  obj = ExportLayoutConfigurationOptions.new(@client)
@@ -268,7 +268,7 @@ module ProcessOut
268
268
  return_values = Array.new
269
269
 
270
270
  body = response.body
271
- body = body["gateway_configuration"]
271
+ body = body.key?("gateway_configuration") ? body["gateway_configuration"] : nil
272
272
 
273
273
 
274
274
  obj = GatewayConfiguration.new(@client)
@@ -302,7 +302,7 @@ module ProcessOut
302
302
  return_values = Array.new
303
303
 
304
304
  body = response.body
305
- body = body["gateway_configuration"]
305
+ body = body.key?("gateway_configuration") ? body["gateway_configuration"] : nil
306
306
 
307
307
 
308
308
  return_values.push(self.fill_with_data(body))
@@ -357,7 +357,7 @@ module ProcessOut
357
357
  return_values = Array.new
358
358
 
359
359
  body = response.body
360
- body = body["gateway_configuration"]
360
+ body = body.key?("gateway_configuration") ? body["gateway_configuration"] : nil
361
361
 
362
362
 
363
363
  return_values.push(self.fill_with_data(body))
@@ -59,6 +59,7 @@ module ProcessOut
59
59
  attr_reader :unsupported_feature_bypass
60
60
  attr_reader :verification
61
61
  attr_reader :auto_capture_at
62
+ attr_reader :reference_id
62
63
 
63
64
 
64
65
  def id=(val)
@@ -449,6 +450,10 @@ module ProcessOut
449
450
  @auto_capture_at = val
450
451
  end
451
452
 
453
+ def reference_id=(val)
454
+ @reference_id = val
455
+ end
456
+
452
457
 
453
458
  # Initializes the Invoice object
454
459
  # Params:
@@ -508,6 +513,7 @@ module ProcessOut
508
513
  self.unsupported_feature_bypass = data.fetch(:unsupported_feature_bypass, nil)
509
514
  self.verification = data.fetch(:verification, nil)
510
515
  self.auto_capture_at = data.fetch(:auto_capture_at, nil)
516
+ self.reference_id = data.fetch(:reference_id, nil)
511
517
 
512
518
  end
513
519
 
@@ -570,6 +576,7 @@ module ProcessOut
570
576
  "unsupported_feature_bypass": self.unsupported_feature_bypass,
571
577
  "verification": self.verification,
572
578
  "auto_capture_at": self.auto_capture_at,
579
+ "reference_id": self.reference_id,
573
580
  }.to_json
574
581
  end
575
582
 
@@ -733,6 +740,9 @@ module ProcessOut
733
740
  if data.include? "auto_capture_at"
734
741
  self.auto_capture_at = data["auto_capture_at"]
735
742
  end
743
+ if data.include? "reference_id"
744
+ self.reference_id = data["reference_id"]
745
+ end
736
746
 
737
747
  self
738
748
  end
@@ -795,6 +805,7 @@ module ProcessOut
795
805
  self.unsupported_feature_bypass = data.fetch(:unsupported_feature_bypass, self.unsupported_feature_bypass)
796
806
  self.verification = data.fetch(:verification, self.verification)
797
807
  self.auto_capture_at = data.fetch(:auto_capture_at, self.auto_capture_at)
808
+ self.reference_id = data.fetch(:reference_id, self.reference_id)
798
809
 
799
810
  self
800
811
  end
@@ -817,9 +828,11 @@ module ProcessOut
817
828
  return_values = Array.new
818
829
 
819
830
  body = response.body
820
- body = body["transaction"]
821
- transaction = Transaction.new(@client)
822
- return_values.push(transaction.fill_with_data(body))
831
+ body = body.key?("transaction") ? body["transaction"] : nil
832
+ if !body.nil?
833
+ transaction = Transaction.new(@client)
834
+ return_values.push(transaction.fill_with_data(body))
835
+ end
823
836
 
824
837
 
825
838
  return_values[0]
@@ -854,13 +867,17 @@ module ProcessOut
854
867
  return_values = Array.new
855
868
 
856
869
  body = response.body
857
- body = body["transaction"]
858
- transaction = Transaction.new(@client)
859
- return_values.push(transaction.fill_with_data(body))
870
+ body = body.key?("transaction") ? body["transaction"] : nil
871
+ if !body.nil?
872
+ transaction = Transaction.new(@client)
873
+ return_values.push(transaction.fill_with_data(body))
874
+ end
860
875
  body = response.body
861
- body = body["customer_action"]
862
- customer_action = CustomerAction.new(@client)
863
- return_values.push(customer_action.fill_with_data(body))
876
+ body = body.key?("customer_action") ? body["customer_action"] : nil
877
+ if !body.nil?
878
+ customer_action = CustomerAction.new(@client)
879
+ return_values.push(customer_action.fill_with_data(body))
880
+ end
864
881
 
865
882
 
866
883
  return_values
@@ -896,13 +913,17 @@ module ProcessOut
896
913
  return_values = Array.new
897
914
 
898
915
  body = response.body
899
- body = body["transaction"]
900
- transaction = Transaction.new(@client)
901
- return_values.push(transaction.fill_with_data(body))
916
+ body = body.key?("transaction") ? body["transaction"] : nil
917
+ if !body.nil?
918
+ transaction = Transaction.new(@client)
919
+ return_values.push(transaction.fill_with_data(body))
920
+ end
902
921
  body = response.body
903
- body = body["customer_action"]
904
- customer_action = CustomerAction.new(@client)
905
- return_values.push(customer_action.fill_with_data(body))
922
+ body = body.key?("customer_action") ? body["customer_action"] : nil
923
+ if !body.nil?
924
+ customer_action = CustomerAction.new(@client)
925
+ return_values.push(customer_action.fill_with_data(body))
926
+ end
906
927
 
907
928
 
908
929
  return_values
@@ -924,9 +945,11 @@ module ProcessOut
924
945
  return_values = Array.new
925
946
 
926
947
  body = response.body
927
- body = body["customer"]
928
- customer = Customer.new(@client)
929
- return_values.push(customer.fill_with_data(body))
948
+ body = body.key?("customer") ? body["customer"] : nil
949
+ if !body.nil?
950
+ customer = Customer.new(@client)
951
+ return_values.push(customer.fill_with_data(body))
952
+ end
930
953
 
931
954
 
932
955
  return_values[0]
@@ -949,9 +972,11 @@ module ProcessOut
949
972
  return_values = Array.new
950
973
 
951
974
  body = response.body
952
- body = body["customer"]
953
- customer = Customer.new(@client)
954
- return_values.push(customer.fill_with_data(body))
975
+ body = body.key?("customer") ? body["customer"] : nil
976
+ if !body.nil?
977
+ customer = Customer.new(@client)
978
+ return_values.push(customer.fill_with_data(body))
979
+ end
955
980
 
956
981
 
957
982
  return_values[0]
@@ -977,9 +1002,11 @@ module ProcessOut
977
1002
  return_values = Array.new
978
1003
 
979
1004
  body = response.body
980
- body = body["transaction"]
981
- transaction = Transaction.new(@client)
982
- return_values.push(transaction.fill_with_data(body))
1005
+ body = body.key?("transaction") ? body["transaction"] : nil
1006
+ if !body.nil?
1007
+ transaction = Transaction.new(@client)
1008
+ return_values.push(transaction.fill_with_data(body))
1009
+ end
983
1010
 
984
1011
 
985
1012
  return_values[0]
@@ -1003,9 +1030,11 @@ module ProcessOut
1003
1030
  return_values = Array.new
1004
1031
 
1005
1032
  body = response.body
1006
- body = body["native_apm"]
1007
- native_apm_transaction_details = NativeAPMTransactionDetails.new(@client)
1008
- return_values.push(native_apm_transaction_details.fill_with_data(body))
1033
+ body = body.key?("native_apm") ? body["native_apm"] : nil
1034
+ if !body.nil?
1035
+ native_apm_transaction_details = NativeAPMTransactionDetails.new(@client)
1036
+ return_values.push(native_apm_transaction_details.fill_with_data(body))
1037
+ end
1009
1038
 
1010
1039
 
1011
1040
  return_values[0]
@@ -1029,13 +1058,17 @@ module ProcessOut
1029
1058
  return_values = Array.new
1030
1059
 
1031
1060
  body = response.body
1032
- body = body["transaction"]
1033
- transaction = Transaction.new(@client)
1034
- return_values.push(transaction.fill_with_data(body))
1061
+ body = body.key?("transaction") ? body["transaction"] : nil
1062
+ if !body.nil?
1063
+ transaction = Transaction.new(@client)
1064
+ return_values.push(transaction.fill_with_data(body))
1065
+ end
1035
1066
  body = response.body
1036
- body = body["native_apm"]
1037
- native_apm_response = NativeAPMResponse.new(@client)
1038
- return_values.push(native_apm_response.fill_with_data(body))
1067
+ body = body.key?("native_apm") ? body["native_apm"] : nil
1068
+ if !body.nil?
1069
+ native_apm_response = NativeAPMResponse.new(@client)
1070
+ return_values.push(native_apm_response.fill_with_data(body))
1071
+ end
1039
1072
 
1040
1073
 
1041
1074
  return_values
@@ -1059,9 +1092,11 @@ module ProcessOut
1059
1092
  return_values = Array.new
1060
1093
 
1061
1094
  body = response.body
1062
- body = body["customer_action"]
1063
- customer_action = CustomerAction.new(@client)
1064
- return_values.push(customer_action.fill_with_data(body))
1095
+ body = body.key?("customer_action") ? body["customer_action"] : nil
1096
+ if !body.nil?
1097
+ customer_action = CustomerAction.new(@client)
1098
+ return_values.push(customer_action.fill_with_data(body))
1099
+ end
1065
1100
 
1066
1101
 
1067
1102
  return_values[0]
@@ -1083,9 +1118,11 @@ module ProcessOut
1083
1118
  return_values = Array.new
1084
1119
 
1085
1120
  body = response.body
1086
- body = body["transaction"]
1087
- transaction = Transaction.new(@client)
1088
- return_values.push(transaction.fill_with_data(body))
1121
+ body = body.key?("transaction") ? body["transaction"] : nil
1122
+ if !body.nil?
1123
+ transaction = Transaction.new(@client)
1124
+ return_values.push(transaction.fill_with_data(body))
1125
+ end
1089
1126
 
1090
1127
 
1091
1128
  return_values[0]
@@ -1108,9 +1145,11 @@ module ProcessOut
1108
1145
  return_values = Array.new
1109
1146
 
1110
1147
  body = response.body
1111
- body = body["transaction"]
1112
- transaction = Transaction.new(@client)
1113
- return_values.push(transaction.fill_with_data(body))
1148
+ body = body.key?("transaction") ? body["transaction"] : nil
1149
+ if !body.nil?
1150
+ transaction = Transaction.new(@client)
1151
+ return_values.push(transaction.fill_with_data(body))
1152
+ end
1114
1153
 
1115
1154
 
1116
1155
  return_values[0]
@@ -1163,6 +1202,7 @@ module ProcessOut
1163
1202
  "metadata" => @metadata,
1164
1203
  "details" => @details,
1165
1204
  "submerchant" => @submerchant,
1205
+ "reference_id" => @reference_id,
1166
1206
  "exemption_reason_3ds2" => @exemption_reason_3ds2,
1167
1207
  "sca_exemption_reason" => @sca_exemption_reason,
1168
1208
  "challenge_indicator" => @challenge_indicator,
@@ -1196,7 +1236,7 @@ module ProcessOut
1196
1236
  return_values = Array.new
1197
1237
 
1198
1238
  body = response.body
1199
- body = body["invoice"]
1239
+ body = body.key?("invoice") ? body["invoice"] : nil
1200
1240
 
1201
1241
 
1202
1242
  return_values.push(self.fill_with_data(body))
@@ -1223,7 +1263,7 @@ module ProcessOut
1223
1263
  return_values = Array.new
1224
1264
 
1225
1265
  body = response.body
1226
- body = body["invoice"]
1266
+ body = body.key?("invoice") ? body["invoice"] : nil
1227
1267
 
1228
1268
 
1229
1269
  obj = Invoice.new(@client)
@@ -1273,7 +1313,7 @@ module ProcessOut
1273
1313
  return_values = Array.new
1274
1314
 
1275
1315
  body = response.body
1276
- body = body["invoice"]
1316
+ body = body.key?("invoice") ? body["invoice"] : nil
1277
1317
 
1278
1318
 
1279
1319
  obj = Invoice.new(@client)
@@ -1304,7 +1344,7 @@ module ProcessOut
1304
1344
  return_values = Array.new
1305
1345
 
1306
1346
  body = response.body
1307
- body = body["invoice"]
1347
+ body = body.key?("invoice") ? body["invoice"] : nil
1308
1348
 
1309
1349
 
1310
1350
  return_values.push(self.fill_with_data(body))
@@ -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.3.0"
16
+ req["User-Agent"] = "ProcessOut Ruby-Bindings/4.0.0"
17
17
 
18
18
  unless options.nil?
19
19
  req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
@@ -363,7 +363,7 @@ module ProcessOut
363
363
  return_values = Array.new
364
364
 
365
365
  body = response.body
366
- body = body["payout"]
366
+ body = body.key?("payout") ? body["payout"] : nil
367
367
 
368
368
 
369
369
  obj = Payout.new(@client)
@@ -274,7 +274,7 @@ module ProcessOut
274
274
  return_values = Array.new
275
275
 
276
276
  body = response.body
277
- body = body["plan"]
277
+ body = body.key?("plan") ? body["plan"] : nil
278
278
 
279
279
 
280
280
  return_values.push(self.fill_with_data(body))
@@ -301,7 +301,7 @@ module ProcessOut
301
301
  return_values = Array.new
302
302
 
303
303
  body = response.body
304
- body = body["plan"]
304
+ body = body.key?("plan") ? body["plan"] : nil
305
305
 
306
306
 
307
307
  obj = Plan.new(@client)
@@ -332,7 +332,7 @@ module ProcessOut
332
332
  return_values = Array.new
333
333
 
334
334
  body = response.body
335
- body = body["plan"]
335
+ body = body.key?("plan") ? body["plan"] : nil
336
336
 
337
337
 
338
338
  return_values.push(self.fill_with_data(body))
@@ -214,9 +214,11 @@ module ProcessOut
214
214
  return_values = Array.new
215
215
 
216
216
  body = response.body
217
- body = body["invoice"]
218
- invoice = Invoice.new(@client)
219
- return_values.push(invoice.fill_with_data(body))
217
+ body = body.key?("invoice") ? body["invoice"] : nil
218
+ if !body.nil?
219
+ invoice = Invoice.new(@client)
220
+ return_values.push(invoice.fill_with_data(body))
221
+ end
220
222
 
221
223
 
222
224
  return_values[0]
@@ -273,7 +275,7 @@ module ProcessOut
273
275
  return_values = Array.new
274
276
 
275
277
  body = response.body
276
- body = body["product"]
278
+ body = body.key?("product") ? body["product"] : nil
277
279
 
278
280
 
279
281
  return_values.push(self.fill_with_data(body))
@@ -300,7 +302,7 @@ module ProcessOut
300
302
  return_values = Array.new
301
303
 
302
304
  body = response.body
303
- body = body["product"]
305
+ body = body.key?("product") ? body["product"] : nil
304
306
 
305
307
 
306
308
  obj = Product.new(@client)
@@ -332,7 +334,7 @@ module ProcessOut
332
334
  return_values = Array.new
333
335
 
334
336
  body = response.body
335
- body = body["product"]
337
+ body = body.key?("product") ? body["product"] : nil
336
338
 
337
339
 
338
340
  return_values.push(self.fill_with_data(body))
@@ -231,7 +231,7 @@ module ProcessOut
231
231
  return_values = Array.new
232
232
 
233
233
  body = response.body
234
- body = body["project"]
234
+ body = body.key?("project") ? body["project"] : nil
235
235
 
236
236
 
237
237
  return_values.push(self.fill_with_data(body))
@@ -257,7 +257,7 @@ module ProcessOut
257
257
  return_values = Array.new
258
258
 
259
259
  body = response.body
260
- body = body["project"]
260
+ body = body.key?("project") ? body["project"] : nil
261
261
 
262
262
 
263
263
  return_values.push(self.fill_with_data(body))
@@ -339,7 +339,7 @@ module ProcessOut
339
339
  return_values = Array.new
340
340
 
341
341
  body = response.body
342
- body = body["project"]
342
+ body = body.key?("project") ? body["project"] : nil
343
343
 
344
344
 
345
345
  return_values.push(self.fill_with_data(body))
@@ -104,7 +104,7 @@ module ProcessOut
104
104
  return_values = Array.new
105
105
 
106
106
  body = response.body
107
- body = body["sftp_settings"]
107
+ body = body.key?("sftp_settings") ? body["sftp_settings"] : nil
108
108
 
109
109
 
110
110
  obj = ProjectSFTPSettingsPublic.new(@client)
@@ -262,7 +262,7 @@ module ProcessOut
262
262
  return_values = Array.new
263
263
 
264
264
  body = response.body
265
- body = body["refund"]
265
+ body = body.key?("refund") ? body["refund"] : nil
266
266
 
267
267
 
268
268
  obj = Refund.new(@client)
@@ -582,9 +582,11 @@ module ProcessOut
582
582
  return_values = Array.new
583
583
 
584
584
  body = response.body
585
- body = body["addon"]
586
- addon = Addon.new(@client)
587
- return_values.push(addon.fill_with_data(body))
585
+ body = body.key?("addon") ? body["addon"] : nil
586
+ if !body.nil?
587
+ addon = Addon.new(@client)
588
+ return_values.push(addon.fill_with_data(body))
589
+ end
588
590
 
589
591
 
590
592
  return_values[0]
@@ -630,9 +632,11 @@ module ProcessOut
630
632
  return_values = Array.new
631
633
 
632
634
  body = response.body
633
- body = body["customer"]
634
- customer = Customer.new(@client)
635
- return_values.push(customer.fill_with_data(body))
635
+ body = body.key?("customer") ? body["customer"] : nil
636
+ if !body.nil?
637
+ customer = Customer.new(@client)
638
+ return_values.push(customer.fill_with_data(body))
639
+ end
636
640
 
637
641
 
638
642
  return_values[0]
@@ -685,9 +689,11 @@ module ProcessOut
685
689
  return_values = Array.new
686
690
 
687
691
  body = response.body
688
- body = body["discount"]
689
- discount = Discount.new(@client)
690
- return_values.push(discount.fill_with_data(body))
692
+ body = body.key?("discount") ? body["discount"] : nil
693
+ if !body.nil?
694
+ discount = Discount.new(@client)
695
+ return_values.push(discount.fill_with_data(body))
696
+ end
691
697
 
692
698
 
693
699
  return_values[0]
@@ -803,7 +809,7 @@ module ProcessOut
803
809
  return_values = Array.new
804
810
 
805
811
  body = response.body
806
- body = body["subscription"]
812
+ body = body.key?("subscription") ? body["subscription"] : nil
807
813
 
808
814
 
809
815
  return_values.push(self.fill_with_data(body))
@@ -830,7 +836,7 @@ module ProcessOut
830
836
  return_values = Array.new
831
837
 
832
838
  body = response.body
833
- body = body["subscription"]
839
+ body = body.key?("subscription") ? body["subscription"] : nil
834
840
 
835
841
 
836
842
  obj = Subscription.new(@client)
@@ -867,7 +873,7 @@ module ProcessOut
867
873
  return_values = Array.new
868
874
 
869
875
  body = response.body
870
- body = body["subscription"]
876
+ body = body.key?("subscription") ? body["subscription"] : nil
871
877
 
872
878
 
873
879
  return_values.push(self.fill_with_data(body))
@@ -895,7 +901,7 @@ module ProcessOut
895
901
  return_values = Array.new
896
902
 
897
903
  body = response.body
898
- body = body["subscription"]
904
+ body = body.key?("subscription") ? body["subscription"] : nil
899
905
 
900
906
 
901
907
  return_values.push(self.fill_with_data(body))
@@ -404,7 +404,7 @@ module ProcessOut
404
404
  return_values = Array.new
405
405
 
406
406
  body = response.body
407
- body = body["token"]
407
+ body = body.key?("token") ? body["token"] : nil
408
408
 
409
409
 
410
410
  obj = Token.new(@client)
@@ -431,6 +431,7 @@ module ProcessOut
431
431
  "invoice_id" => @invoice_id,
432
432
  "manual_invoice_cancellation" => @manual_invoice_cancellation,
433
433
  "webhook_url" => @webhook_url,
434
+ "gateway_configuration_id" => @gateway_configuration_id,
434
435
  "source" => options.fetch(:source, nil),
435
436
  "settings" => options.fetch(:settings, nil),
436
437
  "device" => options.fetch(:device, nil),
@@ -446,15 +447,17 @@ module ProcessOut
446
447
  return_values = Array.new
447
448
 
448
449
  body = response.body
449
- body = body["token"]
450
+ body = body.key?("token") ? body["token"] : nil
450
451
 
451
452
 
452
453
  return_values.push(self.fill_with_data(body))
453
454
 
454
455
  body = response.body
455
- body = body["customer_action"]
456
- customer_action = CustomerAction.new(@client)
457
- return_values.push(customer_action.fill_with_data(body))
456
+ body = body.key?("customer_action") ? body["customer_action"] : nil
457
+ if !body.nil?
458
+ customer_action = CustomerAction.new(@client)
459
+ return_values.push(customer_action.fill_with_data(body))
460
+ end
458
461
 
459
462
 
460
463
  return_values
@@ -476,7 +479,8 @@ module ProcessOut
476
479
  "verify_metadata" => options.fetch(:verify_metadata, nil),
477
480
  "set_default" => options.fetch(:set_default, nil),
478
481
  "verify_statement_descriptor" => options.fetch(:verify_statement_descriptor, nil),
479
- "invoice_return_url" => options.fetch(:invoice_return_url, nil)
482
+ "invoice_return_url" => options.fetch(:invoice_return_url, nil),
483
+ "gateway_configuration_id" => options.fetch(:gateway_configuration_id, nil)
480
484
  }
481
485
 
482
486
  response = Response.new(request.put(path, data, options))
@@ -991,9 +991,11 @@ module ProcessOut
991
991
  return_values = Array.new
992
992
 
993
993
  body = response.body
994
- body = body["refund"]
995
- refund = Refund.new(@client)
996
- return_values.push(refund.fill_with_data(body))
994
+ body = body.key?("refund") ? body["refund"] : nil
995
+ if !body.nil?
996
+ refund = Refund.new(@client)
997
+ return_values.push(refund.fill_with_data(body))
998
+ end
997
999
 
998
1000
 
999
1001
  return_values[0]
@@ -1076,7 +1078,7 @@ module ProcessOut
1076
1078
  return_values = Array.new
1077
1079
 
1078
1080
  body = response.body
1079
- body = body["transaction"]
1081
+ body = body.key?("transaction") ? body["transaction"] : nil
1080
1082
 
1081
1083
 
1082
1084
  obj = Transaction.new(@client)
@@ -1,3 +1,3 @@
1
1
  module ProcessOut
2
- VERSION = "3.3.0"
2
+ VERSION = "4.0.0"
3
3
  end
data/lib/processout.rb CHANGED
@@ -7,6 +7,7 @@ require "processout/apple_pay_alternative_merchant_certificates"
7
7
  require "processout/alternative_merchant_certificate"
8
8
  require "processout/balances"
9
9
  require "processout/balance"
10
+ require "processout/balances_customer_action"
10
11
  require "processout/card"
11
12
  require "processout/card_information"
12
13
  require "processout/phone"
@@ -64,11 +65,11 @@ require "processout/payment_data_three_ds_authentication"
64
65
  require "processout/transaction_operation"
65
66
  require "processout/webhook"
66
67
  require "processout/webhook_endpoint"
67
- require "processout/card_create_request"
68
68
  require "processout/device"
69
69
  require "processout/card_contact"
70
70
  require "processout/card_shipping"
71
71
  require "processout/card_update_request"
72
+ require "processout/card_create_request"
72
73
  require "processout/error_codes"
73
74
  require "processout/category_error_codes"
74
75
  require "processout/external_three_ds"
@@ -122,6 +123,11 @@ module ProcessOut
122
123
  obj = Balance.new(self, data)
123
124
  end
124
125
 
126
+ # Create a new BalancesCustomerAction instance
127
+ def balances_customer_action(data = {})
128
+ obj = BalancesCustomerAction.new(self, data)
129
+ end
130
+
125
131
  # Create a new Card instance
126
132
  def card(data = {})
127
133
  obj = Card.new(self, data)
@@ -407,11 +413,6 @@ module ProcessOut
407
413
  obj = WebhookEndpoint.new(self, data)
408
414
  end
409
415
 
410
- # Create a new CardCreateRequest instance
411
- def card_create_request(data = {})
412
- obj = CardCreateRequest.new(self, data)
413
- end
414
-
415
416
  # Create a new Device instance
416
417
  def device(data = {})
417
418
  obj = Device.new(self, data)
@@ -432,6 +433,11 @@ module ProcessOut
432
433
  obj = CardUpdateRequest.new(self, data)
433
434
  end
434
435
 
436
+ # Create a new CardCreateRequest instance
437
+ def card_create_request(data = {})
438
+ obj = CardCreateRequest.new(self, data)
439
+ end
440
+
435
441
  # Create a new ErrorCodes instance
436
442
  def error_codes(data = {})
437
443
  obj = ErrorCodes.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: 3.3.0
4
+ version: 4.0.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: 2025-04-14 00:00:00.000000000 Z
11
+ date: 2025-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -81,6 +81,7 @@ files:
81
81
  - lib/processout/apple_pay_alternative_merchant_certificates.rb
82
82
  - lib/processout/balance.rb
83
83
  - lib/processout/balances.rb
84
+ - lib/processout/balances_customer_action.rb
84
85
  - lib/processout/card.rb
85
86
  - lib/processout/card_contact.rb
86
87
  - lib/processout/card_create_request.rb