stripe 3.29.0 → 3.30.0

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
  SHA256:
3
- metadata.gz: 6e298206c847cff44415718ea2e06a6893c45a6f14c7ed1e9a57991f219202b4
4
- data.tar.gz: 4bad1dabea6a309281c68abd4fac7ce2b554d5968021498874d5a1883d6cc0aa
3
+ metadata.gz: d25c4b43b8450a6e3cd10eaf3ceace0da2068f58c0820640fdd89a6d4a926a4f
4
+ data.tar.gz: c61b1f9772ec914cffb1dd86232ea95e77c8ecdb74c9806aa7d0db3af0ca9060
5
5
  SHA512:
6
- metadata.gz: a0d542b06fada309a4e4027f4f56866b5f4ee4352eb204c07579d055cc104f741641ec34186d8363c7091a6b7add22377ce910850f5b1c3138684cf5edca4452
7
- data.tar.gz: 2656d0642e185fb4648c04b860d834f348bdca474a4298218eb9ad862c5c596126bd6188ba93e47bd64d2c0e39f8b2405759b53ff00d15bfc1062bbfd8abfc0b
6
+ metadata.gz: eebf86824a520894c505579ff7aba5d07767aec03bdca7ffe6c8e5ade709539af8c82e9c146cfe33a1814a426c294bec10666d6923b1248d4d6de20e2f12315e
7
+ data.tar.gz: 52249b7edcb8e9a336819a0281ed38f7015162fa5062b6f5b2eb791e5936105baceb05e91f89780ea32d716ea12df92ed0e96ca336324c943024ab3747ee756a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.30.0 - 2018-11-08
4
+ * [#693](https://github.com/stripe/stripe-ruby/pull/693) Add new API endpoints for the `Invoice` resource.
5
+
3
6
  ## 3.29.0 - 2018-10-30
4
7
  * [#692](https://github.com/stripe/stripe-ruby/pull/692) Add support for the `Person` resource
5
8
  * [#694](https://github.com/stripe/stripe-ruby/pull/694) Add support for the `WebhookEndpoint` resource
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.29.0
1
+ 3.30.0
@@ -4,28 +4,45 @@ module Stripe
4
4
  class Invoice < APIResource
5
5
  extend Stripe::APIOperations::List
6
6
  include Stripe::APIOperations::Save
7
+ include Stripe::APIOperations::Delete
7
8
  extend Stripe::APIOperations::Create
8
9
 
9
10
  OBJECT_NAME = "invoice".freeze
10
11
 
11
- def self.upcoming(params, opts = {})
12
- resp, opts = request(:get, upcoming_url, params, opts)
13
- Util.convert_to_stripe_object(resp.data, opts)
12
+ def finalize_invoice(params = {}, opts = {})
13
+ url = resource_url + "/finalize"
14
+ resp, opts = request(:post, url, params, opts)
15
+ initialize_from(resp.data, opts)
16
+ end
17
+
18
+ def mark_uncollectible(params = {}, opts = {})
19
+ url = resource_url + "/mark_uncollectible"
20
+ resp, opts = request(:post, url, params, opts)
21
+ initialize_from(resp.data, opts)
14
22
  end
15
23
 
16
24
  def pay(params = {}, opts = {})
17
- resp, opts = request(:post, pay_url, params, opts)
25
+ url = resource_url + "/pay"
26
+ resp, opts = request(:post, url, params, opts)
18
27
  initialize_from(resp.data, opts)
19
28
  end
20
29
 
21
- def self.upcoming_url
22
- resource_url + "/upcoming"
30
+ def send_invoice(params = {}, opts = {})
31
+ url = resource_url + "/send"
32
+ resp, opts = request(:post, url, params, opts)
33
+ initialize_from(resp.data, opts)
34
+ end
35
+
36
+ def self.upcoming(params, opts = {})
37
+ url = resource_url + "/upcoming"
38
+ resp, opts = request(:get, url, params, opts)
39
+ Util.convert_to_stripe_object(resp.data, opts)
23
40
  end
24
- private_class_method :upcoming_url
25
41
 
26
- def pay_url
27
- resource_url + "/pay"
42
+ def void_invoice(params = {}, opts = {})
43
+ url = resource_url + "/void"
44
+ resp, opts = request(:post, url, params, opts)
45
+ initialize_from(resp.data, opts)
28
46
  end
29
- private :pay_url
30
47
  end
31
48
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "3.29.0".freeze
4
+ VERSION = "3.30.0".freeze
5
5
  end
@@ -40,5 +40,12 @@ module Stripe
40
40
  assert_requested :post, "#{Stripe.api_base}/v1/coupons/25OFF"
41
41
  assert coupon.is_a?(Stripe::Coupon)
42
42
  end
43
+
44
+ should "be deletable" do
45
+ coupon = Stripe::Coupon.retrieve("25OFF")
46
+ coupon = coupon.delete
47
+ assert_requested :delete, "#{Stripe.api_base}/v1/coupons/#{coupon.id}"
48
+ assert coupon.is_a?(Stripe::Coupon)
49
+ end
43
50
  end
44
51
  end
@@ -38,6 +38,33 @@ module Stripe
38
38
  assert invoice.is_a?(Stripe::Invoice)
39
39
  end
40
40
 
41
+ should "be deletable" do
42
+ invoice = Stripe::Invoice.retrieve("in_123")
43
+ invoice = invoice.delete
44
+ assert_requested :delete, "#{Stripe.api_base}/v1/invoices/#{invoice.id}"
45
+ assert invoice.is_a?(Stripe::Invoice)
46
+ end
47
+
48
+ context "#finalize" do
49
+ should "finalize invoice" do
50
+ invoice = Stripe::Invoice.retrieve("in_123")
51
+ invoice = invoice.finalize_invoice
52
+ assert_requested :post,
53
+ "#{Stripe.api_base}/v1/invoices/#{invoice.id}/finalize"
54
+ assert invoice.is_a?(Stripe::Invoice)
55
+ end
56
+ end
57
+
58
+ context "#mark_uncollectible" do
59
+ should "mark invoice as uncollectible" do
60
+ invoice = Stripe::Invoice.retrieve("in_123")
61
+ invoice = invoice.mark_uncollectible
62
+ assert_requested :post,
63
+ "#{Stripe.api_base}/v1/invoices/#{invoice.id}/mark_uncollectible"
64
+ assert invoice.is_a?(Stripe::Invoice)
65
+ end
66
+ end
67
+
41
68
  context "#pay" do
42
69
  should "pay invoice" do
43
70
  invoice = Stripe::Invoice.retrieve("in_123")
@@ -61,6 +88,16 @@ module Stripe
61
88
  end
62
89
  end
63
90
 
91
+ context "#send" do
92
+ should "send invoice" do
93
+ invoice = Stripe::Invoice.retrieve("in_123")
94
+ invoice = invoice.send_invoice
95
+ assert_requested :post,
96
+ "#{Stripe.api_base}/v1/invoices/#{invoice.id}/send"
97
+ assert invoice.is_a?(Stripe::Invoice)
98
+ end
99
+ end
100
+
64
101
  context "#upcoming" do
65
102
  should "retrieve upcoming invoices" do
66
103
  invoice = Stripe::Invoice.upcoming(
@@ -109,5 +146,15 @@ module Stripe
109
146
  assert invoice.is_a?(Stripe::Invoice)
110
147
  end
111
148
  end
149
+
150
+ context "#void" do
151
+ should "void invoice" do
152
+ invoice = Stripe::Invoice.retrieve("in_123")
153
+ invoice = invoice.void_invoice
154
+ assert_requested :post,
155
+ "#{Stripe.api_base}/v1/invoices/#{invoice.id}/void"
156
+ assert invoice.is_a?(Stripe::Invoice)
157
+ end
158
+ end
112
159
  end
113
160
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.29.0
4
+ version: 3.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-30 00:00:00.000000000 Z
11
+ date: 2018-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  version: '0'
224
224
  requirements: []
225
225
  rubyforge_project:
226
- rubygems_version: 2.7.7
226
+ rubygems_version: 2.7.8
227
227
  signing_key:
228
228
  specification_version: 4
229
229
  summary: Ruby bindings for the Stripe API