processout 2.13.0 → 2.14.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/activity.rb +14 -0
- data/lib/processout/addon.rb +21 -0
- data/lib/processout/api_request.rb +21 -0
- data/lib/processout/api_version.rb +10 -0
- data/lib/processout/card.rb +36 -0
- data/lib/processout/card_information.rb +14 -0
- data/lib/processout/coupon.rb +20 -0
- data/lib/processout/customer.rb +34 -22
- data/lib/processout/customer_action.rb +9 -0
- data/lib/processout/discount.rb +21 -0
- data/lib/processout/dunning_action.rb +9 -0
- data/lib/processout/event.rb +14 -0
- data/lib/processout/gateway.rb +18 -0
- data/lib/processout/gateway_configuration.rb +18 -0
- data/lib/processout/invoice.rb +43 -1
- data/lib/processout/invoice_detail.rb +22 -0
- data/lib/processout/invoice_device.rb +9 -0
- data/lib/processout/invoice_risk.rb +9 -0
- data/lib/processout/invoice_shipping.rb +19 -0
- data/lib/processout/networking/request.rb +1 -1
- data/lib/processout/payment_data_network_authentication.rb +8 -0
- data/lib/processout/payment_data_three_ds_authentication.rb +8 -0
- data/lib/processout/payment_data_three_ds_request.rb +11 -0
- data/lib/processout/payout.rb +27 -0
- data/lib/processout/payout_item.rb +20 -0
- data/lib/processout/plan.rb +21 -0
- data/lib/processout/product.rb +19 -0
- data/lib/processout/project.rb +18 -27
- data/lib/processout/refund.rb +17 -0
- data/lib/processout/subscription.rb +42 -0
- data/lib/processout/token.rb +39 -33
- data/lib/processout/transaction.rb +57 -0
- data/lib/processout/transaction_operation.rb +52 -0
- data/lib/processout/version.rb +1 -1
- data/lib/processout/webhook.rb +21 -0
- data/lib/processout/webhook_endpoint.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d68d0e527f0cbbdd9c3b1e68b3fd75dc1829598
|
4
|
+
data.tar.gz: c3c6e7907bfba348e34dc198be5e455997a349e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e880634f0c9053438bcf4dc40e0ecdd70d517112f62fb1f6af25f12d8c1f4b787e304a319b1dfc57e4aedb12e9c0a2c9e98eb60add9f1c2b11dc6f1acb558348
|
7
|
+
data.tar.gz: d01b3b05bac7bc683eabf4dd6cc85cb0f985210e9c2400ef718e0984293ad6f83caa7bde1f59b82158e5a994a1611533ae600533a73630fa2c736f32239168f8
|
data/lib/processout/activity.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -79,6 +80,19 @@ module ProcessOut
|
|
79
80
|
Activity.new(@client, data)
|
80
81
|
end
|
81
82
|
|
83
|
+
# Overrides the JSON marshaller to only send the fields we want
|
84
|
+
def to_json(options)
|
85
|
+
{
|
86
|
+
"id": self.id,
|
87
|
+
"project": self.project,
|
88
|
+
"project_id": self.project_id,
|
89
|
+
"title": self.title,
|
90
|
+
"content": self.content,
|
91
|
+
"level": self.level,
|
92
|
+
"created_at": self.created_at,
|
93
|
+
}.to_json
|
94
|
+
end
|
95
|
+
|
82
96
|
# Fills the object with data coming from the API
|
83
97
|
# Params:
|
84
98
|
# +data+:: +Hash+ of data coming from the API
|
data/lib/processout/addon.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -145,6 +146,26 @@ module ProcessOut
|
|
145
146
|
Addon.new(@client, data)
|
146
147
|
end
|
147
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
|
+
|
148
169
|
# Fills the object with data coming from the API
|
149
170
|
# Params:
|
150
171
|
# +data+:: +Hash+ of data coming from the API
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -133,6 +134,26 @@ module ProcessOut
|
|
133
134
|
APIRequest.new(@client, data)
|
134
135
|
end
|
135
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
|
+
|
136
157
|
# Fills the object with data coming from the API
|
137
158
|
# Params:
|
138
159
|
# +data+:: +Hash+ of data coming from the API
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -43,6 +44,15 @@ module ProcessOut
|
|
43
44
|
APIVersion.new(@client, data)
|
44
45
|
end
|
45
46
|
|
47
|
+
# Overrides the JSON marshaller to only send the fields we want
|
48
|
+
def to_json(options)
|
49
|
+
{
|
50
|
+
"name": self.name,
|
51
|
+
"description": self.description,
|
52
|
+
"created_at": self.created_at,
|
53
|
+
}.to_json
|
54
|
+
end
|
55
|
+
|
46
56
|
# Fills the object with data coming from the API
|
47
57
|
# Params:
|
48
58
|
# +data+:: +Hash+ of data coming from the API
|
data/lib/processout/card.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -223,6 +224,41 @@ module ProcessOut
|
|
223
224
|
Card.new(@client, data)
|
224
225
|
end
|
225
226
|
|
227
|
+
# Overrides the JSON marshaller to only send the fields we want
|
228
|
+
def to_json(options)
|
229
|
+
{
|
230
|
+
"id": self.id,
|
231
|
+
"project": self.project,
|
232
|
+
"project_id": self.project_id,
|
233
|
+
"token": self.token,
|
234
|
+
"scheme": self.scheme,
|
235
|
+
"co_scheme": self.co_scheme,
|
236
|
+
"preferred_scheme": self.preferred_scheme,
|
237
|
+
"type": self.type,
|
238
|
+
"bank_name": self.bank_name,
|
239
|
+
"brand": self.brand,
|
240
|
+
"iin": self.iin,
|
241
|
+
"last_4_digits": self.last_4_digits,
|
242
|
+
"exp_month": self.exp_month,
|
243
|
+
"exp_year": self.exp_year,
|
244
|
+
"cvc_check": self.cvc_check,
|
245
|
+
"avs_check": self.avs_check,
|
246
|
+
"name": self.name,
|
247
|
+
"address1": self.address1,
|
248
|
+
"address2": self.address2,
|
249
|
+
"city": self.city,
|
250
|
+
"state": self.state,
|
251
|
+
"zip": self.zip,
|
252
|
+
"country_code": self.country_code,
|
253
|
+
"ip_address": self.ip_address,
|
254
|
+
"fingerprint": self.fingerprint,
|
255
|
+
"metadata": self.metadata,
|
256
|
+
"expires_soon": self.expires_soon,
|
257
|
+
"sandbox": self.sandbox,
|
258
|
+
"created_at": self.created_at,
|
259
|
+
}.to_json
|
260
|
+
end
|
261
|
+
|
226
262
|
# Fills the object with data coming from the API
|
227
263
|
# Params:
|
228
264
|
# +data+:: +Hash+ of data coming from the API
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -67,6 +68,19 @@ module ProcessOut
|
|
67
68
|
CardInformation.new(@client, data)
|
68
69
|
end
|
69
70
|
|
71
|
+
# Overrides the JSON marshaller to only send the fields we want
|
72
|
+
def to_json(options)
|
73
|
+
{
|
74
|
+
"iin": self.iin,
|
75
|
+
"scheme": self.scheme,
|
76
|
+
"type": self.type,
|
77
|
+
"bank_name": self.bank_name,
|
78
|
+
"brand": self.brand,
|
79
|
+
"category": self.category,
|
80
|
+
"country": self.country,
|
81
|
+
}.to_json
|
82
|
+
end
|
83
|
+
|
70
84
|
# Fills the object with data coming from the API
|
71
85
|
# Params:
|
72
86
|
# +data+:: +Hash+ of data coming from the API
|
data/lib/processout/coupon.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -115,6 +116,25 @@ module ProcessOut
|
|
115
116
|
Coupon.new(@client, data)
|
116
117
|
end
|
117
118
|
|
119
|
+
# Overrides the JSON marshaller to only send the fields we want
|
120
|
+
def to_json(options)
|
121
|
+
{
|
122
|
+
"id": self.id,
|
123
|
+
"project": self.project,
|
124
|
+
"project_id": self.project_id,
|
125
|
+
"amount_off": self.amount_off,
|
126
|
+
"percent_off": self.percent_off,
|
127
|
+
"currency": self.currency,
|
128
|
+
"iteration_count": self.iteration_count,
|
129
|
+
"max_redemptions": self.max_redemptions,
|
130
|
+
"expires_at": self.expires_at,
|
131
|
+
"metadata": self.metadata,
|
132
|
+
"redeemed_number": self.redeemed_number,
|
133
|
+
"sandbox": self.sandbox,
|
134
|
+
"created_at": self.created_at,
|
135
|
+
}.to_json
|
136
|
+
end
|
137
|
+
|
118
138
|
# Fills the object with data coming from the API
|
119
139
|
# Params:
|
120
140
|
# +data+:: +Hash+ of data coming from the API
|
data/lib/processout/customer.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -259,6 +260,39 @@ module ProcessOut
|
|
259
260
|
Customer.new(@client, data)
|
260
261
|
end
|
261
262
|
|
263
|
+
# Overrides the JSON marshaller to only send the fields we want
|
264
|
+
def to_json(options)
|
265
|
+
{
|
266
|
+
"id": self.id,
|
267
|
+
"project": self.project,
|
268
|
+
"project_id": self.project_id,
|
269
|
+
"default_token": self.default_token,
|
270
|
+
"default_token_id": self.default_token_id,
|
271
|
+
"tokens": self.tokens,
|
272
|
+
"subscriptions": self.subscriptions,
|
273
|
+
"transactions": self.transactions,
|
274
|
+
"balance": self.balance,
|
275
|
+
"currency": self.currency,
|
276
|
+
"email": self.email,
|
277
|
+
"first_name": self.first_name,
|
278
|
+
"last_name": self.last_name,
|
279
|
+
"address1": self.address1,
|
280
|
+
"address2": self.address2,
|
281
|
+
"city": self.city,
|
282
|
+
"state": self.state,
|
283
|
+
"zip": self.zip,
|
284
|
+
"country_code": self.country_code,
|
285
|
+
"ip_address": self.ip_address,
|
286
|
+
"phone_number": self.phone_number,
|
287
|
+
"legal_document": self.legal_document,
|
288
|
+
"sex": self.sex,
|
289
|
+
"is_business": self.is_business,
|
290
|
+
"metadata": self.metadata,
|
291
|
+
"sandbox": self.sandbox,
|
292
|
+
"created_at": self.created_at,
|
293
|
+
}.to_json
|
294
|
+
end
|
295
|
+
|
262
296
|
# Fills the object with data coming from the API
|
263
297
|
# Params:
|
264
298
|
# +data+:: +Hash+ of data coming from the API
|
@@ -416,28 +450,6 @@ module ProcessOut
|
|
416
450
|
|
417
451
|
|
418
452
|
|
419
|
-
return_values[0]
|
420
|
-
end
|
421
|
-
|
422
|
-
# Verify a customer token's card is valid.
|
423
|
-
# Params:
|
424
|
-
# +token_id+:: ID of the token
|
425
|
-
# +options+:: +Hash+ of options
|
426
|
-
def verify_token(token_id, options = {})
|
427
|
-
self.prefill(options)
|
428
|
-
|
429
|
-
request = Request.new(@client)
|
430
|
-
path = "/customers/" + CGI.escape(@id) + "/tokens/" + CGI.escape(token_id) + "/verify"
|
431
|
-
data = {
|
432
|
-
|
433
|
-
}
|
434
|
-
|
435
|
-
response = Response.new(request.post(path, data, options))
|
436
|
-
return_values = Array.new
|
437
|
-
|
438
|
-
return_values.push(response.success)
|
439
|
-
|
440
|
-
|
441
453
|
return_values[0]
|
442
454
|
end
|
443
455
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -37,6 +38,14 @@ module ProcessOut
|
|
37
38
|
CustomerAction.new(@client, data)
|
38
39
|
end
|
39
40
|
|
41
|
+
# Overrides the JSON marshaller to only send the fields we want
|
42
|
+
def to_json(options)
|
43
|
+
{
|
44
|
+
"type": self.type,
|
45
|
+
"value": self.value,
|
46
|
+
}.to_json
|
47
|
+
end
|
48
|
+
|
40
49
|
# Fills the object with data coming from the API
|
41
50
|
# Params:
|
42
51
|
# +data+:: +Hash+ of data coming from the API
|
data/lib/processout/discount.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -145,6 +146,26 @@ module ProcessOut
|
|
145
146
|
Discount.new(@client, data)
|
146
147
|
end
|
147
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
|
+
"coupon": self.coupon,
|
158
|
+
"coupon_id": self.coupon_id,
|
159
|
+
"name": self.name,
|
160
|
+
"amount": self.amount,
|
161
|
+
"percent": self.percent,
|
162
|
+
"expires_at": self.expires_at,
|
163
|
+
"metadata": self.metadata,
|
164
|
+
"sandbox": self.sandbox,
|
165
|
+
"created_at": self.created_at,
|
166
|
+
}.to_json
|
167
|
+
end
|
168
|
+
|
148
169
|
# Fills the object with data coming from the API
|
149
170
|
# Params:
|
150
171
|
# +data+:: +Hash+ of data coming from the API
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -37,6 +38,14 @@ module ProcessOut
|
|
37
38
|
DunningAction.new(@client, data)
|
38
39
|
end
|
39
40
|
|
41
|
+
# Overrides the JSON marshaller to only send the fields we want
|
42
|
+
def to_json(options)
|
43
|
+
{
|
44
|
+
"action": self.action,
|
45
|
+
"delay_in_days": self.delay_in_days,
|
46
|
+
}.to_json
|
47
|
+
end
|
48
|
+
|
40
49
|
# Fills the object with data coming from the API
|
41
50
|
# Params:
|
42
51
|
# +data+:: +Hash+ of data coming from the API
|
data/lib/processout/event.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -80,6 +81,19 @@ module ProcessOut
|
|
80
81
|
Event.new(@client, data)
|
81
82
|
end
|
82
83
|
|
84
|
+
# Overrides the JSON marshaller to only send the fields we want
|
85
|
+
def to_json(options)
|
86
|
+
{
|
87
|
+
"id": self.id,
|
88
|
+
"project": self.project,
|
89
|
+
"project_id": self.project_id,
|
90
|
+
"name": self.name,
|
91
|
+
"data": self.data,
|
92
|
+
"sandbox": self.sandbox,
|
93
|
+
"fired_at": self.fired_at,
|
94
|
+
}.to_json
|
95
|
+
end
|
96
|
+
|
83
97
|
# Fills the object with data coming from the API
|
84
98
|
# Params:
|
85
99
|
# +data+:: +Hash+ of data coming from the API
|
data/lib/processout/gateway.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# The content of this file was automatically generated
|
2
2
|
|
3
3
|
require "cgi"
|
4
|
+
require "json"
|
4
5
|
require "processout/networking/request"
|
5
6
|
require "processout/networking/response"
|
6
7
|
|
@@ -91,6 +92,23 @@ module ProcessOut
|
|
91
92
|
Gateway.new(@client, data)
|
92
93
|
end
|
93
94
|
|
95
|
+
# Overrides the JSON marshaller to only send the fields we want
|
96
|
+
def to_json(options)
|
97
|
+
{
|
98
|
+
"id": self.id,
|
99
|
+
"name": self.name,
|
100
|
+
"display_name": self.display_name,
|
101
|
+
"logo_url": self.logo_url,
|
102
|
+
"url": self.url,
|
103
|
+
"flows": self.flows,
|
104
|
+
"tags": self.tags,
|
105
|
+
"can_pull_transactions": self.can_pull_transactions,
|
106
|
+
"can_refund": self.can_refund,
|
107
|
+
"is_oauth_authentication": self.is_oauth_authentication,
|
108
|
+
"description": self.description,
|
109
|
+
}.to_json
|
110
|
+
end
|
111
|
+
|
94
112
|
# Fills the object with data coming from the API
|
95
113
|
# Params:
|
96
114
|
# +data+:: +Hash+ of data coming from the API
|