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.
- checksums.yaml +5 -5
- data/lib/processout.rb +12 -6
- 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 +79 -0
- data/lib/processout/card_information.rb +14 -0
- data/lib/processout/coupon.rb +20 -0
- data/lib/processout/customer.rb +62 -24
- 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 -31
- data/lib/processout/gateway.rb +18 -0
- data/lib/processout/gateway_configuration.rb +19 -1
- data/lib/processout/invoice.rb +136 -1
- data/lib/processout/invoice_detail.rb +22 -0
- data/lib/processout/invoice_device.rb +20 -0
- data/lib/processout/invoice_external_fraud_tools.rb +70 -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/three_ds.rb +103 -0
- data/lib/processout/token.rb +138 -22
- data/lib/processout/transaction.rb +113 -0
- data/lib/processout/transaction_operation.rb +94 -0
- data/lib/processout/version.rb +1 -1
- data/lib/processout/webhook.rb +21 -0
- data/lib/processout/webhook_endpoint.rb +14 -0
- metadata +5 -5
- data/lib/processout/authorization_request.rb +0 -320
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0ca11711f3387a3bebf5c64eb3d8e3dd60c6147b669a0d967ce88f1753f9c2f6
|
4
|
+
data.tar.gz: 95ce72ee215524f276bbb5da6926b289574ea63589e6c6ef4f0c133364aed1ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28925f1ea68596b08723735d06006c90efe6cb53da284b6a751bddb88bcff2783d59b33c94619a8c30571e9bc5b5bee00d407a6578e5c7d4a356ca423b0c984b
|
7
|
+
data.tar.gz: 9aaa5b1e7dd5d8d869c459fccd71f9346fa114d827fe9c9895e9a9569148fc156e01be413c16e3268dd5b3cd4ac84902287da32fac8068a56ee9189758159ed2
|
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"
|
@@ -15,6 +14,7 @@ require "processout/event"
|
|
15
14
|
require "processout/gateway"
|
16
15
|
require "processout/gateway_configuration"
|
17
16
|
require "processout/invoice"
|
17
|
+
require "processout/invoice_external_fraud_tools"
|
18
18
|
require "processout/invoice_risk"
|
19
19
|
require "processout/invoice_device"
|
20
20
|
require "processout/invoice_shipping"
|
@@ -29,6 +29,7 @@ require "processout/project"
|
|
29
29
|
require "processout/refund"
|
30
30
|
require "processout/subscription"
|
31
31
|
require "processout/transaction"
|
32
|
+
require "processout/three_ds"
|
32
33
|
require "processout/payment_data_three_ds_request"
|
33
34
|
require "processout/payment_data_network_authentication"
|
34
35
|
require "processout/payment_data_three_ds_authentication"
|
@@ -67,11 +68,6 @@ module ProcessOut
|
|
67
68
|
obj = APIVersion.new(self, data)
|
68
69
|
end
|
69
70
|
|
70
|
-
# Create a new AuthorizationRequest instance
|
71
|
-
def authorization_request(data = {})
|
72
|
-
obj = AuthorizationRequest.new(self, data)
|
73
|
-
end
|
74
|
-
|
75
71
|
# Create a new Card instance
|
76
72
|
def card(data = {})
|
77
73
|
obj = Card.new(self, data)
|
@@ -122,6 +118,11 @@ module ProcessOut
|
|
122
118
|
obj = Invoice.new(self, data)
|
123
119
|
end
|
124
120
|
|
121
|
+
# Create a new InvoiceExternalFraudTools instance
|
122
|
+
def invoice_external_fraud_tools(data = {})
|
123
|
+
obj = InvoiceExternalFraudTools.new(self, data)
|
124
|
+
end
|
125
|
+
|
125
126
|
# Create a new InvoiceRisk instance
|
126
127
|
def invoice_risk(data = {})
|
127
128
|
obj = InvoiceRisk.new(self, data)
|
@@ -192,6 +193,11 @@ module ProcessOut
|
|
192
193
|
obj = Transaction.new(self, data)
|
193
194
|
end
|
194
195
|
|
196
|
+
# Create a new ThreeDS instance
|
197
|
+
def three_ds(data = {})
|
198
|
+
obj = ThreeDS.new(self, data)
|
199
|
+
end
|
200
|
+
|
195
201
|
# Create a new PaymentDataThreeDSRequest instance
|
196
202
|
def payment_data_three_ds_request(data = {})
|
197
203
|
obj = PaymentDataThreeDSRequest.new(self, data)
|
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
|
|
@@ -17,6 +18,7 @@ module ProcessOut
|
|
17
18
|
attr_reader :type
|
18
19
|
attr_reader :bank_name
|
19
20
|
attr_reader :brand
|
21
|
+
attr_reader :category
|
20
22
|
attr_reader :iin
|
21
23
|
attr_reader :last_4_digits
|
22
24
|
attr_reader :exp_month
|
@@ -32,6 +34,7 @@ module ProcessOut
|
|
32
34
|
attr_reader :country_code
|
33
35
|
attr_reader :ip_address
|
34
36
|
attr_reader :fingerprint
|
37
|
+
attr_reader :token_type
|
35
38
|
attr_reader :metadata
|
36
39
|
attr_reader :expires_soon
|
37
40
|
attr_reader :sandbox
|
@@ -102,6 +105,10 @@ module ProcessOut
|
|
102
105
|
@brand = val
|
103
106
|
end
|
104
107
|
|
108
|
+
def category=(val)
|
109
|
+
@category = val
|
110
|
+
end
|
111
|
+
|
105
112
|
def iin=(val)
|
106
113
|
@iin = val
|
107
114
|
end
|
@@ -162,6 +169,10 @@ module ProcessOut
|
|
162
169
|
@fingerprint = val
|
163
170
|
end
|
164
171
|
|
172
|
+
def token_type=(val)
|
173
|
+
@token_type = val
|
174
|
+
end
|
175
|
+
|
165
176
|
def metadata=(val)
|
166
177
|
@metadata = val
|
167
178
|
end
|
@@ -196,6 +207,7 @@ module ProcessOut
|
|
196
207
|
self.type = data.fetch(:type, nil)
|
197
208
|
self.bank_name = data.fetch(:bank_name, nil)
|
198
209
|
self.brand = data.fetch(:brand, nil)
|
210
|
+
self.category = data.fetch(:category, nil)
|
199
211
|
self.iin = data.fetch(:iin, nil)
|
200
212
|
self.last_4_digits = data.fetch(:last_4_digits, nil)
|
201
213
|
self.exp_month = data.fetch(:exp_month, nil)
|
@@ -211,6 +223,7 @@ module ProcessOut
|
|
211
223
|
self.country_code = data.fetch(:country_code, nil)
|
212
224
|
self.ip_address = data.fetch(:ip_address, nil)
|
213
225
|
self.fingerprint = data.fetch(:fingerprint, nil)
|
226
|
+
self.token_type = data.fetch(:token_type, nil)
|
214
227
|
self.metadata = data.fetch(:metadata, nil)
|
215
228
|
self.expires_soon = data.fetch(:expires_soon, nil)
|
216
229
|
self.sandbox = data.fetch(:sandbox, nil)
|
@@ -223,6 +236,43 @@ module ProcessOut
|
|
223
236
|
Card.new(@client, data)
|
224
237
|
end
|
225
238
|
|
239
|
+
# Overrides the JSON marshaller to only send the fields we want
|
240
|
+
def to_json(options)
|
241
|
+
{
|
242
|
+
"id": self.id,
|
243
|
+
"project": self.project,
|
244
|
+
"project_id": self.project_id,
|
245
|
+
"token": self.token,
|
246
|
+
"scheme": self.scheme,
|
247
|
+
"co_scheme": self.co_scheme,
|
248
|
+
"preferred_scheme": self.preferred_scheme,
|
249
|
+
"type": self.type,
|
250
|
+
"bank_name": self.bank_name,
|
251
|
+
"brand": self.brand,
|
252
|
+
"category": self.category,
|
253
|
+
"iin": self.iin,
|
254
|
+
"last_4_digits": self.last_4_digits,
|
255
|
+
"exp_month": self.exp_month,
|
256
|
+
"exp_year": self.exp_year,
|
257
|
+
"cvc_check": self.cvc_check,
|
258
|
+
"avs_check": self.avs_check,
|
259
|
+
"name": self.name,
|
260
|
+
"address1": self.address1,
|
261
|
+
"address2": self.address2,
|
262
|
+
"city": self.city,
|
263
|
+
"state": self.state,
|
264
|
+
"zip": self.zip,
|
265
|
+
"country_code": self.country_code,
|
266
|
+
"ip_address": self.ip_address,
|
267
|
+
"fingerprint": self.fingerprint,
|
268
|
+
"token_type": self.token_type,
|
269
|
+
"metadata": self.metadata,
|
270
|
+
"expires_soon": self.expires_soon,
|
271
|
+
"sandbox": self.sandbox,
|
272
|
+
"created_at": self.created_at,
|
273
|
+
}.to_json
|
274
|
+
end
|
275
|
+
|
226
276
|
# Fills the object with data coming from the API
|
227
277
|
# Params:
|
228
278
|
# +data+:: +Hash+ of data coming from the API
|
@@ -260,6 +310,9 @@ module ProcessOut
|
|
260
310
|
if data.include? "brand"
|
261
311
|
self.brand = data["brand"]
|
262
312
|
end
|
313
|
+
if data.include? "category"
|
314
|
+
self.category = data["category"]
|
315
|
+
end
|
263
316
|
if data.include? "iin"
|
264
317
|
self.iin = data["iin"]
|
265
318
|
end
|
@@ -305,6 +358,9 @@ module ProcessOut
|
|
305
358
|
if data.include? "fingerprint"
|
306
359
|
self.fingerprint = data["fingerprint"]
|
307
360
|
end
|
361
|
+
if data.include? "token_type"
|
362
|
+
self.token_type = data["token_type"]
|
363
|
+
end
|
308
364
|
if data.include? "metadata"
|
309
365
|
self.metadata = data["metadata"]
|
310
366
|
end
|
@@ -338,6 +394,7 @@ module ProcessOut
|
|
338
394
|
self.type = data.fetch(:type, self.type)
|
339
395
|
self.bank_name = data.fetch(:bank_name, self.bank_name)
|
340
396
|
self.brand = data.fetch(:brand, self.brand)
|
397
|
+
self.category = data.fetch(:category, self.category)
|
341
398
|
self.iin = data.fetch(:iin, self.iin)
|
342
399
|
self.last_4_digits = data.fetch(:last_4_digits, self.last_4_digits)
|
343
400
|
self.exp_month = data.fetch(:exp_month, self.exp_month)
|
@@ -353,6 +410,7 @@ module ProcessOut
|
|
353
410
|
self.country_code = data.fetch(:country_code, self.country_code)
|
354
411
|
self.ip_address = data.fetch(:ip_address, self.ip_address)
|
355
412
|
self.fingerprint = data.fetch(:fingerprint, self.fingerprint)
|
413
|
+
self.token_type = data.fetch(:token_type, self.token_type)
|
356
414
|
self.metadata = data.fetch(:metadata, self.metadata)
|
357
415
|
self.expires_soon = data.fetch(:expires_soon, self.expires_soon)
|
358
416
|
self.sandbox = data.fetch(:sandbox, self.sandbox)
|
@@ -416,6 +474,27 @@ module ProcessOut
|
|
416
474
|
|
417
475
|
|
418
476
|
|
477
|
+
return_values[0]
|
478
|
+
end
|
479
|
+
|
480
|
+
# Anonymize the card.
|
481
|
+
# Params:
|
482
|
+
# +options+:: +Hash+ of options
|
483
|
+
def anonymize(options = {})
|
484
|
+
self.prefill(options)
|
485
|
+
|
486
|
+
request = Request.new(@client)
|
487
|
+
path = "/cards/" + CGI.escape(@id) + ""
|
488
|
+
data = {
|
489
|
+
|
490
|
+
}
|
491
|
+
|
492
|
+
response = Response.new(request.delete(path, data, options))
|
493
|
+
return_values = Array.new
|
494
|
+
|
495
|
+
return_values.push(response.success)
|
496
|
+
|
497
|
+
|
419
498
|
return_values[0]
|
420
499
|
end
|
421
500
|
|
@@ -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
|
|
@@ -34,6 +35,8 @@ module ProcessOut
|
|
34
35
|
attr_reader :metadata
|
35
36
|
attr_reader :sandbox
|
36
37
|
attr_reader :created_at
|
38
|
+
attr_reader :registered_at
|
39
|
+
attr_reader :date_of_birth
|
37
40
|
|
38
41
|
|
39
42
|
def id=(val)
|
@@ -216,6 +219,14 @@ module ProcessOut
|
|
216
219
|
@created_at = val
|
217
220
|
end
|
218
221
|
|
222
|
+
def registered_at=(val)
|
223
|
+
@registered_at = val
|
224
|
+
end
|
225
|
+
|
226
|
+
def date_of_birth=(val)
|
227
|
+
@date_of_birth = val
|
228
|
+
end
|
229
|
+
|
219
230
|
|
220
231
|
# Initializes the Customer object
|
221
232
|
# Params:
|
@@ -251,6 +262,8 @@ module ProcessOut
|
|
251
262
|
self.metadata = data.fetch(:metadata, nil)
|
252
263
|
self.sandbox = data.fetch(:sandbox, nil)
|
253
264
|
self.created_at = data.fetch(:created_at, nil)
|
265
|
+
self.registered_at = data.fetch(:registered_at, nil)
|
266
|
+
self.date_of_birth = data.fetch(:date_of_birth, nil)
|
254
267
|
|
255
268
|
end
|
256
269
|
|
@@ -259,6 +272,41 @@ module ProcessOut
|
|
259
272
|
Customer.new(@client, data)
|
260
273
|
end
|
261
274
|
|
275
|
+
# Overrides the JSON marshaller to only send the fields we want
|
276
|
+
def to_json(options)
|
277
|
+
{
|
278
|
+
"id": self.id,
|
279
|
+
"project": self.project,
|
280
|
+
"project_id": self.project_id,
|
281
|
+
"default_token": self.default_token,
|
282
|
+
"default_token_id": self.default_token_id,
|
283
|
+
"tokens": self.tokens,
|
284
|
+
"subscriptions": self.subscriptions,
|
285
|
+
"transactions": self.transactions,
|
286
|
+
"balance": self.balance,
|
287
|
+
"currency": self.currency,
|
288
|
+
"email": self.email,
|
289
|
+
"first_name": self.first_name,
|
290
|
+
"last_name": self.last_name,
|
291
|
+
"address1": self.address1,
|
292
|
+
"address2": self.address2,
|
293
|
+
"city": self.city,
|
294
|
+
"state": self.state,
|
295
|
+
"zip": self.zip,
|
296
|
+
"country_code": self.country_code,
|
297
|
+
"ip_address": self.ip_address,
|
298
|
+
"phone_number": self.phone_number,
|
299
|
+
"legal_document": self.legal_document,
|
300
|
+
"sex": self.sex,
|
301
|
+
"is_business": self.is_business,
|
302
|
+
"metadata": self.metadata,
|
303
|
+
"sandbox": self.sandbox,
|
304
|
+
"created_at": self.created_at,
|
305
|
+
"registered_at": self.registered_at,
|
306
|
+
"date_of_birth": self.date_of_birth,
|
307
|
+
}.to_json
|
308
|
+
end
|
309
|
+
|
262
310
|
# Fills the object with data coming from the API
|
263
311
|
# Params:
|
264
312
|
# +data+:: +Hash+ of data coming from the API
|
@@ -347,6 +395,12 @@ module ProcessOut
|
|
347
395
|
if data.include? "created_at"
|
348
396
|
self.created_at = data["created_at"]
|
349
397
|
end
|
398
|
+
if data.include? "registered_at"
|
399
|
+
self.registered_at = data["registered_at"]
|
400
|
+
end
|
401
|
+
if data.include? "date_of_birth"
|
402
|
+
self.date_of_birth = data["date_of_birth"]
|
403
|
+
end
|
350
404
|
|
351
405
|
self
|
352
406
|
end
|
@@ -385,6 +439,8 @@ module ProcessOut
|
|
385
439
|
self.metadata = data.fetch(:metadata, self.metadata)
|
386
440
|
self.sandbox = data.fetch(:sandbox, self.sandbox)
|
387
441
|
self.created_at = data.fetch(:created_at, self.created_at)
|
442
|
+
self.registered_at = data.fetch(:registered_at, self.registered_at)
|
443
|
+
self.date_of_birth = data.fetch(:date_of_birth, self.date_of_birth)
|
388
444
|
|
389
445
|
self
|
390
446
|
end
|
@@ -416,28 +472,6 @@ module ProcessOut
|
|
416
472
|
|
417
473
|
|
418
474
|
|
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
475
|
return_values[0]
|
442
476
|
end
|
443
477
|
|
@@ -601,10 +635,12 @@ module ProcessOut
|
|
601
635
|
"ip_address" => @ip_address,
|
602
636
|
"phone_number" => @phone_number,
|
603
637
|
"legal_document" => @legal_document,
|
638
|
+
"date_of_birth" => @date_of_birth,
|
604
639
|
"is_business" => @is_business,
|
605
640
|
"sex" => @sex,
|
606
641
|
"metadata" => @metadata,
|
607
|
-
"id" => @id
|
642
|
+
"id" => @id,
|
643
|
+
"registered_at" => @registered_at
|
608
644
|
}
|
609
645
|
|
610
646
|
response = Response.new(request.post(path, data, options))
|
@@ -672,9 +708,11 @@ module ProcessOut
|
|
672
708
|
"ip_address" => @ip_address,
|
673
709
|
"phone_number" => @phone_number,
|
674
710
|
"legal_document" => @legal_document,
|
711
|
+
"date_of_birth" => @date_of_birth,
|
675
712
|
"is_business" => @is_business,
|
676
713
|
"sex" => @sex,
|
677
|
-
"metadata" => @metadata
|
714
|
+
"metadata" => @metadata,
|
715
|
+
"registered_at" => @registered_at
|
678
716
|
}
|
679
717
|
|
680
718
|
response = Response.new(request.put(path, data, options))
|