processout 2.27.1 → 2.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/processout/card_contact.rb +125 -0
- data/lib/processout/card_create_request.rb +309 -0
- data/lib/processout/card_shipping.rb +148 -0
- data/lib/processout/card_update_request.rb +120 -0
- data/lib/processout/device.rb +202 -0
- data/lib/processout/invoice.rb +25 -1
- data/lib/processout/networking/request.rb +1 -1
- data/lib/processout/payout.rb +22 -0
- data/lib/processout/payout_item.rb +23 -0
- data/lib/processout/payout_item_amount_breakdowns.rb +125 -0
- data/lib/processout/phone.rb +81 -0
- data/lib/processout/transaction.rb +33 -0
- data/lib/processout/version.rb +1 -1
- data/lib/processout.rb +42 -6
- metadata +9 -4
- data/.DS_Store +0 -0
- data/lib/processout/api_request.rb +0 -295
data/lib/processout.rb
CHANGED
@@ -2,7 +2,6 @@ require "processout/version"
|
|
2
2
|
require "processout/gateway_request"
|
3
3
|
require "processout/activity"
|
4
4
|
require "processout/addon"
|
5
|
-
require "processout/api_request"
|
6
5
|
require "processout/api_version"
|
7
6
|
require "processout/apple_pay_alternative_merchant_certificates"
|
8
7
|
require "processout/alternative_merchant_certificate"
|
@@ -10,6 +9,7 @@ require "processout/balances"
|
|
10
9
|
require "processout/balance"
|
11
10
|
require "processout/card"
|
12
11
|
require "processout/card_information"
|
12
|
+
require "processout/phone"
|
13
13
|
require "processout/coupon"
|
14
14
|
require "processout/customer"
|
15
15
|
require "processout/customer_phone"
|
@@ -34,6 +34,7 @@ require "processout/customer_action"
|
|
34
34
|
require "processout/dunning_action"
|
35
35
|
require "processout/payout"
|
36
36
|
require "processout/payout_item"
|
37
|
+
require "processout/payout_item_amount_breakdowns"
|
37
38
|
require "processout/plan"
|
38
39
|
require "processout/product"
|
39
40
|
require "processout/project"
|
@@ -51,6 +52,11 @@ require "processout/payment_data_three_ds_authentication"
|
|
51
52
|
require "processout/transaction_operation"
|
52
53
|
require "processout/webhook"
|
53
54
|
require "processout/webhook_endpoint"
|
55
|
+
require "processout/card_create_request"
|
56
|
+
require "processout/device"
|
57
|
+
require "processout/card_contact"
|
58
|
+
require "processout/card_shipping"
|
59
|
+
require "processout/card_update_request"
|
54
60
|
require "processout/error_codes"
|
55
61
|
require "processout/category_error_codes"
|
56
62
|
require "processout/native_apm_transaction_details_gateway"
|
@@ -79,11 +85,6 @@ module ProcessOut
|
|
79
85
|
obj = Addon.new(self, data)
|
80
86
|
end
|
81
87
|
|
82
|
-
# Create a new APIRequest instance
|
83
|
-
def api_request(data = {})
|
84
|
-
obj = APIRequest.new(self, data)
|
85
|
-
end
|
86
|
-
|
87
88
|
# Create a new APIVersion instance
|
88
89
|
def api_version(data = {})
|
89
90
|
obj = APIVersion.new(self, data)
|
@@ -119,6 +120,11 @@ module ProcessOut
|
|
119
120
|
obj = CardInformation.new(self, data)
|
120
121
|
end
|
121
122
|
|
123
|
+
# Create a new Phone instance
|
124
|
+
def phone(data = {})
|
125
|
+
obj = Phone.new(self, data)
|
126
|
+
end
|
127
|
+
|
122
128
|
# Create a new Coupon instance
|
123
129
|
def coupon(data = {})
|
124
130
|
obj = Coupon.new(self, data)
|
@@ -239,6 +245,11 @@ module ProcessOut
|
|
239
245
|
obj = PayoutItem.new(self, data)
|
240
246
|
end
|
241
247
|
|
248
|
+
# Create a new PayoutItemAmountBreakdowns instance
|
249
|
+
def payout_item_amount_breakdowns(data = {})
|
250
|
+
obj = PayoutItemAmountBreakdowns.new(self, data)
|
251
|
+
end
|
252
|
+
|
242
253
|
# Create a new Plan instance
|
243
254
|
def plan(data = {})
|
244
255
|
obj = Plan.new(self, data)
|
@@ -324,6 +335,31 @@ module ProcessOut
|
|
324
335
|
obj = WebhookEndpoint.new(self, data)
|
325
336
|
end
|
326
337
|
|
338
|
+
# Create a new CardCreateRequest instance
|
339
|
+
def card_create_request(data = {})
|
340
|
+
obj = CardCreateRequest.new(self, data)
|
341
|
+
end
|
342
|
+
|
343
|
+
# Create a new Device instance
|
344
|
+
def device(data = {})
|
345
|
+
obj = Device.new(self, data)
|
346
|
+
end
|
347
|
+
|
348
|
+
# Create a new CardContact instance
|
349
|
+
def card_contact(data = {})
|
350
|
+
obj = CardContact.new(self, data)
|
351
|
+
end
|
352
|
+
|
353
|
+
# Create a new CardShipping instance
|
354
|
+
def card_shipping(data = {})
|
355
|
+
obj = CardShipping.new(self, data)
|
356
|
+
end
|
357
|
+
|
358
|
+
# Create a new CardUpdateRequest instance
|
359
|
+
def card_update_request(data = {})
|
360
|
+
obj = CardUpdateRequest.new(self, data)
|
361
|
+
end
|
362
|
+
|
327
363
|
# Create a new ErrorCodes instance
|
328
364
|
def error_codes(data = {})
|
329
365
|
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: 2.
|
4
|
+
version: 2.29.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: 2024-
|
11
|
+
date: 2024-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -59,7 +59,6 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- ".DS_Store"
|
63
62
|
- ".github/CODEOWNERS"
|
64
63
|
- ".github/stale.yml"
|
65
64
|
- ".github/workflows/ci.yaml"
|
@@ -78,18 +77,22 @@ files:
|
|
78
77
|
- lib/processout/activity.rb
|
79
78
|
- lib/processout/addon.rb
|
80
79
|
- lib/processout/alternative_merchant_certificate.rb
|
81
|
-
- lib/processout/api_request.rb
|
82
80
|
- lib/processout/api_version.rb
|
83
81
|
- lib/processout/apple_pay_alternative_merchant_certificates.rb
|
84
82
|
- lib/processout/balance.rb
|
85
83
|
- lib/processout/balances.rb
|
86
84
|
- lib/processout/card.rb
|
85
|
+
- lib/processout/card_contact.rb
|
86
|
+
- lib/processout/card_create_request.rb
|
87
87
|
- lib/processout/card_information.rb
|
88
|
+
- lib/processout/card_shipping.rb
|
89
|
+
- lib/processout/card_update_request.rb
|
88
90
|
- lib/processout/category_error_codes.rb
|
89
91
|
- lib/processout/coupon.rb
|
90
92
|
- lib/processout/customer.rb
|
91
93
|
- lib/processout/customer_action.rb
|
92
94
|
- lib/processout/customer_phone.rb
|
95
|
+
- lib/processout/device.rb
|
93
96
|
- lib/processout/discount.rb
|
94
97
|
- lib/processout/dunning_action.rb
|
95
98
|
- lib/processout/error_codes.rb
|
@@ -127,6 +130,8 @@ files:
|
|
127
130
|
- lib/processout/payment_data_three_ds_request.rb
|
128
131
|
- lib/processout/payout.rb
|
129
132
|
- lib/processout/payout_item.rb
|
133
|
+
- lib/processout/payout_item_amount_breakdowns.rb
|
134
|
+
- lib/processout/phone.rb
|
130
135
|
- lib/processout/plan.rb
|
131
136
|
- lib/processout/product.rb
|
132
137
|
- lib/processout/project.rb
|
data/.DS_Store
DELETED
Binary file
|
@@ -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
|