processout 2.25.0 → 2.27.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.github/CODEOWNERS +2 -0
  4. data/.github/stale.yml +17 -0
  5. data/.github/workflows/ci.yaml +19 -0
  6. data/.gitignore +2 -1
  7. data/lib/processout/card.rb +22 -0
  8. data/lib/processout/category_error_codes.rb +180 -0
  9. data/lib/processout/customer.rb +29 -4
  10. data/lib/processout/customer_phone.rb +81 -0
  11. data/lib/processout/error_codes.rb +107 -0
  12. data/lib/processout/gateway_configuration.rb +13 -0
  13. data/lib/processout/invoice.rb +127 -1
  14. data/lib/processout/invoice_external_fraud_tools.rb +11 -0
  15. data/lib/processout/invoice_risk.rb +11 -0
  16. data/lib/processout/invoice_shipping.rb +23 -0
  17. data/lib/processout/invoice_shipping_phone.rb +81 -0
  18. data/lib/processout/invoices_process_native_payment_response.rb +105 -0
  19. data/lib/processout/native_apm_parameter_definition.rb +141 -0
  20. data/lib/processout/native_apm_parameter_value.rb +81 -0
  21. data/lib/processout/native_apm_parameter_value_definition.rb +92 -0
  22. data/lib/processout/native_apm_request.rb +86 -0
  23. data/lib/processout/native_apm_response.rb +124 -0
  24. data/lib/processout/native_apm_transaction_details.rb +143 -0
  25. data/lib/processout/native_apm_transaction_details_gateway.rb +81 -0
  26. data/lib/processout/native_apm_transaction_details_invoice.rb +81 -0
  27. data/lib/processout/networking/request.rb +1 -1
  28. data/lib/processout/project_sftp_settings.rb +150 -0
  29. data/lib/processout/refund.rb +26 -0
  30. data/lib/processout/transaction.rb +46 -0
  31. data/lib/processout/unsupported_feature_bypass.rb +70 -0
  32. data/lib/processout/version.rb +1 -1
  33. data/lib/processout.rb +90 -0
  34. metadata +21 -2
@@ -0,0 +1,150 @@
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 ProjectSFTPSettings
10
+
11
+ attr_reader :endpoint
12
+ attr_reader :username
13
+ attr_reader :password
14
+ attr_reader :private_key
15
+
16
+
17
+ def endpoint=(val)
18
+ @endpoint = val
19
+ end
20
+
21
+ def username=(val)
22
+ @username = val
23
+ end
24
+
25
+ def password=(val)
26
+ @password = val
27
+ end
28
+
29
+ def private_key=(val)
30
+ @private_key = val
31
+ end
32
+
33
+
34
+ # Initializes the ProjectSFTPSettings object
35
+ # Params:
36
+ # +client+:: +ProcessOut+ client instance
37
+ # +data+:: data that can be used to fill the object
38
+ def initialize(client, data = {})
39
+ @client = client
40
+
41
+ self.endpoint = data.fetch(:endpoint, nil)
42
+ self.username = data.fetch(:username, nil)
43
+ self.password = data.fetch(:password, nil)
44
+ self.private_key = data.fetch(:private_key, nil)
45
+
46
+ end
47
+
48
+ # Create a new ProjectSFTPSettings using the current client
49
+ def new(data = {})
50
+ ProjectSFTPSettings.new(@client, data)
51
+ end
52
+
53
+ # Overrides the JSON marshaller to only send the fields we want
54
+ def to_json(options)
55
+ {
56
+ "endpoint": self.endpoint,
57
+ "username": self.username,
58
+ "password": self.password,
59
+ "private_key": self.private_key,
60
+ }.to_json
61
+ end
62
+
63
+ # Fills the object with data coming from the API
64
+ # Params:
65
+ # +data+:: +Hash+ of data coming from the API
66
+ def fill_with_data(data)
67
+ if data.nil?
68
+ return self
69
+ end
70
+ if data.include? "endpoint"
71
+ self.endpoint = data["endpoint"]
72
+ end
73
+ if data.include? "username"
74
+ self.username = data["username"]
75
+ end
76
+ if data.include? "password"
77
+ self.password = data["password"]
78
+ end
79
+ if data.include? "private_key"
80
+ self.private_key = data["private_key"]
81
+ end
82
+
83
+ self
84
+ end
85
+
86
+ # Prefills the object with the data passed as parameters
87
+ # Params:
88
+ # +data+:: +Hash+ of data
89
+ def prefill(data)
90
+ if data.nil?
91
+ return self
92
+ end
93
+ self.endpoint = data.fetch(:endpoint, self.endpoint)
94
+ self.username = data.fetch(:username, self.username)
95
+ self.password = data.fetch(:password, self.password)
96
+ self.private_key = data.fetch(:private_key, self.private_key)
97
+
98
+ self
99
+ end
100
+
101
+ # Save the SFTP settings for the project.
102
+ # Params:
103
+ # +id+:: ID of the project
104
+ # +options+:: +Hash+ of options
105
+ def save_sftp_settings(id, options = {})
106
+ self.prefill(options)
107
+
108
+ request = Request.new(@client)
109
+ path = "/projects/" + CGI.escape(id) + "/sftp-settings"
110
+ data = {
111
+ "endpoint" => @endpoint,
112
+ "username" => @username,
113
+ "password" => @password,
114
+ "private_key" => @private_key
115
+ }
116
+
117
+ response = Response.new(request.put(path, data, options))
118
+ return_values = Array.new
119
+
120
+ return_values.push(response.success)
121
+
122
+
123
+ return_values[0]
124
+ end
125
+
126
+ # Delete the SFTP settings for the project.
127
+ # Params:
128
+ # +id+:: ID of the project
129
+ # +options+:: +Hash+ of options
130
+ def delete_sftp_settings(id, options = {})
131
+ self.prefill(options)
132
+
133
+ request = Request.new(@client)
134
+ path = "/projects/" + CGI.escape(id) + "/sftp-settings"
135
+ data = {
136
+
137
+ }
138
+
139
+ response = Response.new(request.delete(path, data, options))
140
+ return_values = Array.new
141
+
142
+ return_values.push(response.success)
143
+
144
+
145
+ return_values[0]
146
+ end
147
+
148
+
149
+ end
150
+ end
@@ -187,6 +187,32 @@ module ProcessOut
187
187
  self
188
188
  end
189
189
 
190
+ # Create a refund for an invoice.
191
+ # Params:
192
+ # +invoice_id+:: ID of the invoice
193
+ # +options+:: +Hash+ of options
194
+ def create_for_invoice(invoice_id, options = {})
195
+ self.prefill(options)
196
+
197
+ request = Request.new(@client)
198
+ path = "/invoices/" + CGI.escape(invoice_id) + "/refunds"
199
+ data = {
200
+ "amount" => @amount,
201
+ "reason" => @reason,
202
+ "information" => @information,
203
+ "invoice_detail_ids" => @invoice_detail_ids,
204
+ "metadata" => options.fetch(:metadata, nil)
205
+ }
206
+
207
+ response = Response.new(request.post(path, data, options))
208
+ return_values = Array.new
209
+
210
+ return_values.push(response.success)
211
+
212
+
213
+ return_values[0]
214
+ end
215
+
190
216
  # Get the transaction's refunds.
191
217
  # Params:
192
218
  # +transaction_id+:: ID of the transaction
@@ -69,6 +69,9 @@ module ProcessOut
69
69
  attr_reader :initial_scheme_transaction_id
70
70
  attr_reader :scheme_id
71
71
  attr_reader :payment_type
72
+ attr_reader :eci
73
+ attr_reader :native_apm
74
+ attr_reader :external_details
72
75
 
73
76
 
74
77
  def id=(val)
@@ -455,6 +458,31 @@ module ProcessOut
455
458
  @payment_type = val
456
459
  end
457
460
 
461
+ def eci=(val)
462
+ @eci = val
463
+ end
464
+
465
+ def native_apm=(val)
466
+ if val.nil?
467
+ @native_apm = val
468
+ return
469
+ end
470
+
471
+ if val.instance_of? NativeAPMResponse
472
+ @native_apm = val
473
+ else
474
+ obj = NativeAPMResponse.new(@client)
475
+ obj.fill_with_data(val)
476
+ @native_apm = obj
477
+ end
478
+
479
+ end
480
+
481
+ def external_details=(val)
482
+ @external_details = val
483
+
484
+ end
485
+
458
486
 
459
487
  # Initializes the Transaction object
460
488
  # Params:
@@ -524,6 +552,9 @@ module ProcessOut
524
552
  self.initial_scheme_transaction_id = data.fetch(:initial_scheme_transaction_id, nil)
525
553
  self.scheme_id = data.fetch(:scheme_id, nil)
526
554
  self.payment_type = data.fetch(:payment_type, nil)
555
+ self.eci = data.fetch(:eci, nil)
556
+ self.native_apm = data.fetch(:native_apm, nil)
557
+ self.external_details = data.fetch(:external_details, nil)
527
558
 
528
559
  end
529
560
 
@@ -596,6 +627,9 @@ module ProcessOut
596
627
  "initial_scheme_transaction_id": self.initial_scheme_transaction_id,
597
628
  "scheme_id": self.scheme_id,
598
629
  "payment_type": self.payment_type,
630
+ "eci": self.eci,
631
+ "native_apm": self.native_apm,
632
+ "external_details": self.external_details,
599
633
  }.to_json
600
634
  end
601
635
 
@@ -789,6 +823,15 @@ module ProcessOut
789
823
  if data.include? "payment_type"
790
824
  self.payment_type = data["payment_type"]
791
825
  end
826
+ if data.include? "eci"
827
+ self.eci = data["eci"]
828
+ end
829
+ if data.include? "native_apm"
830
+ self.native_apm = data["native_apm"]
831
+ end
832
+ if data.include? "external_details"
833
+ self.external_details = data["external_details"]
834
+ end
792
835
 
793
836
  self
794
837
  end
@@ -861,6 +904,9 @@ module ProcessOut
861
904
  self.initial_scheme_transaction_id = data.fetch(:initial_scheme_transaction_id, self.initial_scheme_transaction_id)
862
905
  self.scheme_id = data.fetch(:scheme_id, self.scheme_id)
863
906
  self.payment_type = data.fetch(:payment_type, self.payment_type)
907
+ self.eci = data.fetch(:eci, self.eci)
908
+ self.native_apm = data.fetch(:native_apm, self.native_apm)
909
+ self.external_details = data.fetch(:external_details, self.external_details)
864
910
 
865
911
  self
866
912
  end
@@ -0,0 +1,70 @@
1
+ # The content of this file was automatically generated
2
+
3
+ require "cgi"
4
+ require "json"
5
+ require "processout/networking/request"
6
+ require "processout/networking/response"
7
+
8
+ module ProcessOut
9
+ class UnsupportedFeatureBypass
10
+
11
+ attr_reader :incremental_authorization
12
+
13
+
14
+ def incremental_authorization=(val)
15
+ @incremental_authorization = val
16
+ end
17
+
18
+
19
+ # Initializes the UnsupportedFeatureBypass 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.incremental_authorization = data.fetch(:incremental_authorization, nil)
27
+
28
+ end
29
+
30
+ # Create a new UnsupportedFeatureBypass using the current client
31
+ def new(data = {})
32
+ UnsupportedFeatureBypass.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
+ "incremental_authorization": self.incremental_authorization,
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? "incremental_authorization"
50
+ self.incremental_authorization = data["incremental_authorization"]
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.incremental_authorization = data.fetch(:incremental_authorization, self.incremental_authorization)
64
+
65
+ self
66
+ end
67
+
68
+
69
+ end
70
+ end
@@ -1,3 +1,3 @@
1
1
  module ProcessOut
2
- VERSION = "2.25.0"
2
+ VERSION = "2.27.1"
3
3
  end
data/lib/processout.rb CHANGED
@@ -12,18 +12,23 @@ require "processout/card"
12
12
  require "processout/card_information"
13
13
  require "processout/coupon"
14
14
  require "processout/customer"
15
+ require "processout/customer_phone"
15
16
  require "processout/token"
16
17
  require "processout/discount"
17
18
  require "processout/event"
18
19
  require "processout/gateway"
19
20
  require "processout/gateway_configuration"
20
21
  require "processout/invoice"
22
+ require "processout/native_apm_request"
23
+ require "processout/native_apm_parameter_value"
21
24
  require "processout/invoice_tax"
22
25
  require "processout/invoice_external_fraud_tools"
23
26
  require "processout/invoice_risk"
24
27
  require "processout/invoice_device"
25
28
  require "processout/invoice_shipping"
29
+ require "processout/invoice_shipping_phone"
26
30
  require "processout/invoice_billing"
31
+ require "processout/unsupported_feature_bypass"
27
32
  require "processout/invoice_detail"
28
33
  require "processout/customer_action"
29
34
  require "processout/dunning_action"
@@ -32,9 +37,13 @@ require "processout/payout_item"
32
37
  require "processout/plan"
33
38
  require "processout/product"
34
39
  require "processout/project"
40
+ require "processout/project_sftp_settings"
35
41
  require "processout/refund"
36
42
  require "processout/subscription"
37
43
  require "processout/transaction"
44
+ require "processout/native_apm_response"
45
+ require "processout/native_apm_parameter_definition"
46
+ require "processout/native_apm_parameter_value_definition"
38
47
  require "processout/three_ds"
39
48
  require "processout/payment_data_three_ds_request"
40
49
  require "processout/payment_data_network_authentication"
@@ -42,6 +51,12 @@ require "processout/payment_data_three_ds_authentication"
42
51
  require "processout/transaction_operation"
43
52
  require "processout/webhook"
44
53
  require "processout/webhook_endpoint"
54
+ require "processout/error_codes"
55
+ require "processout/category_error_codes"
56
+ require "processout/native_apm_transaction_details_gateway"
57
+ require "processout/native_apm_transaction_details_invoice"
58
+ require "processout/native_apm_transaction_details"
59
+ require "processout/invoices_process_native_payment_response"
45
60
 
46
61
  module ProcessOut
47
62
  class Client
@@ -114,6 +129,11 @@ module ProcessOut
114
129
  obj = Customer.new(self, data)
115
130
  end
116
131
 
132
+ # Create a new CustomerPhone instance
133
+ def customer_phone(data = {})
134
+ obj = CustomerPhone.new(self, data)
135
+ end
136
+
117
137
  # Create a new Token instance
118
138
  def token(data = {})
119
139
  obj = Token.new(self, data)
@@ -144,6 +164,16 @@ module ProcessOut
144
164
  obj = Invoice.new(self, data)
145
165
  end
146
166
 
167
+ # Create a new NativeAPMRequest instance
168
+ def native_apm_request(data = {})
169
+ obj = NativeAPMRequest.new(self, data)
170
+ end
171
+
172
+ # Create a new NativeAPMParameterValue instance
173
+ def native_apm_parameter_value(data = {})
174
+ obj = NativeAPMParameterValue.new(self, data)
175
+ end
176
+
147
177
  # Create a new InvoiceTax instance
148
178
  def invoice_tax(data = {})
149
179
  obj = InvoiceTax.new(self, data)
@@ -169,11 +199,21 @@ module ProcessOut
169
199
  obj = InvoiceShipping.new(self, data)
170
200
  end
171
201
 
202
+ # Create a new InvoiceShippingPhone instance
203
+ def invoice_shipping_phone(data = {})
204
+ obj = InvoiceShippingPhone.new(self, data)
205
+ end
206
+
172
207
  # Create a new InvoiceBilling instance
173
208
  def invoice_billing(data = {})
174
209
  obj = InvoiceBilling.new(self, data)
175
210
  end
176
211
 
212
+ # Create a new UnsupportedFeatureBypass instance
213
+ def unsupported_feature_bypass(data = {})
214
+ obj = UnsupportedFeatureBypass.new(self, data)
215
+ end
216
+
177
217
  # Create a new InvoiceDetail instance
178
218
  def invoice_detail(data = {})
179
219
  obj = InvoiceDetail.new(self, data)
@@ -214,6 +254,11 @@ module ProcessOut
214
254
  obj = Project.new(self, data)
215
255
  end
216
256
 
257
+ # Create a new ProjectSFTPSettings instance
258
+ def project_sftp_settings(data = {})
259
+ obj = ProjectSFTPSettings.new(self, data)
260
+ end
261
+
217
262
  # Create a new Refund instance
218
263
  def refund(data = {})
219
264
  obj = Refund.new(self, data)
@@ -229,6 +274,21 @@ module ProcessOut
229
274
  obj = Transaction.new(self, data)
230
275
  end
231
276
 
277
+ # Create a new NativeAPMResponse instance
278
+ def native_apm_response(data = {})
279
+ obj = NativeAPMResponse.new(self, data)
280
+ end
281
+
282
+ # Create a new NativeAPMParameterDefinition instance
283
+ def native_apm_parameter_definition(data = {})
284
+ obj = NativeAPMParameterDefinition.new(self, data)
285
+ end
286
+
287
+ # Create a new NativeAPMParameterValueDefinition instance
288
+ def native_apm_parameter_value_definition(data = {})
289
+ obj = NativeAPMParameterValueDefinition.new(self, data)
290
+ end
291
+
232
292
  # Create a new ThreeDS instance
233
293
  def three_ds(data = {})
234
294
  obj = ThreeDS.new(self, data)
@@ -264,6 +324,36 @@ module ProcessOut
264
324
  obj = WebhookEndpoint.new(self, data)
265
325
  end
266
326
 
327
+ # Create a new ErrorCodes instance
328
+ def error_codes(data = {})
329
+ obj = ErrorCodes.new(self, data)
330
+ end
331
+
332
+ # Create a new CategoryErrorCodes instance
333
+ def category_error_codes(data = {})
334
+ obj = CategoryErrorCodes.new(self, data)
335
+ end
336
+
337
+ # Create a new NativeAPMTransactionDetailsGateway instance
338
+ def native_apm_transaction_details_gateway(data = {})
339
+ obj = NativeAPMTransactionDetailsGateway.new(self, data)
340
+ end
341
+
342
+ # Create a new NativeAPMTransactionDetailsInvoice instance
343
+ def native_apm_transaction_details_invoice(data = {})
344
+ obj = NativeAPMTransactionDetailsInvoice.new(self, data)
345
+ end
346
+
347
+ # Create a new NativeAPMTransactionDetails instance
348
+ def native_apm_transaction_details(data = {})
349
+ obj = NativeAPMTransactionDetails.new(self, data)
350
+ end
351
+
352
+ # Create a new InvoicesProcessNativePaymentResponse instance
353
+ def invoices_process_native_payment_response(data = {})
354
+ obj = InvoicesProcessNativePaymentResponse.new(self, data)
355
+ end
356
+
267
357
 
268
358
  end
269
359
  end
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.25.0
4
+ version: 2.27.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: 2023-05-19 00:00:00.000000000 Z
11
+ date: 2024-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -59,6 +59,10 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".DS_Store"
63
+ - ".github/CODEOWNERS"
64
+ - ".github/stale.yml"
65
+ - ".github/workflows/ci.yaml"
62
66
  - ".gitignore"
63
67
  - ".rspec"
64
68
  - ".travis.yml"
@@ -81,11 +85,14 @@ files:
81
85
  - lib/processout/balances.rb
82
86
  - lib/processout/card.rb
83
87
  - lib/processout/card_information.rb
88
+ - lib/processout/category_error_codes.rb
84
89
  - lib/processout/coupon.rb
85
90
  - lib/processout/customer.rb
86
91
  - lib/processout/customer_action.rb
92
+ - lib/processout/customer_phone.rb
87
93
  - lib/processout/discount.rb
88
94
  - lib/processout/dunning_action.rb
95
+ - lib/processout/error_codes.rb
89
96
  - lib/processout/errors/authentication_error.rb
90
97
  - lib/processout/errors/generic_error.rb
91
98
  - lib/processout/errors/internal_error.rb
@@ -102,7 +109,17 @@ files:
102
109
  - lib/processout/invoice_external_fraud_tools.rb
103
110
  - lib/processout/invoice_risk.rb
104
111
  - lib/processout/invoice_shipping.rb
112
+ - lib/processout/invoice_shipping_phone.rb
105
113
  - lib/processout/invoice_tax.rb
114
+ - lib/processout/invoices_process_native_payment_response.rb
115
+ - lib/processout/native_apm_parameter_definition.rb
116
+ - lib/processout/native_apm_parameter_value.rb
117
+ - lib/processout/native_apm_parameter_value_definition.rb
118
+ - lib/processout/native_apm_request.rb
119
+ - lib/processout/native_apm_response.rb
120
+ - lib/processout/native_apm_transaction_details.rb
121
+ - lib/processout/native_apm_transaction_details_gateway.rb
122
+ - lib/processout/native_apm_transaction_details_invoice.rb
106
123
  - lib/processout/networking/request.rb
107
124
  - lib/processout/networking/response.rb
108
125
  - lib/processout/payment_data_network_authentication.rb
@@ -113,12 +130,14 @@ files:
113
130
  - lib/processout/plan.rb
114
131
  - lib/processout/product.rb
115
132
  - lib/processout/project.rb
133
+ - lib/processout/project_sftp_settings.rb
116
134
  - lib/processout/refund.rb
117
135
  - lib/processout/subscription.rb
118
136
  - lib/processout/three_ds.rb
119
137
  - lib/processout/token.rb
120
138
  - lib/processout/transaction.rb
121
139
  - lib/processout/transaction_operation.rb
140
+ - lib/processout/unsupported_feature_bypass.rb
122
141
  - lib/processout/version.rb
123
142
  - lib/processout/webhook.rb
124
143
  - lib/processout/webhook_endpoint.rb