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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24e1b19b205b51963006e4a8e75a6b178187d9af
4
- data.tar.gz: 1d16bd46db11818cb9c72af6347e827f757055db
3
+ metadata.gz: aaca840d5540ab7057070b885acf62871d133a67
4
+ data.tar.gz: 9f02aeac4a8d84dad73af7e0c0e26b1570cbf829
5
5
  SHA512:
6
- metadata.gz: e27ad1bc2515cdb9845c289b4198881c4d89b6e6307b216918d2639503aaa9a8a5b0daca66d8337904a8d5a19ec8cc7c8a3cdbeb7c5280b917e249b3e97f8cab
7
- data.tar.gz: 773b1dee9c0adef049733dcc4e63e0f5e22e856fd895d1f517dabdc36d845c2aa36feb5ee8f0bc042f8a934c1bc1d911ee33802a2d2e12d406eb2070e6c2d21a
6
+ metadata.gz: cf9f397160fc764a1f47814b0f42a45c4c748ce5248c85f9fec3d9784f62aae073e18fd016a9e60cbcd0bab44a3f9fee094b6ca9f38aea44deda677756eecfa6
7
+ data.tar.gz: ee33b803ea05c3a1c1562f76662d492f165686bea36423fb34d7db979e2db4eba08c63f79af8e05098381ff0a873fc4c9e5165460f27f7f9ae7a7b9c8980ed23
@@ -162,7 +162,7 @@ module ProcessOut
162
162
  return_values[0]
163
163
  end
164
164
 
165
- # Apply a new discount to the given subscription ID from a coupon ID.
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
- return_values.push(self.fill_with_data(body))
184
+ obj = Discount.new(@client)
185
+ return_values.push(obj.fill_with_data(body))
188
186
 
189
187
 
190
188
 
@@ -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 gateway_configurations(options = {})
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
 
@@ -1,3 +1,3 @@
1
1
  module ProcessOut
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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-17 00:00:00.000000000 Z
11
+ date: 2016-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler