processout 2.17.0 → 2.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. metadata +4 -65
  3. data/.gitignore +0 -52
  4. data/.rspec +0 -2
  5. data/.travis.yml +0 -5
  6. data/Dockerfile +0 -7
  7. data/Gemfile +0 -4
  8. data/LICENSE.txt +0 -21
  9. data/Makefile +0 -4
  10. data/README.md +0 -12
  11. data/Rakefile +0 -6
  12. data/bin/console +0 -14
  13. data/bin/setup +0 -8
  14. data/lib/processout/activity.rb +0 -206
  15. data/lib/processout/addon.rb +0 -401
  16. data/lib/processout/api_request.rb +0 -295
  17. data/lib/processout/api_version.rb +0 -92
  18. data/lib/processout/balance.rb +0 -81
  19. data/lib/processout/balances.rb +0 -111
  20. data/lib/processout/card.rb +0 -503
  21. data/lib/processout/card_information.rb +0 -164
  22. data/lib/processout/coupon.rb +0 -352
  23. data/lib/processout/customer.rb +0 -755
  24. data/lib/processout/customer_action.rb +0 -81
  25. data/lib/processout/discount.rb +0 -360
  26. data/lib/processout/dunning_action.rb +0 -81
  27. data/lib/processout/errors/authentication_error.rb +0 -9
  28. data/lib/processout/errors/generic_error.rb +0 -9
  29. data/lib/processout/errors/internal_error.rb +0 -9
  30. data/lib/processout/errors/notfound_error.rb +0 -9
  31. data/lib/processout/errors/validation_error.rb +0 -9
  32. data/lib/processout/event.rb +0 -237
  33. data/lib/processout/gateway.rb +0 -210
  34. data/lib/processout/gateway_configuration.rb +0 -346
  35. data/lib/processout/gateway_request.rb +0 -26
  36. data/lib/processout/invoice.rb +0 -945
  37. data/lib/processout/invoice_detail.rb +0 -224
  38. data/lib/processout/invoice_device.rb +0 -92
  39. data/lib/processout/invoice_external_fraud_tools.rb +0 -70
  40. data/lib/processout/invoice_risk.rb +0 -81
  41. data/lib/processout/invoice_shipping.rb +0 -191
  42. data/lib/processout/invoice_tax.rb +0 -81
  43. data/lib/processout/networking/request.rb +0 -102
  44. data/lib/processout/networking/response.rb +0 -67
  45. data/lib/processout/payment_data_network_authentication.rb +0 -70
  46. data/lib/processout/payment_data_three_ds_authentication.rb +0 -70
  47. data/lib/processout/payment_data_three_ds_request.rb +0 -103
  48. data/lib/processout/payout.rb +0 -379
  49. data/lib/processout/payout_item.rb +0 -238
  50. data/lib/processout/plan.rb +0 -368
  51. data/lib/processout/product.rb +0 -368
  52. data/lib/processout/project.rb +0 -353
  53. data/lib/processout/refund.rb +0 -265
  54. data/lib/processout/subscription.rb +0 -910
  55. data/lib/processout/three_ds.rb +0 -158
  56. data/lib/processout/token.rb +0 -482
  57. data/lib/processout/transaction.rb +0 -894
  58. data/lib/processout/transaction_operation.rb +0 -418
  59. data/lib/processout/version.rb +0 -3
  60. data/lib/processout/webhook.rb +0 -237
  61. data/lib/processout/webhook_endpoint.rb +0 -149
  62. data/lib/processout.rb +0 -251
  63. data/processout.gemspec +0 -26
@@ -1,158 +0,0 @@
1
- # The content of this file was automatically generated
2
-
3
- require "cgi"
4
- require "json"
5
- require "processout/networking/request"
6
- require "processout/networking/response"
7
-
8
- module ProcessOut
9
- class ThreeDS
10
-
11
- attr_reader :version
12
- attr_reader :status
13
- attr_reader :fingerprinted
14
- attr_reader :challenged
15
- attr_reader :ares_trans_status
16
- attr_reader :cres_trans_status
17
- attr_reader :ds_trans_id
18
- attr_reader :fingerprint_completion_indicator
19
- attr_reader :server_trans_id
20
-
21
-
22
- def version=(val)
23
- @version = val
24
- end
25
-
26
- def status=(val)
27
- @status = val
28
- end
29
-
30
- def fingerprinted=(val)
31
- @fingerprinted = val
32
- end
33
-
34
- def challenged=(val)
35
- @challenged = val
36
- end
37
-
38
- def ares_trans_status=(val)
39
- @ares_trans_status = val
40
- end
41
-
42
- def cres_trans_status=(val)
43
- @cres_trans_status = val
44
- end
45
-
46
- def ds_trans_id=(val)
47
- @ds_trans_id = val
48
- end
49
-
50
- def fingerprint_completion_indicator=(val)
51
- @fingerprint_completion_indicator = val
52
- end
53
-
54
- def server_trans_id=(val)
55
- @server_trans_id = val
56
- end
57
-
58
-
59
- # Initializes the ThreeDS object
60
- # Params:
61
- # +client+:: +ProcessOut+ client instance
62
- # +data+:: data that can be used to fill the object
63
- def initialize(client, data = {})
64
- @client = client
65
-
66
- self.version = data.fetch(:version, nil)
67
- self.status = data.fetch(:status, nil)
68
- self.fingerprinted = data.fetch(:fingerprinted, nil)
69
- self.challenged = data.fetch(:challenged, nil)
70
- self.ares_trans_status = data.fetch(:ares_trans_status, nil)
71
- self.cres_trans_status = data.fetch(:cres_trans_status, nil)
72
- self.ds_trans_id = data.fetch(:ds_trans_id, nil)
73
- self.fingerprint_completion_indicator = data.fetch(:fingerprint_completion_indicator, nil)
74
- self.server_trans_id = data.fetch(:server_trans_id, nil)
75
-
76
- end
77
-
78
- # Create a new ThreeDS using the current client
79
- def new(data = {})
80
- ThreeDS.new(@client, data)
81
- end
82
-
83
- # Overrides the JSON marshaller to only send the fields we want
84
- def to_json(options)
85
- {
86
- "version": self.version,
87
- "status": self.status,
88
- "fingerprinted": self.fingerprinted,
89
- "challenged": self.challenged,
90
- "ares_trans_status": self.ares_trans_status,
91
- "cres_trans_status": self.cres_trans_status,
92
- "ds_trans_id": self.ds_trans_id,
93
- "fingerprint_completion_indicator": self.fingerprint_completion_indicator,
94
- "server_trans_id": self.server_trans_id,
95
- }.to_json
96
- end
97
-
98
- # Fills the object with data coming from the API
99
- # Params:
100
- # +data+:: +Hash+ of data coming from the API
101
- def fill_with_data(data)
102
- if data.nil?
103
- return self
104
- end
105
- if data.include? "version"
106
- self.version = data["version"]
107
- end
108
- if data.include? "status"
109
- self.status = data["status"]
110
- end
111
- if data.include? "fingerprinted"
112
- self.fingerprinted = data["fingerprinted"]
113
- end
114
- if data.include? "challenged"
115
- self.challenged = data["challenged"]
116
- end
117
- if data.include? "ares_trans_status"
118
- self.ares_trans_status = data["ares_trans_status"]
119
- end
120
- if data.include? "cres_trans_status"
121
- self.cres_trans_status = data["cres_trans_status"]
122
- end
123
- if data.include? "ds_trans_id"
124
- self.ds_trans_id = data["ds_trans_id"]
125
- end
126
- if data.include? "fingerprint_completion_indicator"
127
- self.fingerprint_completion_indicator = data["fingerprint_completion_indicator"]
128
- end
129
- if data.include? "server_trans_id"
130
- self.server_trans_id = data["server_trans_id"]
131
- end
132
-
133
- self
134
- end
135
-
136
- # Prefills the object with the data passed as parameters
137
- # Params:
138
- # +data+:: +Hash+ of data
139
- def prefill(data)
140
- if data.nil?
141
- return self
142
- end
143
- self.version = data.fetch(:version, self.version)
144
- self.status = data.fetch(:status, self.status)
145
- self.fingerprinted = data.fetch(:fingerprinted, self.fingerprinted)
146
- self.challenged = data.fetch(:challenged, self.challenged)
147
- self.ares_trans_status = data.fetch(:ares_trans_status, self.ares_trans_status)
148
- self.cres_trans_status = data.fetch(:cres_trans_status, self.cres_trans_status)
149
- self.ds_trans_id = data.fetch(:ds_trans_id, self.ds_trans_id)
150
- self.fingerprint_completion_indicator = data.fetch(:fingerprint_completion_indicator, self.fingerprint_completion_indicator)
151
- self.server_trans_id = data.fetch(:server_trans_id, self.server_trans_id)
152
-
153
- self
154
- end
155
-
156
-
157
- end
158
- end
@@ -1,482 +0,0 @@
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 Token
10
-
11
- attr_reader :id
12
- attr_reader :customer
13
- attr_reader :customer_id
14
- attr_reader :gateway_configuration
15
- attr_reader :gateway_configuration_id
16
- attr_reader :card
17
- attr_reader :card_id
18
- attr_reader :type
19
- attr_reader :metadata
20
- attr_reader :is_subscription_only
21
- attr_reader :is_default
22
- attr_reader :return_url
23
- attr_reader :cancel_url
24
- attr_reader :summary
25
- attr_reader :is_chargeable
26
- attr_reader :created_at
27
- attr_reader :description
28
- attr_reader :invoice
29
- attr_reader :invoice_id
30
- attr_reader :manual_invoice_cancellation
31
- attr_reader :can_get_balance
32
-
33
-
34
- def id=(val)
35
- @id = val
36
- end
37
-
38
- def customer=(val)
39
- if val.nil?
40
- @customer = val
41
- return
42
- end
43
-
44
- if val.instance_of? Customer
45
- @customer = val
46
- else
47
- obj = Customer.new(@client)
48
- obj.fill_with_data(val)
49
- @customer = obj
50
- end
51
-
52
- end
53
-
54
- def customer_id=(val)
55
- @customer_id = val
56
- end
57
-
58
- def gateway_configuration=(val)
59
- if val.nil?
60
- @gateway_configuration = val
61
- return
62
- end
63
-
64
- if val.instance_of? GatewayConfiguration
65
- @gateway_configuration = val
66
- else
67
- obj = GatewayConfiguration.new(@client)
68
- obj.fill_with_data(val)
69
- @gateway_configuration = obj
70
- end
71
-
72
- end
73
-
74
- def gateway_configuration_id=(val)
75
- @gateway_configuration_id = val
76
- end
77
-
78
- def card=(val)
79
- if val.nil?
80
- @card = val
81
- return
82
- end
83
-
84
- if val.instance_of? Card
85
- @card = val
86
- else
87
- obj = Card.new(@client)
88
- obj.fill_with_data(val)
89
- @card = obj
90
- end
91
-
92
- end
93
-
94
- def card_id=(val)
95
- @card_id = val
96
- end
97
-
98
- def type=(val)
99
- @type = val
100
- end
101
-
102
- def metadata=(val)
103
- @metadata = val
104
- end
105
-
106
- def is_subscription_only=(val)
107
- @is_subscription_only = val
108
- end
109
-
110
- def is_default=(val)
111
- @is_default = val
112
- end
113
-
114
- def return_url=(val)
115
- @return_url = val
116
- end
117
-
118
- def cancel_url=(val)
119
- @cancel_url = val
120
- end
121
-
122
- def summary=(val)
123
- @summary = val
124
- end
125
-
126
- def is_chargeable=(val)
127
- @is_chargeable = val
128
- end
129
-
130
- def created_at=(val)
131
- @created_at = val
132
- end
133
-
134
- def description=(val)
135
- @description = val
136
- end
137
-
138
- def invoice=(val)
139
- if val.nil?
140
- @invoice = val
141
- return
142
- end
143
-
144
- if val.instance_of? Invoice
145
- @invoice = val
146
- else
147
- obj = Invoice.new(@client)
148
- obj.fill_with_data(val)
149
- @invoice = obj
150
- end
151
-
152
- end
153
-
154
- def invoice_id=(val)
155
- @invoice_id = val
156
- end
157
-
158
- def manual_invoice_cancellation=(val)
159
- @manual_invoice_cancellation = val
160
- end
161
-
162
- def can_get_balance=(val)
163
- @can_get_balance = val
164
- end
165
-
166
-
167
- # Initializes the Token object
168
- # Params:
169
- # +client+:: +ProcessOut+ client instance
170
- # +data+:: data that can be used to fill the object
171
- def initialize(client, data = {})
172
- @client = client
173
-
174
- self.id = data.fetch(:id, nil)
175
- self.customer = data.fetch(:customer, nil)
176
- self.customer_id = data.fetch(:customer_id, nil)
177
- self.gateway_configuration = data.fetch(:gateway_configuration, nil)
178
- self.gateway_configuration_id = data.fetch(:gateway_configuration_id, nil)
179
- self.card = data.fetch(:card, nil)
180
- self.card_id = data.fetch(:card_id, nil)
181
- self.type = data.fetch(:type, nil)
182
- self.metadata = data.fetch(:metadata, nil)
183
- self.is_subscription_only = data.fetch(:is_subscription_only, nil)
184
- self.is_default = data.fetch(:is_default, nil)
185
- self.return_url = data.fetch(:return_url, nil)
186
- self.cancel_url = data.fetch(:cancel_url, nil)
187
- self.summary = data.fetch(:summary, nil)
188
- self.is_chargeable = data.fetch(:is_chargeable, nil)
189
- self.created_at = data.fetch(:created_at, nil)
190
- self.description = data.fetch(:description, nil)
191
- self.invoice = data.fetch(:invoice, nil)
192
- self.invoice_id = data.fetch(:invoice_id, nil)
193
- self.manual_invoice_cancellation = data.fetch(:manual_invoice_cancellation, nil)
194
- self.can_get_balance = data.fetch(:can_get_balance, nil)
195
-
196
- end
197
-
198
- # Create a new Token using the current client
199
- def new(data = {})
200
- Token.new(@client, data)
201
- end
202
-
203
- # Overrides the JSON marshaller to only send the fields we want
204
- def to_json(options)
205
- {
206
- "id": self.id,
207
- "customer": self.customer,
208
- "customer_id": self.customer_id,
209
- "gateway_configuration": self.gateway_configuration,
210
- "gateway_configuration_id": self.gateway_configuration_id,
211
- "card": self.card,
212
- "card_id": self.card_id,
213
- "type": self.type,
214
- "metadata": self.metadata,
215
- "is_subscription_only": self.is_subscription_only,
216
- "is_default": self.is_default,
217
- "return_url": self.return_url,
218
- "cancel_url": self.cancel_url,
219
- "summary": self.summary,
220
- "is_chargeable": self.is_chargeable,
221
- "created_at": self.created_at,
222
- "description": self.description,
223
- "invoice": self.invoice,
224
- "invoice_id": self.invoice_id,
225
- "manual_invoice_cancellation": self.manual_invoice_cancellation,
226
- "can_get_balance": self.can_get_balance,
227
- }.to_json
228
- end
229
-
230
- # Fills the object with data coming from the API
231
- # Params:
232
- # +data+:: +Hash+ of data coming from the API
233
- def fill_with_data(data)
234
- if data.nil?
235
- return self
236
- end
237
- if data.include? "id"
238
- self.id = data["id"]
239
- end
240
- if data.include? "customer"
241
- self.customer = data["customer"]
242
- end
243
- if data.include? "customer_id"
244
- self.customer_id = data["customer_id"]
245
- end
246
- if data.include? "gateway_configuration"
247
- self.gateway_configuration = data["gateway_configuration"]
248
- end
249
- if data.include? "gateway_configuration_id"
250
- self.gateway_configuration_id = data["gateway_configuration_id"]
251
- end
252
- if data.include? "card"
253
- self.card = data["card"]
254
- end
255
- if data.include? "card_id"
256
- self.card_id = data["card_id"]
257
- end
258
- if data.include? "type"
259
- self.type = data["type"]
260
- end
261
- if data.include? "metadata"
262
- self.metadata = data["metadata"]
263
- end
264
- if data.include? "is_subscription_only"
265
- self.is_subscription_only = data["is_subscription_only"]
266
- end
267
- if data.include? "is_default"
268
- self.is_default = data["is_default"]
269
- end
270
- if data.include? "return_url"
271
- self.return_url = data["return_url"]
272
- end
273
- if data.include? "cancel_url"
274
- self.cancel_url = data["cancel_url"]
275
- end
276
- if data.include? "summary"
277
- self.summary = data["summary"]
278
- end
279
- if data.include? "is_chargeable"
280
- self.is_chargeable = data["is_chargeable"]
281
- end
282
- if data.include? "created_at"
283
- self.created_at = data["created_at"]
284
- end
285
- if data.include? "description"
286
- self.description = data["description"]
287
- end
288
- if data.include? "invoice"
289
- self.invoice = data["invoice"]
290
- end
291
- if data.include? "invoice_id"
292
- self.invoice_id = data["invoice_id"]
293
- end
294
- if data.include? "manual_invoice_cancellation"
295
- self.manual_invoice_cancellation = data["manual_invoice_cancellation"]
296
- end
297
- if data.include? "can_get_balance"
298
- self.can_get_balance = data["can_get_balance"]
299
- end
300
-
301
- self
302
- end
303
-
304
- # Prefills the object with the data passed as parameters
305
- # Params:
306
- # +data+:: +Hash+ of data
307
- def prefill(data)
308
- if data.nil?
309
- return self
310
- end
311
- self.id = data.fetch(:id, self.id)
312
- self.customer = data.fetch(:customer, self.customer)
313
- self.customer_id = data.fetch(:customer_id, self.customer_id)
314
- self.gateway_configuration = data.fetch(:gateway_configuration, self.gateway_configuration)
315
- self.gateway_configuration_id = data.fetch(:gateway_configuration_id, self.gateway_configuration_id)
316
- self.card = data.fetch(:card, self.card)
317
- self.card_id = data.fetch(:card_id, self.card_id)
318
- self.type = data.fetch(:type, self.type)
319
- self.metadata = data.fetch(:metadata, self.metadata)
320
- self.is_subscription_only = data.fetch(:is_subscription_only, self.is_subscription_only)
321
- self.is_default = data.fetch(:is_default, self.is_default)
322
- self.return_url = data.fetch(:return_url, self.return_url)
323
- self.cancel_url = data.fetch(:cancel_url, self.cancel_url)
324
- self.summary = data.fetch(:summary, self.summary)
325
- self.is_chargeable = data.fetch(:is_chargeable, self.is_chargeable)
326
- self.created_at = data.fetch(:created_at, self.created_at)
327
- self.description = data.fetch(:description, self.description)
328
- self.invoice = data.fetch(:invoice, self.invoice)
329
- self.invoice_id = data.fetch(:invoice_id, self.invoice_id)
330
- self.manual_invoice_cancellation = data.fetch(:manual_invoice_cancellation, self.manual_invoice_cancellation)
331
- self.can_get_balance = data.fetch(:can_get_balance, self.can_get_balance)
332
-
333
- self
334
- end
335
-
336
- # Get the customer's tokens.
337
- # Params:
338
- # +customer_id+:: ID of the customer
339
- # +options+:: +Hash+ of options
340
- def fetch_customer_tokens(customer_id, options = {})
341
- self.prefill(options)
342
-
343
- request = Request.new(@client)
344
- path = "/customers/" + CGI.escape(customer_id) + "/tokens"
345
- data = {
346
-
347
- }
348
-
349
- response = Response.new(request.get(path, data, options))
350
- return_values = Array.new
351
-
352
- a = Array.new
353
- body = response.body
354
- for v in body['tokens']
355
- tmp = Token.new(@client)
356
- tmp.fill_with_data(v)
357
- a.push(tmp)
358
- end
359
-
360
- return_values.push(a)
361
-
362
-
363
-
364
- return_values[0]
365
- end
366
-
367
- # Find a customer's token by its ID.
368
- # Params:
369
- # +customer_id+:: ID of the customer
370
- # +token_id+:: ID of the token
371
- # +options+:: +Hash+ of options
372
- def find(customer_id, token_id, options = {})
373
- self.prefill(options)
374
-
375
- request = Request.new(@client)
376
- path = "/customers/" + CGI.escape(customer_id) + "/tokens/" + CGI.escape(token_id) + ""
377
- data = {
378
-
379
- }
380
-
381
- response = Response.new(request.get(path, data, options))
382
- return_values = Array.new
383
-
384
- body = response.body
385
- body = body["token"]
386
-
387
-
388
- obj = Token.new(@client)
389
- return_values.push(obj.fill_with_data(body))
390
-
391
-
392
-
393
- return_values[0]
394
- end
395
-
396
- # Create a new token for the given customer ID.
397
- # Params:
398
- # +options+:: +Hash+ of options
399
- def create(options = {})
400
- self.prefill(options)
401
-
402
- request = Request.new(@client)
403
- path = "/customers/" + CGI.escape(@customer_id) + "/tokens"
404
- data = {
405
- "metadata" => @metadata,
406
- "return_url" => @return_url,
407
- "cancel_url" => @cancel_url,
408
- "description" => @description,
409
- "invoice_id" => @invoice_id,
410
- "manual_invoice_cancellation" => @manual_invoice_cancellation,
411
- "source" => options.fetch(:source, nil),
412
- "settings" => options.fetch(:settings, nil),
413
- "device" => options.fetch(:device, nil),
414
- "verify" => options.fetch(:verify, nil),
415
- "verify_metadata" => options.fetch(:verify_metadata, nil),
416
- "set_default" => options.fetch(:set_default, nil)
417
- }
418
-
419
- response = Response.new(request.post(path, data, options))
420
- return_values = Array.new
421
-
422
- body = response.body
423
- body = body["token"]
424
-
425
-
426
- return_values.push(self.fill_with_data(body))
427
-
428
-
429
-
430
- return_values[0]
431
- end
432
-
433
- # Save the updated customer attributes.
434
- # Params:
435
- # +options+:: +Hash+ of options
436
- def save(options = {})
437
- self.prefill(options)
438
-
439
- request = Request.new(@client)
440
- path = "/customers/" + CGI.escape(@customer_id) + "/tokens/" + CGI.escape(@id) + ""
441
- data = {
442
- "source" => options.fetch(:source, nil),
443
- "settings" => options.fetch(:settings, nil),
444
- "device" => options.fetch(:device, nil),
445
- "verify" => options.fetch(:verify, nil),
446
- "verify_metadata" => options.fetch(:verify_metadata, nil),
447
- "set_default" => options.fetch(:set_default, nil)
448
- }
449
-
450
- response = Response.new(request.put(path, data, options))
451
- return_values = Array.new
452
-
453
- return_values.push(response.success)
454
-
455
-
456
- return_values[0]
457
- end
458
-
459
- # Delete a customer token
460
- # Params:
461
- # +options+:: +Hash+ of options
462
- def delete(options = {})
463
- self.prefill(options)
464
-
465
- request = Request.new(@client)
466
- path = "/customers/" + CGI.escape(@customer_id) + "/tokens/" + CGI.escape(@id) + ""
467
- data = {
468
-
469
- }
470
-
471
- response = Response.new(request.delete(path, data, options))
472
- return_values = Array.new
473
-
474
- return_values.push(response.success)
475
-
476
-
477
- return_values[0]
478
- end
479
-
480
-
481
- end
482
- end