processout 2.11.1 → 2.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/processout.rb +0 -6
- data/lib/processout/networking/request.rb +1 -1
- data/lib/processout/token.rb +31 -0
- data/lib/processout/transaction_operation.rb +10 -0
- data/lib/processout/version.rb +1 -1
- metadata +2 -3
- data/lib/processout/authorization_request.rb +0 -320
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aaf40ed01399a94bde8e2480ff08122752e93fe0
|
4
|
+
data.tar.gz: 7bd1f3a5e23b2bf9d5dc2b8c94827ba465774f76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11304d37b90a1e507c0978d5c85c40ab0c3c44a8e315f320d692fb200fc56140452b46eb47307b81f615f4e5ef0c281c0128c39c6253e9a739a4026cbf5af833
|
7
|
+
data.tar.gz: 63e3d240554ac748f9d273f36900b4b5cd14d5eba956ee06f6d193213d9fee50acb443fd60512288e3d460d1d193e732eed1fd85ebf5aa9869d841e0089a838d
|
data/lib/processout.rb
CHANGED
@@ -4,7 +4,6 @@ require "processout/activity"
|
|
4
4
|
require "processout/addon"
|
5
5
|
require "processout/api_request"
|
6
6
|
require "processout/api_version"
|
7
|
-
require "processout/authorization_request"
|
8
7
|
require "processout/card"
|
9
8
|
require "processout/card_information"
|
10
9
|
require "processout/coupon"
|
@@ -67,11 +66,6 @@ module ProcessOut
|
|
67
66
|
obj = APIVersion.new(self, data)
|
68
67
|
end
|
69
68
|
|
70
|
-
# Create a new AuthorizationRequest instance
|
71
|
-
def authorization_request(data = {})
|
72
|
-
obj = AuthorizationRequest.new(self, data)
|
73
|
-
end
|
74
|
-
|
75
69
|
# Create a new Card instance
|
76
70
|
def card(data = {})
|
77
71
|
obj = Card.new(self, data)
|
@@ -13,7 +13,7 @@ module ProcessOut
|
|
13
13
|
req.basic_auth @client.project_id, @client.project_secret
|
14
14
|
req.content_type = "application/json"
|
15
15
|
req["API-Version"] = "1.4.0.0"
|
16
|
-
req["User-Agent"] = "ProcessOut Ruby-Bindings/2.
|
16
|
+
req["User-Agent"] = "ProcessOut Ruby-Bindings/2.12.0"
|
17
17
|
|
18
18
|
unless options.nil?
|
19
19
|
req["Idempotency-Key"] = options.fetch(:idempotency_key, "")
|
data/lib/processout/token.rb
CHANGED
@@ -18,6 +18,7 @@ module ProcessOut
|
|
18
18
|
attr_reader :metadata
|
19
19
|
attr_reader :is_subscription_only
|
20
20
|
attr_reader :is_default
|
21
|
+
attr_reader :is_chargeable
|
21
22
|
attr_reader :created_at
|
22
23
|
|
23
24
|
|
@@ -101,6 +102,10 @@ module ProcessOut
|
|
101
102
|
@is_default = val
|
102
103
|
end
|
103
104
|
|
105
|
+
def is_chargeable=(val)
|
106
|
+
@is_chargeable = val
|
107
|
+
end
|
108
|
+
|
104
109
|
def created_at=(val)
|
105
110
|
@created_at = val
|
106
111
|
end
|
@@ -124,6 +129,7 @@ module ProcessOut
|
|
124
129
|
self.metadata = data.fetch(:metadata, nil)
|
125
130
|
self.is_subscription_only = data.fetch(:is_subscription_only, nil)
|
126
131
|
self.is_default = data.fetch(:is_default, nil)
|
132
|
+
self.is_chargeable = data.fetch(:is_chargeable, nil)
|
127
133
|
self.created_at = data.fetch(:created_at, nil)
|
128
134
|
|
129
135
|
end
|
@@ -173,6 +179,9 @@ module ProcessOut
|
|
173
179
|
if data.include? "is_default"
|
174
180
|
self.is_default = data["is_default"]
|
175
181
|
end
|
182
|
+
if data.include? "is_chargeable"
|
183
|
+
self.is_chargeable = data["is_chargeable"]
|
184
|
+
end
|
176
185
|
if data.include? "created_at"
|
177
186
|
self.created_at = data["created_at"]
|
178
187
|
end
|
@@ -198,6 +207,7 @@ module ProcessOut
|
|
198
207
|
self.metadata = data.fetch(:metadata, self.metadata)
|
199
208
|
self.is_subscription_only = data.fetch(:is_subscription_only, self.is_subscription_only)
|
200
209
|
self.is_default = data.fetch(:is_default, self.is_default)
|
210
|
+
self.is_chargeable = data.fetch(:is_chargeable, self.is_chargeable)
|
201
211
|
self.created_at = data.fetch(:created_at, self.created_at)
|
202
212
|
|
203
213
|
self
|
@@ -313,6 +323,27 @@ module ProcessOut
|
|
313
323
|
|
314
324
|
|
315
325
|
|
326
|
+
return_values[0]
|
327
|
+
end
|
328
|
+
|
329
|
+
# Save the updated customer attributes.
|
330
|
+
# Params:
|
331
|
+
# +options+:: +Hash+ of options
|
332
|
+
def save(options = {})
|
333
|
+
self.prefill(options)
|
334
|
+
|
335
|
+
request = Request.new(@client)
|
336
|
+
path = "/customers/" + CGI.escape(@customer_id) + "/tokens/" + CGI.escape(@id) + ""
|
337
|
+
data = {
|
338
|
+
|
339
|
+
}
|
340
|
+
|
341
|
+
response = Response.new(request.put(path, data, options))
|
342
|
+
return_values = Array.new
|
343
|
+
|
344
|
+
return_values.push(response.success)
|
345
|
+
|
346
|
+
|
316
347
|
return_values[0]
|
317
348
|
end
|
318
349
|
|
@@ -21,6 +21,7 @@ module ProcessOut
|
|
21
21
|
attr_reader :type
|
22
22
|
attr_reader :gateway_operation_id
|
23
23
|
attr_reader :error_code
|
24
|
+
attr_reader :gateway_data
|
24
25
|
attr_reader :payment_data_three_d_s_request
|
25
26
|
attr_reader :payment_data_three_d_s_authentication
|
26
27
|
attr_reader :payment_data_network_authentication
|
@@ -121,6 +122,10 @@ module ProcessOut
|
|
121
122
|
@error_code = val
|
122
123
|
end
|
123
124
|
|
125
|
+
def gateway_data=(val)
|
126
|
+
@gateway_data = val
|
127
|
+
end
|
128
|
+
|
124
129
|
def payment_data_three_d_s_request=(val)
|
125
130
|
if val.nil?
|
126
131
|
@payment_data_three_d_s_request = val
|
@@ -203,6 +208,7 @@ module ProcessOut
|
|
203
208
|
self.type = data.fetch(:type, nil)
|
204
209
|
self.gateway_operation_id = data.fetch(:gateway_operation_id, nil)
|
205
210
|
self.error_code = data.fetch(:error_code, nil)
|
211
|
+
self.gateway_data = data.fetch(:gateway_data, nil)
|
206
212
|
self.payment_data_three_d_s_request = data.fetch(:payment_data_three_d_s_request, nil)
|
207
213
|
self.payment_data_three_d_s_authentication = data.fetch(:payment_data_three_d_s_authentication, nil)
|
208
214
|
self.payment_data_network_authentication = data.fetch(:payment_data_network_authentication, nil)
|
@@ -266,6 +272,9 @@ module ProcessOut
|
|
266
272
|
if data.include? "error_code"
|
267
273
|
self.error_code = data["error_code"]
|
268
274
|
end
|
275
|
+
if data.include? "gateway_data"
|
276
|
+
self.gateway_data = data["gateway_data"]
|
277
|
+
end
|
269
278
|
if data.include? "payment_data_three_d_s_request"
|
270
279
|
self.payment_data_three_d_s_request = data["payment_data_three_d_s_request"]
|
271
280
|
end
|
@@ -309,6 +318,7 @@ module ProcessOut
|
|
309
318
|
self.type = data.fetch(:type, self.type)
|
310
319
|
self.gateway_operation_id = data.fetch(:gateway_operation_id, self.gateway_operation_id)
|
311
320
|
self.error_code = data.fetch(:error_code, self.error_code)
|
321
|
+
self.gateway_data = data.fetch(:gateway_data, self.gateway_data)
|
312
322
|
self.payment_data_three_d_s_request = data.fetch(:payment_data_three_d_s_request, self.payment_data_three_d_s_request)
|
313
323
|
self.payment_data_three_d_s_authentication = data.fetch(:payment_data_three_d_s_authentication, self.payment_data_three_d_s_authentication)
|
314
324
|
self.payment_data_network_authentication = data.fetch(:payment_data_network_authentication, self.payment_data_network_authentication)
|
data/lib/processout/version.rb
CHANGED
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.12.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: 2019-06-
|
11
|
+
date: 2019-06-24 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
|
@@ -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
|