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,401 +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 Addon
10
-
11
- attr_reader :id
12
- attr_reader :project
13
- attr_reader :project_id
14
- attr_reader :subscription
15
- attr_reader :subscription_id
16
- attr_reader :plan
17
- attr_reader :plan_id
18
- attr_reader :type
19
- attr_reader :name
20
- attr_reader :amount
21
- attr_reader :quantity
22
- attr_reader :metadata
23
- attr_reader :sandbox
24
- attr_reader :created_at
25
-
26
-
27
- def id=(val)
28
- @id = val
29
- end
30
-
31
- def project=(val)
32
- if val.nil?
33
- @project = val
34
- return
35
- end
36
-
37
- if val.instance_of? Project
38
- @project = val
39
- else
40
- obj = Project.new(@client)
41
- obj.fill_with_data(val)
42
- @project = obj
43
- end
44
-
45
- end
46
-
47
- def project_id=(val)
48
- @project_id = val
49
- end
50
-
51
- def subscription=(val)
52
- if val.nil?
53
- @subscription = val
54
- return
55
- end
56
-
57
- if val.instance_of? Subscription
58
- @subscription = val
59
- else
60
- obj = Subscription.new(@client)
61
- obj.fill_with_data(val)
62
- @subscription = obj
63
- end
64
-
65
- end
66
-
67
- def subscription_id=(val)
68
- @subscription_id = val
69
- end
70
-
71
- def plan=(val)
72
- if val.nil?
73
- @plan = val
74
- return
75
- end
76
-
77
- if val.instance_of? Plan
78
- @plan = val
79
- else
80
- obj = Plan.new(@client)
81
- obj.fill_with_data(val)
82
- @plan = obj
83
- end
84
-
85
- end
86
-
87
- def plan_id=(val)
88
- @plan_id = val
89
- end
90
-
91
- def type=(val)
92
- @type = val
93
- end
94
-
95
- def name=(val)
96
- @name = val
97
- end
98
-
99
- def amount=(val)
100
- @amount = val
101
- end
102
-
103
- def quantity=(val)
104
- @quantity = val
105
- end
106
-
107
- def metadata=(val)
108
- @metadata = val
109
- end
110
-
111
- def sandbox=(val)
112
- @sandbox = val
113
- end
114
-
115
- def created_at=(val)
116
- @created_at = val
117
- end
118
-
119
-
120
- # Initializes the Addon object
121
- # Params:
122
- # +client+:: +ProcessOut+ client instance
123
- # +data+:: data that can be used to fill the object
124
- def initialize(client, data = {})
125
- @client = client
126
-
127
- self.id = data.fetch(:id, nil)
128
- self.project = data.fetch(:project, nil)
129
- self.project_id = data.fetch(:project_id, nil)
130
- self.subscription = data.fetch(:subscription, nil)
131
- self.subscription_id = data.fetch(:subscription_id, nil)
132
- self.plan = data.fetch(:plan, nil)
133
- self.plan_id = data.fetch(:plan_id, nil)
134
- self.type = data.fetch(:type, nil)
135
- self.name = data.fetch(:name, nil)
136
- self.amount = data.fetch(:amount, nil)
137
- self.quantity = data.fetch(:quantity, nil)
138
- self.metadata = data.fetch(:metadata, nil)
139
- self.sandbox = data.fetch(:sandbox, nil)
140
- self.created_at = data.fetch(:created_at, nil)
141
-
142
- end
143
-
144
- # Create a new Addon using the current client
145
- def new(data = {})
146
- Addon.new(@client, data)
147
- end
148
-
149
- # Overrides the JSON marshaller to only send the fields we want
150
- def to_json(options)
151
- {
152
- "id": self.id,
153
- "project": self.project,
154
- "project_id": self.project_id,
155
- "subscription": self.subscription,
156
- "subscription_id": self.subscription_id,
157
- "plan": self.plan,
158
- "plan_id": self.plan_id,
159
- "type": self.type,
160
- "name": self.name,
161
- "amount": self.amount,
162
- "quantity": self.quantity,
163
- "metadata": self.metadata,
164
- "sandbox": self.sandbox,
165
- "created_at": self.created_at,
166
- }.to_json
167
- end
168
-
169
- # Fills the object with data coming from the API
170
- # Params:
171
- # +data+:: +Hash+ of data coming from the API
172
- def fill_with_data(data)
173
- if data.nil?
174
- return self
175
- end
176
- if data.include? "id"
177
- self.id = data["id"]
178
- end
179
- if data.include? "project"
180
- self.project = data["project"]
181
- end
182
- if data.include? "project_id"
183
- self.project_id = data["project_id"]
184
- end
185
- if data.include? "subscription"
186
- self.subscription = data["subscription"]
187
- end
188
- if data.include? "subscription_id"
189
- self.subscription_id = data["subscription_id"]
190
- end
191
- if data.include? "plan"
192
- self.plan = data["plan"]
193
- end
194
- if data.include? "plan_id"
195
- self.plan_id = data["plan_id"]
196
- end
197
- if data.include? "type"
198
- self.type = data["type"]
199
- end
200
- if data.include? "name"
201
- self.name = data["name"]
202
- end
203
- if data.include? "amount"
204
- self.amount = data["amount"]
205
- end
206
- if data.include? "quantity"
207
- self.quantity = data["quantity"]
208
- end
209
- if data.include? "metadata"
210
- self.metadata = data["metadata"]
211
- end
212
- if data.include? "sandbox"
213
- self.sandbox = data["sandbox"]
214
- end
215
- if data.include? "created_at"
216
- self.created_at = data["created_at"]
217
- end
218
-
219
- self
220
- end
221
-
222
- # Prefills the object with the data passed as parameters
223
- # Params:
224
- # +data+:: +Hash+ of data
225
- def prefill(data)
226
- if data.nil?
227
- return self
228
- end
229
- self.id = data.fetch(:id, self.id)
230
- self.project = data.fetch(:project, self.project)
231
- self.project_id = data.fetch(:project_id, self.project_id)
232
- self.subscription = data.fetch(:subscription, self.subscription)
233
- self.subscription_id = data.fetch(:subscription_id, self.subscription_id)
234
- self.plan = data.fetch(:plan, self.plan)
235
- self.plan_id = data.fetch(:plan_id, self.plan_id)
236
- self.type = data.fetch(:type, self.type)
237
- self.name = data.fetch(:name, self.name)
238
- self.amount = data.fetch(:amount, self.amount)
239
- self.quantity = data.fetch(:quantity, self.quantity)
240
- self.metadata = data.fetch(:metadata, self.metadata)
241
- self.sandbox = data.fetch(:sandbox, self.sandbox)
242
- self.created_at = data.fetch(:created_at, self.created_at)
243
-
244
- self
245
- end
246
-
247
- # Get the addons applied to the subscription.
248
- # Params:
249
- # +subscription_id+:: ID of the subscription
250
- # +options+:: +Hash+ of options
251
- def fetch_subscription_addons(subscription_id, options = {})
252
- self.prefill(options)
253
-
254
- request = Request.new(@client)
255
- path = "/subscriptions/" + CGI.escape(subscription_id) + "/addons"
256
- data = {
257
-
258
- }
259
-
260
- response = Response.new(request.get(path, data, options))
261
- return_values = Array.new
262
-
263
- a = Array.new
264
- body = response.body
265
- for v in body['addons']
266
- tmp = Addon.new(@client)
267
- tmp.fill_with_data(v)
268
- a.push(tmp)
269
- end
270
-
271
- return_values.push(a)
272
-
273
-
274
-
275
- return_values[0]
276
- end
277
-
278
- # Create a new addon to the given subscription ID.
279
- # Params:
280
- # +options+:: +Hash+ of options
281
- def create(options = {})
282
- self.prefill(options)
283
-
284
- request = Request.new(@client)
285
- path = "/subscriptions/" + CGI.escape(@subscription_id) + "/addons"
286
- data = {
287
- "plan_id" => @plan_id,
288
- "type" => @type,
289
- "name" => @name,
290
- "amount" => @amount,
291
- "quantity" => @quantity,
292
- "metadata" => @metadata,
293
- "prorate" => options.fetch(:prorate, nil),
294
- "proration_date" => options.fetch(:proration_date, nil),
295
- "preview" => options.fetch(:preview, nil)
296
- }
297
-
298
- response = Response.new(request.post(path, data, options))
299
- return_values = Array.new
300
-
301
- body = response.body
302
- body = body["addon"]
303
-
304
-
305
- return_values.push(self.fill_with_data(body))
306
-
307
-
308
-
309
- return_values[0]
310
- end
311
-
312
- # Find a subscription's addon by its ID.
313
- # Params:
314
- # +subscription_id+:: ID of the subscription on which the addon was applied
315
- # +addon_id+:: ID of the addon
316
- # +options+:: +Hash+ of options
317
- def find(subscription_id, addon_id, options = {})
318
- self.prefill(options)
319
-
320
- request = Request.new(@client)
321
- path = "/subscriptions/" + CGI.escape(subscription_id) + "/addons/" + CGI.escape(addon_id) + ""
322
- data = {
323
-
324
- }
325
-
326
- response = Response.new(request.get(path, data, options))
327
- return_values = Array.new
328
-
329
- body = response.body
330
- body = body["addon"]
331
-
332
-
333
- obj = Addon.new(@client)
334
- return_values.push(obj.fill_with_data(body))
335
-
336
-
337
-
338
- return_values[0]
339
- end
340
-
341
- # Save the updated addon attributes.
342
- # Params:
343
- # +options+:: +Hash+ of options
344
- def save(options = {})
345
- self.prefill(options)
346
-
347
- request = Request.new(@client)
348
- path = "/subscriptions/" + CGI.escape(@subscription_id) + "/addons/" + CGI.escape(@id) + ""
349
- data = {
350
- "plan_id" => @plan_id,
351
- "type" => @type,
352
- "name" => @name,
353
- "amount" => @amount,
354
- "quantity" => @quantity,
355
- "metadata" => @metadata,
356
- "prorate" => options.fetch(:prorate, nil),
357
- "proration_date" => options.fetch(:proration_date, nil),
358
- "preview" => options.fetch(:preview, nil),
359
- "increment_quantity_by" => options.fetch(:increment_quantity_by, nil)
360
- }
361
-
362
- response = Response.new(request.put(path, data, options))
363
- return_values = Array.new
364
-
365
- body = response.body
366
- body = body["addon"]
367
-
368
-
369
- return_values.push(self.fill_with_data(body))
370
-
371
-
372
-
373
- return_values[0]
374
- end
375
-
376
- # Delete an addon applied to a subscription.
377
- # Params:
378
- # +options+:: +Hash+ of options
379
- def delete(options = {})
380
- self.prefill(options)
381
-
382
- request = Request.new(@client)
383
- path = "/subscriptions/" + CGI.escape(@subscription_id) + "/addons/" + CGI.escape(@id) + ""
384
- data = {
385
- "prorate" => options.fetch(:prorate, nil),
386
- "proration_date" => options.fetch(:proration_date, nil),
387
- "preview" => options.fetch(:preview, nil)
388
- }
389
-
390
- response = Response.new(request.delete(path, data, options))
391
- return_values = Array.new
392
-
393
- return_values.push(response.success)
394
-
395
-
396
- return_values[0]
397
- end
398
-
399
-
400
- end
401
- end
@@ -1,295 +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 APIRequest
10
-
11
- attr_reader :id
12
- attr_reader :project
13
- attr_reader :api_version
14
- attr_reader :idempotency_key
15
- attr_reader :url
16
- attr_reader :method
17
- attr_reader :headers
18
- attr_reader :body
19
- attr_reader :response_code
20
- attr_reader :response_headers
21
- attr_reader :response_body
22
- attr_reader :response_ms
23
- attr_reader :sandbox
24
- attr_reader :created_at
25
-
26
-
27
- def id=(val)
28
- @id = val
29
- end
30
-
31
- def project=(val)
32
- if val.nil?
33
- @project = val
34
- return
35
- end
36
-
37
- if val.instance_of? Project
38
- @project = val
39
- else
40
- obj = Project.new(@client)
41
- obj.fill_with_data(val)
42
- @project = obj
43
- end
44
-
45
- end
46
-
47
- def api_version=(val)
48
- if val.nil?
49
- @api_version = val
50
- return
51
- end
52
-
53
- if val.instance_of? APIVersion
54
- @api_version = val
55
- else
56
- obj = APIVersion.new(@client)
57
- obj.fill_with_data(val)
58
- @api_version = obj
59
- end
60
-
61
- end
62
-
63
- def idempotency_key=(val)
64
- @idempotency_key = val
65
- end
66
-
67
- def url=(val)
68
- @url = val
69
- end
70
-
71
- def method=(val)
72
- @method = val
73
- end
74
-
75
- def headers=(val)
76
- @headers = val
77
- end
78
-
79
- def body=(val)
80
- @body = val
81
- end
82
-
83
- def response_code=(val)
84
- @response_code = val
85
- end
86
-
87
- def response_headers=(val)
88
- @response_headers = val
89
- end
90
-
91
- def response_body=(val)
92
- @response_body = val
93
- end
94
-
95
- def response_ms=(val)
96
- @response_ms = val
97
- end
98
-
99
- def sandbox=(val)
100
- @sandbox = val
101
- end
102
-
103
- def created_at=(val)
104
- @created_at = val
105
- end
106
-
107
-
108
- # Initializes the APIRequest object
109
- # Params:
110
- # +client+:: +ProcessOut+ client instance
111
- # +data+:: data that can be used to fill the object
112
- def initialize(client, data = {})
113
- @client = client
114
-
115
- self.id = data.fetch(:id, nil)
116
- self.project = data.fetch(:project, nil)
117
- self.api_version = data.fetch(:api_version, nil)
118
- self.idempotency_key = data.fetch(:idempotency_key, nil)
119
- self.url = data.fetch(:url, nil)
120
- self.method = data.fetch(:method, nil)
121
- self.headers = data.fetch(:headers, nil)
122
- self.body = data.fetch(:body, nil)
123
- self.response_code = data.fetch(:response_code, nil)
124
- self.response_headers = data.fetch(:response_headers, nil)
125
- self.response_body = data.fetch(:response_body, nil)
126
- self.response_ms = data.fetch(:response_ms, nil)
127
- self.sandbox = data.fetch(:sandbox, nil)
128
- self.created_at = data.fetch(:created_at, nil)
129
-
130
- end
131
-
132
- # Create a new APIRequest using the current client
133
- def new(data = {})
134
- APIRequest.new(@client, data)
135
- end
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
- "api_version": self.api_version,
143
- "idempotency_key": self.idempotency_key,
144
- "url": self.url,
145
- "method": self.method,
146
- "headers": self.headers,
147
- "body": self.body,
148
- "response_code": self.response_code,
149
- "response_headers": self.response_headers,
150
- "response_body": self.response_body,
151
- "response_ms": self.response_ms,
152
- "sandbox": self.sandbox,
153
- "created_at": self.created_at,
154
- }.to_json
155
- end
156
-
157
- # Fills the object with data coming from the API
158
- # Params:
159
- # +data+:: +Hash+ of data coming from the API
160
- def fill_with_data(data)
161
- if data.nil?
162
- return self
163
- end
164
- if data.include? "id"
165
- self.id = data["id"]
166
- end
167
- if data.include? "project"
168
- self.project = data["project"]
169
- end
170
- if data.include? "api_version"
171
- self.api_version = data["api_version"]
172
- end
173
- if data.include? "idempotency_key"
174
- self.idempotency_key = data["idempotency_key"]
175
- end
176
- if data.include? "url"
177
- self.url = data["url"]
178
- end
179
- if data.include? "method"
180
- self.method = data["method"]
181
- end
182
- if data.include? "headers"
183
- self.headers = data["headers"]
184
- end
185
- if data.include? "body"
186
- self.body = data["body"]
187
- end
188
- if data.include? "response_code"
189
- self.response_code = data["response_code"]
190
- end
191
- if data.include? "response_headers"
192
- self.response_headers = data["response_headers"]
193
- end
194
- if data.include? "response_body"
195
- self.response_body = data["response_body"]
196
- end
197
- if data.include? "response_ms"
198
- self.response_ms = data["response_ms"]
199
- end
200
- if data.include? "sandbox"
201
- self.sandbox = data["sandbox"]
202
- end
203
- if data.include? "created_at"
204
- self.created_at = data["created_at"]
205
- end
206
-
207
- self
208
- end
209
-
210
- # Prefills the object with the data passed as parameters
211
- # Params:
212
- # +data+:: +Hash+ of data
213
- def prefill(data)
214
- if data.nil?
215
- return self
216
- end
217
- self.id = data.fetch(:id, self.id)
218
- self.project = data.fetch(:project, self.project)
219
- self.api_version = data.fetch(:api_version, self.api_version)
220
- self.idempotency_key = data.fetch(:idempotency_key, self.idempotency_key)
221
- self.url = data.fetch(:url, self.url)
222
- self.method = data.fetch(:method, self.method)
223
- self.headers = data.fetch(:headers, self.headers)
224
- self.body = data.fetch(:body, self.body)
225
- self.response_code = data.fetch(:response_code, self.response_code)
226
- self.response_headers = data.fetch(:response_headers, self.response_headers)
227
- self.response_body = data.fetch(:response_body, self.response_body)
228
- self.response_ms = data.fetch(:response_ms, self.response_ms)
229
- self.sandbox = data.fetch(:sandbox, self.sandbox)
230
- self.created_at = data.fetch(:created_at, self.created_at)
231
-
232
- self
233
- end
234
-
235
- # Get all the API requests.
236
- # Params:
237
- # +options+:: +Hash+ of options
238
- def all(options = {})
239
- self.prefill(options)
240
-
241
- request = Request.new(@client)
242
- path = "/api-requests"
243
- data = {
244
-
245
- }
246
-
247
- response = Response.new(request.get(path, data, options))
248
- return_values = Array.new
249
-
250
- a = Array.new
251
- body = response.body
252
- for v in body['api_requests']
253
- tmp = APIRequest.new(@client)
254
- tmp.fill_with_data(v)
255
- a.push(tmp)
256
- end
257
-
258
- return_values.push(a)
259
-
260
-
261
-
262
- return_values[0]
263
- end
264
-
265
- # Find an API request by its ID.
266
- # Params:
267
- # +api_request_id+:: ID of the API request
268
- # +options+:: +Hash+ of options
269
- def find(api_request_id, options = {})
270
- self.prefill(options)
271
-
272
- request = Request.new(@client)
273
- path = "/api-requests/{request_id}"
274
- data = {
275
-
276
- }
277
-
278
- response = Response.new(request.get(path, data, options))
279
- return_values = Array.new
280
-
281
- body = response.body
282
- body = body["api_request"]
283
-
284
-
285
- obj = APIRequest.new(@client)
286
- return_values.push(obj.fill_with_data(body))
287
-
288
-
289
-
290
- return_values[0]
291
- end
292
-
293
-
294
- end
295
- end