processout 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/processout/discount.rb +3 -5
- data/lib/processout/project.rb +1 -1
- data/lib/processout/subscription.rb +23 -0
- data/lib/processout/version.rb +1 -1
- 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: aaca840d5540ab7057070b885acf62871d133a67
|
4
|
+
data.tar.gz: 9f02aeac4a8d84dad73af7e0c0e26b1570cbf829
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf9f397160fc764a1f47814b0f42a45c4c748ce5248c85f9fec3d9784f62aae073e18fd016a9e60cbcd0bab44a3f9fee094b6ca9f38aea44deda677756eecfa6
|
7
|
+
data.tar.gz: ee33b803ea05c3a1c1562f76662d492f165686bea36423fb34d7db979e2db4eba08c63f79af8e05098381ff0a873fc4c9e5165460f27f7f9ae7a7b9c8980ed23
|
data/lib/processout/discount.rb
CHANGED
@@ -162,7 +162,7 @@ module ProcessOut
|
|
162
162
|
return_values[0]
|
163
163
|
end
|
164
164
|
|
165
|
-
# Apply a new discount
|
165
|
+
# Apply a new discount on the subscription from a coupon ID.
|
166
166
|
# Params:
|
167
167
|
# +subscription_id+:: ID of the subscription
|
168
168
|
# +coupon_id+:: ID of the coupon
|
@@ -171,9 +171,6 @@ module ProcessOut
|
|
171
171
|
request = Request.new(@client)
|
172
172
|
path = "/subscriptions/" + CGI.escape(subscription_id) + "/discounts"
|
173
173
|
data = {
|
174
|
-
"amount" => @amount,
|
175
|
-
"expires_at" => @expires_at,
|
176
|
-
"metadata" => @metadata,
|
177
174
|
"coupon_id" => coupon_id
|
178
175
|
}
|
179
176
|
|
@@ -184,7 +181,8 @@ module ProcessOut
|
|
184
181
|
body = body["discount"]
|
185
182
|
|
186
183
|
|
187
|
-
|
184
|
+
obj = Discount.new(@client)
|
185
|
+
return_values.push(obj.fill_with_data(body))
|
188
186
|
|
189
187
|
|
190
188
|
|
data/lib/processout/project.rb
CHANGED
@@ -81,7 +81,7 @@ module ProcessOut
|
|
81
81
|
# Get all the gateway configurations of the project
|
82
82
|
# Params:
|
83
83
|
# +options+:: +Hash+ of options
|
84
|
-
def
|
84
|
+
def fetch_gateway_configurations(options = {})
|
85
85
|
request = Request.new(@client)
|
86
86
|
path = "/projects/" + CGI.escape(@id) + "/gateway-configurations"
|
87
87
|
data = {
|
@@ -324,6 +324,29 @@ module ProcessOut
|
|
324
324
|
|
325
325
|
|
326
326
|
|
327
|
+
return_values[0]
|
328
|
+
end
|
329
|
+
|
330
|
+
# Apply a coupon on the subscription.
|
331
|
+
# Params:
|
332
|
+
# +coupon_id+:: ID of the coupon
|
333
|
+
# +options+:: +Hash+ of options
|
334
|
+
def apply_coupon(coupon_id, options = {})
|
335
|
+
request = Request.new(@client)
|
336
|
+
path = "/subscriptions/" + CGI.escape(@id) + "/discounts"
|
337
|
+
data = {
|
338
|
+
"coupon_id" => coupon_id
|
339
|
+
}
|
340
|
+
|
341
|
+
response = Response.new(request.post(path, data, options))
|
342
|
+
return_values = Array.new
|
343
|
+
|
344
|
+
body = response.body
|
345
|
+
body = body["discount"]
|
346
|
+
discount = Discount.new(@client)
|
347
|
+
return_values.push(discount.fill_with_data(body))
|
348
|
+
|
349
|
+
|
327
350
|
return_values[0]
|
328
351
|
end
|
329
352
|
|
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: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel HUEZ
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|