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 +4 -4
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/stripe/object_types.rb +1 -0
- data/lib/stripe/resources.rb +1 -0
- data/lib/stripe/resources/quote.rb +95 -0
- data/lib/stripe/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9055258932833823356b606115c73e9a909bbfc2e6d70506e2c71d21e2176c27
|
4
|
+
data.tar.gz: 4a7261f19e29f65407bff7ee8ae916c1b826e81ac4e1e9c102b6ac147c548b31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
1
|
+
5.36.0
|
data/lib/stripe/object_types.rb
CHANGED
@@ -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,
|
data/lib/stripe/resources.rb
CHANGED
@@ -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
|
data/lib/stripe/version.rb
CHANGED
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.
|
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-
|
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
|