processout 2.11.0 → 2.14.4

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.
Files changed (42) hide show
  1. checksums.yaml +5 -5
  2. data/lib/processout.rb +12 -6
  3. data/lib/processout/activity.rb +14 -0
  4. data/lib/processout/addon.rb +21 -0
  5. data/lib/processout/api_request.rb +21 -0
  6. data/lib/processout/api_version.rb +10 -0
  7. data/lib/processout/card.rb +79 -0
  8. data/lib/processout/card_information.rb +14 -0
  9. data/lib/processout/coupon.rb +20 -0
  10. data/lib/processout/customer.rb +62 -24
  11. data/lib/processout/customer_action.rb +9 -0
  12. data/lib/processout/discount.rb +21 -0
  13. data/lib/processout/dunning_action.rb +9 -0
  14. data/lib/processout/event.rb +14 -31
  15. data/lib/processout/gateway.rb +18 -0
  16. data/lib/processout/gateway_configuration.rb +19 -1
  17. data/lib/processout/invoice.rb +136 -1
  18. data/lib/processout/invoice_detail.rb +22 -0
  19. data/lib/processout/invoice_device.rb +20 -0
  20. data/lib/processout/invoice_external_fraud_tools.rb +70 -0
  21. data/lib/processout/invoice_risk.rb +9 -0
  22. data/lib/processout/invoice_shipping.rb +19 -0
  23. data/lib/processout/networking/request.rb +1 -1
  24. data/lib/processout/payment_data_network_authentication.rb +8 -0
  25. data/lib/processout/payment_data_three_ds_authentication.rb +8 -0
  26. data/lib/processout/payment_data_three_ds_request.rb +11 -0
  27. data/lib/processout/payout.rb +27 -0
  28. data/lib/processout/payout_item.rb +20 -0
  29. data/lib/processout/plan.rb +21 -0
  30. data/lib/processout/product.rb +19 -0
  31. data/lib/processout/project.rb +18 -27
  32. data/lib/processout/refund.rb +17 -0
  33. data/lib/processout/subscription.rb +42 -0
  34. data/lib/processout/three_ds.rb +103 -0
  35. data/lib/processout/token.rb +138 -22
  36. data/lib/processout/transaction.rb +113 -0
  37. data/lib/processout/transaction_operation.rb +94 -0
  38. data/lib/processout/version.rb +1 -1
  39. data/lib/processout/webhook.rb +21 -0
  40. data/lib/processout/webhook_endpoint.rb +14 -0
  41. metadata +5 -5
  42. data/lib/processout/authorization_request.rb +0 -320
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.11.0
4
+ version: 2.14.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel HUEZ
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-06 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,7 +75,6 @@ files:
75
75
  - lib/processout/addon.rb
76
76
  - lib/processout/api_request.rb
77
77
  - lib/processout/api_version.rb
78
- - lib/processout/authorization_request.rb
79
78
  - lib/processout/card.rb
80
79
  - lib/processout/card_information.rb
81
80
  - lib/processout/coupon.rb
@@ -95,6 +94,7 @@ files:
95
94
  - lib/processout/invoice.rb
96
95
  - lib/processout/invoice_detail.rb
97
96
  - lib/processout/invoice_device.rb
97
+ - lib/processout/invoice_external_fraud_tools.rb
98
98
  - lib/processout/invoice_risk.rb
99
99
  - lib/processout/invoice_shipping.rb
100
100
  - lib/processout/networking/request.rb
@@ -109,6 +109,7 @@ files:
109
109
  - lib/processout/project.rb
110
110
  - lib/processout/refund.rb
111
111
  - lib/processout/subscription.rb
112
+ - lib/processout/three_ds.rb
112
113
  - lib/processout/token.rb
113
114
  - lib/processout/transaction.rb
114
115
  - lib/processout/transaction_operation.rb
@@ -135,8 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
136
  - !ruby/object:Gem::Version
136
137
  version: '0'
137
138
  requirements: []
138
- rubyforge_project:
139
- rubygems_version: 2.5.2.3
139
+ rubygems_version: 3.0.3
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Ruby bindings for the ProcessOut API
@@ -1,320 +0,0 @@
1
- # The content of this file was automatically generated
2
-
3
- require "cgi"
4
- require "processout/networking/request"
5
- require "processout/networking/response"
6
-
7
- module ProcessOut
8
- class AuthorizationRequest
9
-
10
- attr_reader :id
11
- attr_reader :project
12
- attr_reader :project_id
13
- attr_reader :customer
14
- attr_reader :customer_id
15
- attr_reader :token
16
- attr_reader :token_id
17
- attr_reader :name
18
- attr_reader :currency
19
- attr_reader :return_url
20
- attr_reader :cancel_url
21
- attr_reader :authorized
22
- attr_reader :sandbox
23
- attr_reader :url
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 customer=(val)
52
- if val.nil?
53
- @customer = val
54
- return
55
- end
56
-
57
- if val.instance_of? Customer
58
- @customer = val
59
- else
60
- obj = Customer.new(@client)
61
- obj.fill_with_data(val)
62
- @customer = obj
63
- end
64
-
65
- end
66
-
67
- def customer_id=(val)
68
- @customer_id = val
69
- end
70
-
71
- def token=(val)
72
- if val.nil?
73
- @token = val
74
- return
75
- end
76
-
77
- if val.instance_of? Token
78
- @token = val
79
- else
80
- obj = Token.new(@client)
81
- obj.fill_with_data(val)
82
- @token = obj
83
- end
84
-
85
- end
86
-
87
- def token_id=(val)
88
- @token_id = val
89
- end
90
-
91
- def name=(val)
92
- @name = val
93
- end
94
-
95
- def currency=(val)
96
- @currency = val
97
- end
98
-
99
- def return_url=(val)
100
- @return_url = val
101
- end
102
-
103
- def cancel_url=(val)
104
- @cancel_url = val
105
- end
106
-
107
- def authorized=(val)
108
- @authorized = val
109
- end
110
-
111
- def sandbox=(val)
112
- @sandbox = val
113
- end
114
-
115
- def url=(val)
116
- @url = val
117
- end
118
-
119
- def created_at=(val)
120
- @created_at = val
121
- end
122
-
123
-
124
- # Initializes the AuthorizationRequest object
125
- # Params:
126
- # +client+:: +ProcessOut+ client instance
127
- # +data+:: data that can be used to fill the object
128
- def initialize(client, data = {})
129
- @client = client
130
-
131
- self.id = data.fetch(:id, nil)
132
- self.project = data.fetch(:project, nil)
133
- self.project_id = data.fetch(:project_id, nil)
134
- self.customer = data.fetch(:customer, nil)
135
- self.customer_id = data.fetch(:customer_id, nil)
136
- self.token = data.fetch(:token, nil)
137
- self.token_id = data.fetch(:token_id, nil)
138
- self.name = data.fetch(:name, nil)
139
- self.currency = data.fetch(:currency, nil)
140
- self.return_url = data.fetch(:return_url, nil)
141
- self.cancel_url = data.fetch(:cancel_url, nil)
142
- self.authorized = data.fetch(:authorized, nil)
143
- self.sandbox = data.fetch(:sandbox, nil)
144
- self.url = data.fetch(:url, nil)
145
- self.created_at = data.fetch(:created_at, nil)
146
-
147
- end
148
-
149
- # Create a new AuthorizationRequest using the current client
150
- def new(data = {})
151
- AuthorizationRequest.new(@client, data)
152
- end
153
-
154
- # Fills the object with data coming from the API
155
- # Params:
156
- # +data+:: +Hash+ of data coming from the API
157
- def fill_with_data(data)
158
- if data.nil?
159
- return self
160
- end
161
- if data.include? "id"
162
- self.id = data["id"]
163
- end
164
- if data.include? "project"
165
- self.project = data["project"]
166
- end
167
- if data.include? "project_id"
168
- self.project_id = data["project_id"]
169
- end
170
- if data.include? "customer"
171
- self.customer = data["customer"]
172
- end
173
- if data.include? "customer_id"
174
- self.customer_id = data["customer_id"]
175
- end
176
- if data.include? "token"
177
- self.token = data["token"]
178
- end
179
- if data.include? "token_id"
180
- self.token_id = data["token_id"]
181
- end
182
- if data.include? "name"
183
- self.name = data["name"]
184
- end
185
- if data.include? "currency"
186
- self.currency = data["currency"]
187
- end
188
- if data.include? "return_url"
189
- self.return_url = data["return_url"]
190
- end
191
- if data.include? "cancel_url"
192
- self.cancel_url = data["cancel_url"]
193
- end
194
- if data.include? "authorized"
195
- self.authorized = data["authorized"]
196
- end
197
- if data.include? "sandbox"
198
- self.sandbox = data["sandbox"]
199
- end
200
- if data.include? "url"
201
- self.url = data["url"]
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.project_id = data.fetch(:project_id, self.project_id)
220
- self.customer = data.fetch(:customer, self.customer)
221
- self.customer_id = data.fetch(:customer_id, self.customer_id)
222
- self.token = data.fetch(:token, self.token)
223
- self.token_id = data.fetch(:token_id, self.token_id)
224
- self.name = data.fetch(:name, self.name)
225
- self.currency = data.fetch(:currency, self.currency)
226
- self.return_url = data.fetch(:return_url, self.return_url)
227
- self.cancel_url = data.fetch(:cancel_url, self.cancel_url)
228
- self.authorized = data.fetch(:authorized, self.authorized)
229
- self.sandbox = data.fetch(:sandbox, self.sandbox)
230
- self.url = data.fetch(:url, self.url)
231
- self.created_at = data.fetch(:created_at, self.created_at)
232
-
233
- self
234
- end
235
-
236
- # Get the customer linked to the authorization request.
237
- # Params:
238
- # +options+:: +Hash+ of options
239
- def fetch_customer(options = {})
240
- self.prefill(options)
241
-
242
- request = Request.new(@client)
243
- path = "/authorization-requests/" + CGI.escape(@id) + "/customers"
244
- data = {
245
-
246
- }
247
-
248
- response = Response.new(request.get(path, data, options))
249
- return_values = Array.new
250
-
251
- body = response.body
252
- body = body["customer"]
253
- customer = Customer.new(@client)
254
- return_values.push(customer.fill_with_data(body))
255
-
256
-
257
- return_values[0]
258
- end
259
-
260
- # Create a new authorization request for the given customer ID.
261
- # Params:
262
- # +options+:: +Hash+ of options
263
- def create(options = {})
264
- self.prefill(options)
265
-
266
- request = Request.new(@client)
267
- path = "/authorization-requests"
268
- data = {
269
- "customer_id" => @customer_id,
270
- "name" => @name,
271
- "currency" => @currency,
272
- "return_url" => @return_url,
273
- "cancel_url" => @cancel_url
274
- }
275
-
276
- response = Response.new(request.post(path, data, options))
277
- return_values = Array.new
278
-
279
- body = response.body
280
- body = body["authorization_request"]
281
-
282
-
283
- return_values.push(self.fill_with_data(body))
284
-
285
-
286
-
287
- return_values[0]
288
- end
289
-
290
- # Find an authorization request by its ID.
291
- # Params:
292
- # +authorization_request_id+:: ID of the authorization request
293
- # +options+:: +Hash+ of options
294
- def find(authorization_request_id, options = {})
295
- self.prefill(options)
296
-
297
- request = Request.new(@client)
298
- path = "/authorization-requests/" + CGI.escape(authorization_request_id) + ""
299
- data = {
300
-
301
- }
302
-
303
- response = Response.new(request.get(path, data, options))
304
- return_values = Array.new
305
-
306
- body = response.body
307
- body = body["authorization_request"]
308
-
309
-
310
- obj = AuthorizationRequest.new(@client)
311
- return_values.push(obj.fill_with_data(body))
312
-
313
-
314
-
315
- return_values[0]
316
- end
317
-
318
-
319
- end
320
- end