processout 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/processout/customer.rb +20 -0
- data/lib/processout/token.rb +28 -0
- data/lib/processout/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5e2cdc042316196e59c7dd6ebb34a1a25581bd0
|
4
|
+
data.tar.gz: '0967a09a211c169ad983027c6b0a5b6744034c71'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39d967203cfd32de53825a0e7d43dbaebc74e753b615c2d256045e997d2160d48961e5fb6ef35b90bfc3cd5cd3cad4ce3cf4c170c9e7dd840a8db1adaf6806d7
|
7
|
+
data.tar.gz: d62e0993b549096faca9328b40e55ff8f5b0df3ab62d26f99dc57f6a4dc1a234391420a72dee3291309e543898a81919c95bf7a88a4a8fba17f3b9f06083bf6e
|
data/lib/processout/customer.rb
CHANGED
@@ -272,6 +272,26 @@ module ProcessOut
|
|
272
272
|
return_values[0]
|
273
273
|
end
|
274
274
|
|
275
|
+
# Delete a customer's token by its ID.
|
276
|
+
# Params:
|
277
|
+
# +token_id+:: ID of the token
|
278
|
+
# +options+:: +Hash+ of options
|
279
|
+
def delete_token(token_id, options = {})
|
280
|
+
request = Request.new(@client)
|
281
|
+
path = "customers/" + CGI.escape(@id) + "/tokens/" + CGI.escape(token_id) + ""
|
282
|
+
data = {
|
283
|
+
|
284
|
+
}
|
285
|
+
|
286
|
+
response = Response.new(request.delete(path, data, options))
|
287
|
+
return_values = Array.new
|
288
|
+
|
289
|
+
return_values.push(response.success)
|
290
|
+
|
291
|
+
|
292
|
+
return_values[0]
|
293
|
+
end
|
294
|
+
|
275
295
|
# Get the transactions belonging to the customer.
|
276
296
|
# Params:
|
277
297
|
# +options+:: +Hash+ of options
|
data/lib/processout/token.rb
CHANGED
@@ -9,6 +9,7 @@ module ProcessOut
|
|
9
9
|
|
10
10
|
attr_reader :id
|
11
11
|
attr_reader :customer
|
12
|
+
attr_reader :customer_id
|
12
13
|
attr_reader :card
|
13
14
|
attr_reader :type
|
14
15
|
attr_reader :metadata
|
@@ -31,6 +32,10 @@ module ProcessOut
|
|
31
32
|
|
32
33
|
end
|
33
34
|
|
35
|
+
def customer_id=(val)
|
36
|
+
@customer_id = val
|
37
|
+
end
|
38
|
+
|
34
39
|
def card=(val)
|
35
40
|
if val.instance_of? Card
|
36
41
|
@card = val
|
@@ -68,6 +73,7 @@ module ProcessOut
|
|
68
73
|
|
69
74
|
@id = data.fetch(:id, "")
|
70
75
|
@customer = data.fetch(:customer, nil)
|
76
|
+
@customer_id = data.fetch(:customer_id, "")
|
71
77
|
@card = data.fetch(:card, nil)
|
72
78
|
@type = data.fetch(:type, "")
|
73
79
|
@metadata = data.fetch(:metadata, Hash.new)
|
@@ -91,6 +97,9 @@ module ProcessOut
|
|
91
97
|
if data.include? "customer"
|
92
98
|
self.customer = data["customer"]
|
93
99
|
end
|
100
|
+
if data.include? "customer_id"
|
101
|
+
self.customer_id = data["customer_id"]
|
102
|
+
end
|
94
103
|
if data.include? "card"
|
95
104
|
self.card = data["card"]
|
96
105
|
end
|
@@ -190,6 +199,25 @@ module ProcessOut
|
|
190
199
|
|
191
200
|
|
192
201
|
|
202
|
+
return_values[0]
|
203
|
+
end
|
204
|
+
|
205
|
+
# Delete a customer token
|
206
|
+
# Params:
|
207
|
+
# +options+:: +Hash+ of options
|
208
|
+
def delete(options = {})
|
209
|
+
request = Request.new(@client)
|
210
|
+
path = "customers/" + CGI.escape(@customer_id) + "/tokens/" + CGI.escape(@id) + ""
|
211
|
+
data = {
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
response = Response.new(request.delete(path, data, options))
|
216
|
+
return_values = Array.new
|
217
|
+
|
218
|
+
return_values.push(response.success)
|
219
|
+
|
220
|
+
|
193
221
|
return_values[0]
|
194
222
|
end
|
195
223
|
|
data/lib/processout/version.rb
CHANGED