stripe 5.35.0 → 5.36.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f51ef2fd825e626807098544261c034bf55a84cf59852a7ac1c88a213add62ca
4
- data.tar.gz: 6df0829f6b372f47393a5a22cc8aba022c40620188c0e8c3619d41965d84837b
3
+ metadata.gz: 9055258932833823356b606115c73e9a909bbfc2e6d70506e2c71d21e2176c27
4
+ data.tar.gz: 4a7261f19e29f65407bff7ee8ae916c1b826e81ac4e1e9c102b6ac147c548b31
5
5
  SHA512:
6
- metadata.gz: 1d0c7c97de7a70c94ebd08659f6a0630f3508347772d2ed7a799778f2c08db2e6a1540a9b77b377f31edeadc6d5a874da4e084994c8ce23e4690512db083c987
7
- data.tar.gz: 180af07a05467d75b0a88907bf59a0f837981ab4cd6ca16673ec4f17bedcff33e7efcf80ff482cd14517b9a2efa25095ce018011fc82b70d62a20bddc1cd2525
6
+ metadata.gz: bd7fa29256871a690e19758b6777d9ee58e51fa4cf0a7b3e576fac24deca605cdb400e7eb091378ff15540c1a48ccfd25ba0bb9befba04d6a92d95fb1202416b
7
+ data.tar.gz: ce6d07144a874d49e088033645916e1aa09b2e5eedf787ea1eb182ef963ffddafd314d7442a258937e028b8d84ed04c00d02c68f6a93841a262dbd5bc6e5aecd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.36.0 - 2021-07-09
4
+ * [#987](https://github.com/stripe/stripe-ruby/pull/987) Add support for `Quote` API
5
+
3
6
  ## 5.35.0 - 2021-06-30
4
7
  * [#985](https://github.com/stripe/stripe-ruby/pull/985) Update normalize_opts to use dup instead of clone.
5
8
  * [#982](https://github.com/stripe/stripe-ruby/pull/982) Deprecate travis
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.35.0
1
+ 5.36.0
@@ -65,6 +65,7 @@ module Stripe
65
65
  Price::OBJECT_NAME => Price,
66
66
  Product::OBJECT_NAME => Product,
67
67
  PromotionCode::OBJECT_NAME => PromotionCode,
68
+ Quote::OBJECT_NAME => Quote,
68
69
  Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
69
70
  Radar::ValueList::OBJECT_NAME => Radar::ValueList,
70
71
  Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
@@ -54,6 +54,7 @@ require "stripe/resources/plan"
54
54
  require "stripe/resources/price"
55
55
  require "stripe/resources/product"
56
56
  require "stripe/resources/promotion_code"
57
+ require "stripe/resources/quote"
57
58
  require "stripe/resources/radar/early_fraud_warning"
58
59
  require "stripe/resources/radar/value_list"
59
60
  require "stripe/resources/radar/value_list_item"
@@ -0,0 +1,95 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ class Quote < APIResource
6
+ extend Stripe::APIOperations::Create
7
+ extend Stripe::APIOperations::List
8
+ include Stripe::APIOperations::Save
9
+
10
+ OBJECT_NAME = "quote"
11
+
12
+ custom_method :accept, http_verb: :post
13
+ custom_method :cancel, http_verb: :post
14
+ custom_method :finalize_quote, http_verb: :post, http_path: "finalize"
15
+ custom_method :list_line_items, http_verb: :get, http_path: "line_items"
16
+
17
+ def accept(params = {}, opts = {})
18
+ request_stripe_object(
19
+ method: :post,
20
+ path: resource_url + "/accept",
21
+ params: params,
22
+ opts: opts
23
+ )
24
+ end
25
+
26
+ def cancel(params = {}, opts = {})
27
+ request_stripe_object(
28
+ method: :post,
29
+ path: resource_url + "/cancel",
30
+ params: params,
31
+ opts: opts
32
+ )
33
+ end
34
+
35
+ def finalize_quote(params = {}, opts = {})
36
+ request_stripe_object(
37
+ method: :post,
38
+ path: resource_url + "/finalize",
39
+ params: params,
40
+ opts: opts
41
+ )
42
+ end
43
+
44
+ def list_line_items(params = {}, opts = {})
45
+ request_stripe_object(
46
+ method: :get,
47
+ path: resource_url + "/line_items",
48
+ params: params,
49
+ opts: opts
50
+ )
51
+ end
52
+
53
+ def pdf(params = {}, opts = {}, &read_body_chunk_block)
54
+ unless block_given?
55
+ raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the pdf method."
56
+ end
57
+
58
+ config = opts[:client]&.config || Stripe.config
59
+
60
+ request_stream(
61
+ method: :get,
62
+ path: resource_url + "/pdf",
63
+ params: params,
64
+ opts: {
65
+ api_base: config.uploads_base,
66
+ }.merge(opts),
67
+ &read_body_chunk_block
68
+ )
69
+ end
70
+
71
+ def self.pdf(id, params = {}, opts = {}, &read_body_chunk_block)
72
+ unless id.is_a?(String)
73
+ raise ArgumentError,
74
+ "id should be a string representing the ID of an API resource"
75
+ end
76
+
77
+ unless block_given?
78
+ raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the pdf method."
79
+ end
80
+
81
+ config = opts[:client]&.config || Stripe.config
82
+
83
+ resp = execute_resource_request_stream(
84
+ :get,
85
+ "#{resource_url}/#{CGI.escape(id)}/pdf",
86
+ params,
87
+ {
88
+ api_base: config.uploads_base,
89
+ }.merge(opts),
90
+ &read_body_chunk_block
91
+ )
92
+ resp
93
+ end
94
+ end
95
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "5.35.0"
4
+ VERSION = "5.36.0"
5
5
  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: 5.35.0
4
+ version: 5.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-30 00:00:00.000000000 Z
11
+ date: 2021-07-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Stripe is the easiest way to accept payments online. See https://stripe.com
14
14
  for details.
@@ -100,6 +100,7 @@ files:
100
100
  - lib/stripe/resources/price.rb
101
101
  - lib/stripe/resources/product.rb
102
102
  - lib/stripe/resources/promotion_code.rb
103
+ - lib/stripe/resources/quote.rb
103
104
  - lib/stripe/resources/radar/early_fraud_warning.rb
104
105
  - lib/stripe/resources/radar/value_list.rb
105
106
  - lib/stripe/resources/radar/value_list_item.rb