stripe 8.1.0.pre.beta.3 → 8.1.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: 6dbe161b2c79540bf0c14cccaccd03bded2bb67d98b45321d9f24ebd41b24313
4
- data.tar.gz: aee65c5876d3aa9412a05fc3b19282cd3cc2b06e806c139009164ee0544bf99c
3
+ metadata.gz: 33a577d3a54901e265c71453a87d54a54bbb6905f2b698b1f7ee8129661dbdb7
4
+ data.tar.gz: 5c1d73b562666f0761f01c505e1958a81ccc1d94e582d88087ddf768db3ca814
5
5
  SHA512:
6
- metadata.gz: 58f3a41f66ce6dc02711eb56329f9bc876a7a66c66645565a2068bb76814f918acd724fa2334c6d050d381a3cd4acb28055216c9197ae4213454b8761f86681d
7
- data.tar.gz: f06c362d0af1ae83b913d1a6fb282b7a338f3d93f1cddefa6a35f8c67865ece3cee0da3bf8f9c4df15c44d486531c4634f65ed7ce8a1fc39b0892548646d94a1
6
+ metadata.gz: af632e67609cb9b0486fdee261403c54d9f0b2e3b5b3332ad66eaf974bd240f102a8c7db3dddd4edc2919255a31363d77144722a5ee2f974661380ef3a92bffb
7
+ data.tar.gz: 3c184ec9d7ef44027e74b8b74a2bb72446fe45b68e5ce0c862a7aff51a5f4cc992b1d8ca6aeb48f6e359a8c0cf2e8eef1a80facde43f8eefddca03ef53a8b8f6
data/CHANGELOG.md CHANGED
@@ -1,25 +1,7 @@
1
1
  # Changelog
2
2
 
3
- ## 8.1.0-beta.3 - 2022-12-22
4
- * [#1158](https://github.com/stripe/stripe-ruby/pull/1158) API Updates for beta branch
5
- * Updated stable APIs to the latest version
6
- * Move `TaxCalculation` and `TaxTransaction` to `Tax::Calculation` and `Tax::Transaction`.
7
-
8
- ## 8.1.0-beta.2 - 2022-12-15
9
- * [#1156](https://github.com/stripe/stripe-ruby/pull/1156) API Updates for beta branch
10
- * Updated stable APIs to the latest version
11
- * Add support for new resources `TaxCalculation`, and `TaxTransaction`
12
- * Add support for `create` and `list_line_items` methods on resource `TaxCalculation`
13
- * Add support for `create_reversal`, `create`, and `retrieve` methods on resource `TaxTransaction`
14
- * [#1155](https://github.com/stripe/stripe-ruby/pull/1155) API Updates for beta branch
15
- * Updated stable APIs to the latest version
16
- * Add support for new resource `QuoteLine`.
17
-
18
- ## 8.1.0-beta.1 - 2022-12-08
19
- * [#1153](https://github.com/stripe/stripe-ruby/pull/1153) API Updates for beta branch
20
- * Updated stable APIs to the latest version
21
- * [#1146](https://github.com/stripe/stripe-ruby/pull/1146) API Updates for beta branch
22
- * Updated stable APIs to the latest version
3
+ ## 8.1.0 - 2023-01-12
4
+ * [#1162](https://github.com/stripe/stripe-ruby/pull/1162) Improve request events instrumentation
23
5
 
24
6
  ## 8.0.0 - 2022-11-16
25
7
  * [#1144](https://github.com/stripe/stripe-ruby/pull/1144) Next major release changes
@@ -28,29 +10,30 @@ Breaking changes that arose during code generation of the library that we postpo
28
10
 
29
11
  "⚠️" symbol highlights breaking changes.
30
12
 
31
- ## 7.2.0-beta.5 - 2022-11-02
32
- * [#1139](https://github.com/stripe/stripe-ruby/pull/1139) API Updates for beta branch
33
- * Updated beta APIs to the latest stable version
34
- * [#1135](https://github.com/stripe/stripe-ruby/pull/1135) API Updates for beta branch
35
- * Updated stable APIs to the latest version
36
-
37
- ## 7.2.0-beta.4 - 2022-10-07
38
- * [#999](https://github.com/stripe/stripe-ruby/pull/999) DESCRIBE CHANGES HERE (try to use the same style, tense, etc. as the other entries)
13
+ ### Deprecated
14
+ - The `save` method is deprecated. Prefer the static `update` method that doesn't require retrieval of the resource to update it.
15
+ ``` ruby
16
+ # before
17
+ refund = Stripe::Refund.retrieve("re_123")
18
+ refund.description = "Refund description"
19
+ refund.save
20
+
21
+ # after
22
+ Stripe::Refund.update("re_123", description: "Refund description")
23
+ ```
39
24
 
40
- ## 7.2.0-beta.3 - 2022-09-26
41
- * [#1129](https://github.com/stripe/stripe-ruby/pull/1129) API Updates for beta branch
42
- * Updated stable APIs to the latest version
43
- * Add `FinancingOffer`, `FinancingSummary` and `FinancingTransaction` resources.
25
+ ### ⚠️ Removed
26
+ - Removed deprecated `Sku` resource.
27
+ - Removed deprecated `Orders` resource.
28
+ - Removed deprecated `delete` method on `Subscription` resource. Please use `cancel` method instead.
29
+ ```ruby
30
+ # before
31
+ Stripe::Subscription::delete("sub_12345")
44
32
 
45
- ## 7.2.0-beta.2 - 2022-08-26
46
- * [#1127](https://github.com/stripe/stripe-ruby/pull/1127) API Updates for beta branch
47
- * Updated stable APIs to the latest version
48
- * Add support for the beta [Gift Card API](https://stripe.com/docs/gift-cards).
33
+ # after
34
+ Stripe::Subscription::cancel("sub_12345")
35
+ ```
49
36
 
50
- ## 7.2.0-beta.1 - 2022-08-23
51
- * [#1122](https://github.com/stripe/stripe-ruby/pull/1122) API Updates for beta branch
52
- - Updated stable APIs to the latest version
53
- - `Stripe-Version` beta headers are not pinned by-default and need to be manually specified, please refer to [beta SDKs README section](https://github.com/stripe/stripe-ruby/blob/master/README.md#beta-sdks)
54
37
 
55
38
  ## 7.1.0 - 2022-08-19
56
39
  * [#1116](https://github.com/stripe/stripe-ruby/pull/1116) API Updates
@@ -59,16 +42,6 @@ Breaking changes that arose during code generation of the library that we postpo
59
42
  * [#1117](https://github.com/stripe/stripe-ruby/pull/1117) Refresh rubocop config.
60
43
  * [#1115](https://github.com/stripe/stripe-ruby/pull/1115) Add a support section to the readme
61
44
 
62
- ## 7.1.0-beta.2 - 2022-08-11
63
- * [#1113](https://github.com/stripe/stripe-ruby/pull/1113) API Updates for beta branch
64
- - Updated stable APIs to the latest version
65
- - Add `refund_payment` method to Terminal resource
66
-
67
- ## 7.1.0-beta.1 - 2022-08-03
68
- * [#1107](https://github.com/stripe/stripe-ruby/pull/1107) API Updates for beta branch
69
- - Updated stable APIs to the latest version
70
- - Added the `Order` resource support
71
-
72
45
  ## 7.0.0 - 2022-08-02
73
46
 
74
47
  Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the SDK, read more detailed description at https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v7. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-08-01.
@@ -80,19 +53,21 @@ Breaking changes that arose during code generation of the library that we postpo
80
53
  * [#1090](https://github.com/stripe/stripe-ruby/pull/1090) Use auto-generation for `Invoice` methods
81
54
  * [#1103](https://github.com/stripe/stripe-ruby/pull/1103) Next major release changes
82
55
 
83
- ## 6.6.0-beta.1 - 2022-07-22
84
- * [#1100](https://github.com/stripe/stripe-ruby/pull/1100) API Updates for beta branch
85
- - Updated stable APIs to the latest version
86
- - Add `QuotePhase` resource
87
- * [#1097](https://github.com/stripe/stripe-ruby/pull/1097) API Updates for beta branch
88
- - Updated stable APIs to the latest version
89
- - Add `SubscriptionSchedule.amend` method.
90
- * [#1093](https://github.com/stripe/stripe-ruby/pull/1093) API Updates for beta branch
91
- - Include `server_side_confirmation_beta=v1` beta
92
- - Add `secretKeyConfirmation` to `PaymentIntent`
93
- * [#1085](https://github.com/stripe/stripe-ruby/pull/1085) API Updates for beta branch
94
- - Updated stable APIs to the latest version
95
- * [#1075](https://github.com/stripe/stripe-ruby/pull/1075) Use the generated API version
56
+ ### ⚠️ Changed
57
+ * `retrieve_cash_balance` and `update_cash_balance` methods on `Customer` resource no longer requires the second argument to always be `nil`. The methods now now take in `customer_id`, `params`, and `opts` parameters.
58
+ * Update default bundle of CA certificates to April 26, 2022.
59
+
60
+ ### Deprecated
61
+ * Deprecate `delete` method on `Subscription` resource. Please use `cancel` method instead.
62
+
63
+ ### ⚠️ Removed
64
+ * Remove `details` method from `Issuing.Card` resource. The method was not supported.
65
+ * Remove `Issuing.CardDetails` resource. Read more at https://stripe.com/docs/issuing/cards/virtual.
66
+ * Remove `create` method from `ReportType` resource. The method was not supported.
67
+ * Remove `usage_record_summaries` method from `SubscriptionItem` resource. Please use `list_usage_record_summaries` method instead.
68
+ * Remove `AlipayAccount`, `BitcoinReceiver`, `BitcoinTransaction`, `Issuing::CardDetails`, `Recipient`, ` RecipientTransfer`, and `ThreeDSecure` resources. The resources were deprecated or no longer in use.
69
+ * Remove ability to list `Card` resource for a `Recipient`.
70
+ * Remove `cancel` method from `Transfer` resource. The method was deprecated.
96
71
 
97
72
  ## 6.5.0 - 2022-06-29
98
73
  * [#1084](https://github.com/stripe/stripe-ruby/pull/1084) API Updates
@@ -122,6 +97,8 @@ Breaking changes that arose during code generation of the library that we postpo
122
97
  * Add support for new resources `Treasury.CreditReversal`, `Treasury.DebitReversal`, `Treasury.FinancialAccountFeatures`, `Treasury.FinancialAccount`, `Treasury.FlowDetails`, `Treasury.InboundTransfer`, `Treasury.OutboundPayment`, `Treasury.OutboundTransfer`, `Treasury.ReceivedCredit`, `Treasury.ReceivedDebit`, `Treasury.TransactionEntry`, and `Treasury.Transaction`
123
98
  * Add support for `retrieve_payment_method` method on resource `Customer`
124
99
  * Add support for `list_owners` and `list` methods on resource `FinancialConnections.Account`
100
+
101
+
125
102
 
126
103
  ## 6.0.0 - 2022-05-09
127
104
  * [#1056](https://github.com/stripe/stripe-ruby/pull/1056) API Updates
@@ -137,6 +114,7 @@ Breaking changes that arose during code generation of the library that we postpo
137
114
  ## 5.55.0 - 2022-05-05
138
115
  * [#1055](https://github.com/stripe/stripe-ruby/pull/1055) API Updates
139
116
  * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session`
117
+
140
118
 
141
119
  ## 5.54.0 - 2022-05-03
142
120
  * [#1053](https://github.com/stripe/stripe-ruby/pull/1053) API Updates
@@ -1167,4 +1145,3 @@ Identical to 1.56.0 above. I incorrectly cut a patch-level release.
1167
1145
  <!--
1168
1146
  # vim: set tw=0:
1169
1147
  -->
1170
-
data/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v216
1
+ v204
data/VERSION CHANGED
@@ -1 +1 @@
1
- 8.1.0-beta.3
1
+ 8.1.0
@@ -33,6 +33,10 @@ module Stripe
33
33
  attr_reader :num_retries
34
34
  attr_reader :path
35
35
  attr_reader :request_id
36
+ attr_reader :response_header
37
+ attr_reader :response_body
38
+ attr_reader :request_header
39
+ attr_reader :request_body
36
40
 
37
41
  # Arbitrary user-provided data in the form of a Ruby hash that's passed
38
42
  # from subscribers on `request_begin` to subscribers on `request_end`.
@@ -40,19 +44,53 @@ module Stripe
40
44
  # in `request_end`.
41
45
  attr_reader :user_data
42
46
 
43
- def initialize(duration:, http_status:, method:, num_retries:, path:,
44
- request_id:, user_data: nil)
45
- @duration = duration
46
- @http_status = http_status
47
- @method = method
47
+ def initialize(request_context:, response_context:,
48
+ num_retries:, user_data: nil)
49
+ @duration = request_context.duration
50
+ @http_status = response_context.http_status
51
+ @method = request_context.method
48
52
  @num_retries = num_retries
49
- @path = path
50
- @request_id = request_id
53
+ @path = request_context.path
54
+ @request_id = request_context.request_id
51
55
  @user_data = user_data
56
+ @response_header = response_context.header
57
+ @response_body = response_context.body
58
+ @request_header = request_context.header
59
+ @request_body = request_context.body
52
60
  freeze
53
61
  end
54
62
  end
55
63
 
64
+ class RequestContext
65
+ attr_reader :duration
66
+ attr_reader :method
67
+ attr_reader :path
68
+ attr_reader :request_id
69
+ attr_reader :body
70
+ attr_reader :header
71
+
72
+ def initialize(duration:, context:, header:)
73
+ @duration = duration
74
+ @method = context.method
75
+ @path = context.path
76
+ @request_id = context.request_id
77
+ @body = context.body
78
+ @header = header
79
+ end
80
+ end
81
+
82
+ class ResponseContext
83
+ attr_reader :http_status
84
+ attr_reader :body
85
+ attr_reader :header
86
+
87
+ def initialize(http_status:, response:)
88
+ @http_status = http_status
89
+ @header = response ? response.to_hash : nil
90
+ @body = response ? response.body : nil
91
+ end
92
+ end
93
+
56
94
  # This class was renamed for consistency. This alias is here for backwards
57
95
  # compatibility.
58
96
  RequestEvent = RequestEndEvent
@@ -14,7 +14,6 @@ module Stripe
14
14
  # business objects
15
15
  Account::OBJECT_NAME => Account,
16
16
  AccountLink::OBJECT_NAME => AccountLink,
17
- AccountSession::OBJECT_NAME => AccountSession,
18
17
  ApplePayDomain::OBJECT_NAME => ApplePayDomain,
19
18
  ApplicationFee::OBJECT_NAME => ApplicationFee,
20
19
  ApplicationFeeRefund::OBJECT_NAME => ApplicationFeeRefund,
@@ -25,9 +24,6 @@ module Stripe
25
24
  BillingPortal::Configuration::OBJECT_NAME => BillingPortal::Configuration,
26
25
  BillingPortal::Session::OBJECT_NAME => BillingPortal::Session,
27
26
  Capability::OBJECT_NAME => Capability,
28
- Capital::FinancingOffer::OBJECT_NAME => Capital::FinancingOffer,
29
- Capital::FinancingSummary::OBJECT_NAME => Capital::FinancingSummary,
30
- Capital::FinancingTransaction::OBJECT_NAME => Capital::FinancingTransaction,
31
27
  Card::OBJECT_NAME => Card,
32
28
  CashBalance::OBJECT_NAME => CashBalance,
33
29
  Charge::OBJECT_NAME => Charge,
@@ -53,8 +49,6 @@ module Stripe
53
49
  FinancialConnections::AccountOwnership,
54
50
  FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
55
51
  FundingInstructions::OBJECT_NAME => FundingInstructions,
56
- GiftCards::Card::OBJECT_NAME => GiftCards::Card,
57
- GiftCards::Transaction::OBJECT_NAME => GiftCards::Transaction,
58
52
  Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport,
59
53
  Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession,
60
54
  Invoice::OBJECT_NAME => Invoice,
@@ -68,7 +62,6 @@ module Stripe
68
62
  LineItem::OBJECT_NAME => LineItem,
69
63
  LoginLink::OBJECT_NAME => LoginLink,
70
64
  Mandate::OBJECT_NAME => Mandate,
71
- Order::OBJECT_NAME => Order,
72
65
  PaymentIntent::OBJECT_NAME => PaymentIntent,
73
66
  PaymentLink::OBJECT_NAME => PaymentLink,
74
67
  PaymentMethod::OBJECT_NAME => PaymentMethod,
@@ -79,7 +72,6 @@ module Stripe
79
72
  Product::OBJECT_NAME => Product,
80
73
  PromotionCode::OBJECT_NAME => PromotionCode,
81
74
  Quote::OBJECT_NAME => Quote,
82
- QuotePhase::OBJECT_NAME => QuotePhase,
83
75
  Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
84
76
  Radar::ValueList::OBJECT_NAME => Radar::ValueList,
85
77
  Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
@@ -97,8 +89,6 @@ module Stripe
97
89
  Subscription::OBJECT_NAME => Subscription,
98
90
  SubscriptionItem::OBJECT_NAME => SubscriptionItem,
99
91
  SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
100
- Tax::Calculation::OBJECT_NAME => Tax::Calculation,
101
- Tax::Transaction::OBJECT_NAME => Tax::Transaction,
102
92
  TaxCode::OBJECT_NAME => TaxCode,
103
93
  TaxId::OBJECT_NAME => TaxId,
104
94
  TaxRate::OBJECT_NAME => TaxRate,
@@ -29,15 +29,6 @@ module Stripe
29
29
  )
30
30
  end
31
31
 
32
- def draft_quote(params = {}, opts = {})
33
- request_stripe_object(
34
- method: :post,
35
- path: format("/v1/quotes/%<quote>s/draft", { quote: CGI.escape(self["id"]) }),
36
- params: params,
37
- opts: opts
38
- )
39
- end
40
-
41
32
  def finalize_quote(params = {}, opts = {})
42
33
  request_stripe_object(
43
34
  method: :post,
@@ -65,51 +56,6 @@ module Stripe
65
56
  )
66
57
  end
67
58
 
68
- def list_lines(params = {}, opts = {})
69
- request_stripe_object(
70
- method: :get,
71
- path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }),
72
- params: params,
73
- opts: opts
74
- )
75
- end
76
-
77
- def preview_invoice_lines(params = {}, opts = {})
78
- request_stripe_object(
79
- method: :get,
80
- path: format("/v1/quotes/%<quote>s/preview_invoice_lines", { quote: CGI.escape(self["id"]) }),
81
- params: params,
82
- opts: opts
83
- )
84
- end
85
-
86
- def preview_invoices(params = {}, opts = {})
87
- request_stripe_object(
88
- method: :get,
89
- path: format("/v1/quotes/%<quote>s/preview_invoices", { quote: CGI.escape(self["id"]) }),
90
- params: params,
91
- opts: opts
92
- )
93
- end
94
-
95
- def preview_subscription_schedules(params = {}, opts = {})
96
- request_stripe_object(
97
- method: :get,
98
- path: format("/v1/quotes/%<quote>s/preview_subscription_schedules", { quote: CGI.escape(self["id"]) }),
99
- params: params,
100
- opts: opts
101
- )
102
- end
103
-
104
- def reestimate(params = {}, opts = {})
105
- request_stripe_object(
106
- method: :post,
107
- path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }),
108
- params: params,
109
- opts: opts
110
- )
111
- end
112
-
113
59
  def self.accept(quote, params = {}, opts = {})
114
60
  request_stripe_object(
115
61
  method: :post,
@@ -128,15 +74,6 @@ module Stripe
128
74
  )
129
75
  end
130
76
 
131
- def self.draft_quote(quote, params = {}, opts = {})
132
- request_stripe_object(
133
- method: :post,
134
- path: format("/v1/quotes/%<quote>s/draft", { quote: CGI.escape(quote) }),
135
- params: params,
136
- opts: opts
137
- )
138
- end
139
-
140
77
  def self.finalize_quote(quote, params = {}, opts = {})
141
78
  request_stripe_object(
142
79
  method: :post,
@@ -164,51 +101,6 @@ module Stripe
164
101
  )
165
102
  end
166
103
 
167
- def self.list_lines(quote, params = {}, opts = {})
168
- request_stripe_object(
169
- method: :get,
170
- path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }),
171
- params: params,
172
- opts: opts
173
- )
174
- end
175
-
176
- def self.preview_invoice_lines(quote, params = {}, opts = {})
177
- request_stripe_object(
178
- method: :get,
179
- path: format("/v1/quotes/%<quote>s/preview_invoice_lines", { quote: CGI.escape(quote) }),
180
- params: params,
181
- opts: opts
182
- )
183
- end
184
-
185
- def self.preview_invoices(quote, params = {}, opts = {})
186
- request_stripe_object(
187
- method: :get,
188
- path: format("/v1/quotes/%<quote>s/preview_invoices", { quote: CGI.escape(quote) }),
189
- params: params,
190
- opts: opts
191
- )
192
- end
193
-
194
- def self.preview_subscription_schedules(quote, params = {}, opts = {})
195
- request_stripe_object(
196
- method: :get,
197
- path: format("/v1/quotes/%<quote>s/preview_subscription_schedules", { quote: CGI.escape(quote) }),
198
- params: params,
199
- opts: opts
200
- )
201
- end
202
-
203
- def self.reestimate(quote, params = {}, opts = {})
204
- request_stripe_object(
205
- method: :post,
206
- path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
207
- params: params,
208
- opts: opts
209
- )
210
- end
211
-
212
104
  def pdf(params = {}, opts = {}, &read_body_chunk_block)
213
105
  unless block_given?
214
106
  raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the pdf method."
@@ -12,15 +12,6 @@ module Stripe
12
12
 
13
13
  OBJECT_NAME = "subscription_schedule"
14
14
 
15
- def amend(params = {}, opts = {})
16
- request_stripe_object(
17
- method: :post,
18
- path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(self["id"]) }),
19
- params: params,
20
- opts: opts
21
- )
22
- end
23
-
24
15
  def cancel(params = {}, opts = {})
25
16
  request_stripe_object(
26
17
  method: :post,
@@ -39,15 +30,6 @@ module Stripe
39
30
  )
40
31
  end
41
32
 
42
- def self.amend(schedule, params = {}, opts = {})
43
- request_stripe_object(
44
- method: :post,
45
- path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
46
- params: params,
47
- opts: opts
48
- )
49
- end
50
-
51
33
  def self.cancel(schedule, params = {}, opts = {})
52
34
  request_stripe_object(
53
35
  method: :post,
@@ -41,15 +41,6 @@ module Stripe
41
41
  )
42
42
  end
43
43
 
44
- def refund_payment(params = {}, opts = {})
45
- request_stripe_object(
46
- method: :post,
47
- path: format("/v1/terminal/readers/%<reader>s/refund_payment", { reader: CGI.escape(self["id"]) }),
48
- params: params,
49
- opts: opts
50
- )
51
- end
52
-
53
44
  def set_reader_display(params = {}, opts = {})
54
45
  request_stripe_object(
55
46
  method: :post,
@@ -86,15 +77,6 @@ module Stripe
86
77
  )
87
78
  end
88
79
 
89
- def self.refund_payment(reader, params = {}, opts = {})
90
- request_stripe_object(
91
- method: :post,
92
- path: format("/v1/terminal/readers/%<reader>s/refund_payment", { reader: CGI.escape(reader) }),
93
- params: params,
94
- opts: opts
95
- )
96
- end
97
-
98
80
  def self.set_reader_display(reader, params = {}, opts = {})
99
81
  request_stripe_object(
100
82
  method: :post,
@@ -3,7 +3,6 @@
3
3
 
4
4
  require "stripe/resources/account"
5
5
  require "stripe/resources/account_link"
6
- require "stripe/resources/account_session"
7
6
  require "stripe/resources/apple_pay_domain"
8
7
  require "stripe/resources/application_fee"
9
8
  require "stripe/resources/application_fee_refund"
@@ -14,9 +13,6 @@ require "stripe/resources/bank_account"
14
13
  require "stripe/resources/billing_portal/configuration"
15
14
  require "stripe/resources/billing_portal/session"
16
15
  require "stripe/resources/capability"
17
- require "stripe/resources/capital/financing_offer"
18
- require "stripe/resources/capital/financing_summary"
19
- require "stripe/resources/capital/financing_transaction"
20
16
  require "stripe/resources/card"
21
17
  require "stripe/resources/cash_balance"
22
18
  require "stripe/resources/charge"
@@ -40,8 +36,6 @@ require "stripe/resources/financial_connections/account_owner"
40
36
  require "stripe/resources/financial_connections/account_ownership"
41
37
  require "stripe/resources/financial_connections/session"
42
38
  require "stripe/resources/funding_instructions"
43
- require "stripe/resources/gift_cards/card"
44
- require "stripe/resources/gift_cards/transaction"
45
39
  require "stripe/resources/identity/verification_report"
46
40
  require "stripe/resources/identity/verification_session"
47
41
  require "stripe/resources/invoice"
@@ -55,7 +49,6 @@ require "stripe/resources/issuing/transaction"
55
49
  require "stripe/resources/line_item"
56
50
  require "stripe/resources/login_link"
57
51
  require "stripe/resources/mandate"
58
- require "stripe/resources/order"
59
52
  require "stripe/resources/payment_intent"
60
53
  require "stripe/resources/payment_link"
61
54
  require "stripe/resources/payment_method"
@@ -66,7 +59,6 @@ require "stripe/resources/price"
66
59
  require "stripe/resources/product"
67
60
  require "stripe/resources/promotion_code"
68
61
  require "stripe/resources/quote"
69
- require "stripe/resources/quote_phase"
70
62
  require "stripe/resources/radar/early_fraud_warning"
71
63
  require "stripe/resources/radar/value_list"
72
64
  require "stripe/resources/radar/value_list_item"
@@ -84,8 +76,6 @@ require "stripe/resources/source_transaction"
84
76
  require "stripe/resources/subscription"
85
77
  require "stripe/resources/subscription_item"
86
78
  require "stripe/resources/subscription_schedule"
87
- require "stripe/resources/tax/calculation"
88
- require "stripe/resources/tax/transaction"
89
79
  require "stripe/resources/tax_code"
90
80
  require "stripe/resources/tax_id"
91
81
  require "stripe/resources/tax_rate"
@@ -494,15 +494,16 @@ module Stripe
494
494
  end
495
495
  end
496
496
 
497
- http_resp = execute_request_with_rescues(method, api_base, context) do
498
- self.class
499
- .default_connection_manager(config)
500
- .execute_request(method, url,
501
- body: body,
502
- headers: headers,
503
- query: query,
504
- &response_block)
505
- end
497
+ http_resp =
498
+ execute_request_with_rescues(method, api_base, headers, context) do
499
+ self.class
500
+ .default_connection_manager(config)
501
+ .execute_request(method, url,
502
+ body: body,
503
+ headers: headers,
504
+ query: query,
505
+ &response_block)
506
+ end
506
507
 
507
508
  [http_resp, api_key]
508
509
  end
@@ -564,7 +565,7 @@ module Stripe
564
565
  http_status >= 400
565
566
  end
566
567
 
567
- private def execute_request_with_rescues(method, api_base, context)
568
+ private def execute_request_with_rescues(method, api_base, headers, context)
568
569
  num_retries = 0
569
570
 
570
571
  begin
@@ -587,7 +588,7 @@ module Stripe
587
588
 
588
589
  log_response(context, request_start, http_status, resp.body, resp)
589
590
  notify_request_end(context, request_duration, http_status,
590
- num_retries, user_data)
591
+ num_retries, user_data, resp, headers)
591
592
 
592
593
  if config.enable_telemetry? && context.request_id
593
594
  request_duration_ms = (request_duration * 1000).to_i
@@ -614,7 +615,7 @@ module Stripe
614
615
  log_response_error(error_context, request_start, e)
615
616
  end
616
617
  notify_request_end(context, request_duration, http_status, num_retries,
617
- user_data)
618
+ user_data, resp, headers)
618
619
 
619
620
  if self.class.should_retry?(e,
620
621
  method: method,
@@ -657,17 +658,24 @@ module Stripe
657
658
  end
658
659
 
659
660
  private def notify_request_end(context, duration, http_status, num_retries,
660
- user_data)
661
+ user_data, resp, headers)
661
662
  return if !Instrumentation.any_subscribers?(:request_end) &&
662
663
  !Instrumentation.any_subscribers?(:request)
663
664
 
664
- event = Instrumentation::RequestEndEvent.new(
665
+ request_context = Stripe::Instrumentation::RequestContext.new(
665
666
  duration: duration,
667
+ context: context,
668
+ header: headers
669
+ )
670
+ response_context = Stripe::Instrumentation::ResponseContext.new(
666
671
  http_status: http_status,
667
- method: context.method,
672
+ response: resp
673
+ )
674
+
675
+ event = Instrumentation::RequestEndEvent.new(
676
+ request_context: request_context,
677
+ response_context: response_context,
668
678
  num_retries: num_retries,
669
- path: context.path,
670
- request_id: context.request_id,
671
679
  user_data: user_data || {}
672
680
  )
673
681
  Stripe::Instrumentation.notify(:request_end, event)
@@ -63,8 +63,6 @@ module Stripe
63
63
  end
64
64
 
65
65
  def initialize
66
- @api_version = ApiVersion::CURRENT
67
-
68
66
  @ca_bundle_path = Stripe::DEFAULT_CA_BUNDLE_PATH
69
67
  @enable_telemetry = true
70
68
  @verify_ssl_certs = true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "8.1.0-beta.3"
4
+ VERSION = "8.1.0"
5
5
  end
data/lib/stripe.rb CHANGED
@@ -15,7 +15,6 @@ require "uri"
15
15
  require "forwardable"
16
16
 
17
17
  # Version
18
- require "stripe/api_version"
19
18
  require "stripe/version"
20
19
 
21
20
  # API operations
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: 8.1.0.pre.beta.3
4
+ version: 8.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-22 00:00:00.000000000 Z
11
+ date: 2023-01-12 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.
@@ -53,7 +53,6 @@ files:
53
53
  - lib/stripe/resources.rb
54
54
  - lib/stripe/resources/account.rb
55
55
  - lib/stripe/resources/account_link.rb
56
- - lib/stripe/resources/account_session.rb
57
56
  - lib/stripe/resources/alipay_account.rb
58
57
  - lib/stripe/resources/apple_pay_domain.rb
59
58
  - lib/stripe/resources/application_fee.rb
@@ -65,9 +64,6 @@ files:
65
64
  - lib/stripe/resources/billing_portal/configuration.rb
66
65
  - lib/stripe/resources/billing_portal/session.rb
67
66
  - lib/stripe/resources/capability.rb
68
- - lib/stripe/resources/capital/financing_offer.rb
69
- - lib/stripe/resources/capital/financing_summary.rb
70
- - lib/stripe/resources/capital/financing_transaction.rb
71
67
  - lib/stripe/resources/card.rb
72
68
  - lib/stripe/resources/cash_balance.rb
73
69
  - lib/stripe/resources/charge.rb
@@ -91,8 +87,6 @@ files:
91
87
  - lib/stripe/resources/financial_connections/account_ownership.rb
92
88
  - lib/stripe/resources/financial_connections/session.rb
93
89
  - lib/stripe/resources/funding_instructions.rb
94
- - lib/stripe/resources/gift_cards/card.rb
95
- - lib/stripe/resources/gift_cards/transaction.rb
96
90
  - lib/stripe/resources/identity/verification_report.rb
97
91
  - lib/stripe/resources/identity/verification_session.rb
98
92
  - lib/stripe/resources/invoice.rb
@@ -106,7 +100,6 @@ files:
106
100
  - lib/stripe/resources/line_item.rb
107
101
  - lib/stripe/resources/login_link.rb
108
102
  - lib/stripe/resources/mandate.rb
109
- - lib/stripe/resources/order.rb
110
103
  - lib/stripe/resources/payment_intent.rb
111
104
  - lib/stripe/resources/payment_link.rb
112
105
  - lib/stripe/resources/payment_method.rb
@@ -117,7 +110,6 @@ files:
117
110
  - lib/stripe/resources/product.rb
118
111
  - lib/stripe/resources/promotion_code.rb
119
112
  - lib/stripe/resources/quote.rb
120
- - lib/stripe/resources/quote_phase.rb
121
113
  - lib/stripe/resources/radar/early_fraud_warning.rb
122
114
  - lib/stripe/resources/radar/value_list.rb
123
115
  - lib/stripe/resources/radar/value_list_item.rb
@@ -136,8 +128,6 @@ files:
136
128
  - lib/stripe/resources/subscription.rb
137
129
  - lib/stripe/resources/subscription_item.rb
138
130
  - lib/stripe/resources/subscription_schedule.rb
139
- - lib/stripe/resources/tax/calculation.rb
140
- - lib/stripe/resources/tax/transaction.rb
141
131
  - lib/stripe/resources/tax_code.rb
142
132
  - lib/stripe/resources/tax_id.rb
143
133
  - lib/stripe/resources/tax_rate.rb
@@ -193,9 +183,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
193
183
  version: 2.3.0
194
184
  required_rubygems_version: !ruby/object:Gem::Requirement
195
185
  requirements:
196
- - - ">"
186
+ - - ">="
197
187
  - !ruby/object:Gem::Version
198
- version: 1.3.1
188
+ version: '0'
199
189
  requirements: []
200
190
  rubygems_version: 3.3.26
201
191
  signing_key:
@@ -1,17 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- # An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded UIs.
6
- #
7
- # We recommend that you create an AccountSession each time you need to display an embedded UI
8
- # to your user. Do not save AccountSessions to your database as they expire relatively
9
- # quickly, and cannot be used more than once.
10
- #
11
- # Related guide: [Connect embedded UIs](https://stripe.com/docs/connect/get-started-connect-embedded-uis).
12
- class AccountSession < APIResource
13
- extend Stripe::APIOperations::Create
14
-
15
- OBJECT_NAME = "account_session"
16
- end
17
- end
@@ -1,32 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module Capital
6
- # This is an object representing an offer of financing from
7
- # Stripe Capital to a Connect subaccount.
8
- class FinancingOffer < APIResource
9
- extend Stripe::APIOperations::List
10
-
11
- OBJECT_NAME = "capital.financing_offer"
12
-
13
- def mark_delivered(params = {}, opts = {})
14
- request_stripe_object(
15
- method: :post,
16
- path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(self["id"]) }),
17
- params: params,
18
- opts: opts
19
- )
20
- end
21
-
22
- def self.mark_delivered(financing_offer, params = {}, opts = {})
23
- request_stripe_object(
24
- method: :post,
25
- path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(financing_offer) }),
26
- params: params,
27
- opts: opts
28
- )
29
- end
30
- end
31
- end
32
- end
@@ -1,12 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module Capital
6
- # A financing object describes an account's current financing state. Used by Connect
7
- # platforms to read the state of Capital offered to their connected accounts.
8
- class FinancingSummary < SingletonAPIResource
9
- OBJECT_NAME = "capital.financing_summary"
10
- end
11
- end
12
- end
@@ -1,13 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module Capital
6
- # This is an object representing the details of a transaction on a Capital financing object.
7
- class FinancingTransaction < APIResource
8
- extend Stripe::APIOperations::List
9
-
10
- OBJECT_NAME = "capital.financing_transaction"
11
- end
12
- end
13
- end
@@ -1,25 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module GiftCards
6
- # A gift card represents a single gift card owned by a customer, including the
7
- # remaining balance, gift card code, and whether or not it is active.
8
- class Card < APIResource
9
- extend Stripe::APIOperations::Create
10
- extend Stripe::APIOperations::List
11
- include Stripe::APIOperations::Save
12
-
13
- OBJECT_NAME = "gift_cards.card"
14
-
15
- def self.validate(params = {}, opts = {})
16
- request_stripe_object(
17
- method: :post,
18
- path: "/v1/gift_cards/cards/validate",
19
- params: params,
20
- opts: opts
21
- )
22
- end
23
- end
24
- end
25
- end
@@ -1,56 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module GiftCards
6
- # A gift card transaction represents a single transaction on a referenced gift card.
7
- # A transaction is in one of three states, `confirmed`, `held` or `canceled`. A `confirmed`
8
- # transaction is one that has added/deducted funds. A `held` transaction has created a
9
- # temporary hold on funds, which can then be cancelled or confirmed. A `held` transaction
10
- # can be confirmed into a `confirmed` transaction, or canceled into a `canceled` transaction.
11
- # A `canceled` transaction has no effect on a gift card's balance.
12
- class Transaction < APIResource
13
- extend Stripe::APIOperations::Create
14
- extend Stripe::APIOperations::List
15
- include Stripe::APIOperations::Save
16
-
17
- OBJECT_NAME = "gift_cards.transaction"
18
-
19
- def cancel(params = {}, opts = {})
20
- request_stripe_object(
21
- method: :post,
22
- path: format("/v1/gift_cards/transactions/%<id>s/cancel", { id: CGI.escape(self["id"]) }),
23
- params: params,
24
- opts: opts
25
- )
26
- end
27
-
28
- def confirm(params = {}, opts = {})
29
- request_stripe_object(
30
- method: :post,
31
- path: format("/v1/gift_cards/transactions/%<id>s/confirm", { id: CGI.escape(self["id"]) }),
32
- params: params,
33
- opts: opts
34
- )
35
- end
36
-
37
- def self.cancel(id, params = {}, opts = {})
38
- request_stripe_object(
39
- method: :post,
40
- path: format("/v1/gift_cards/transactions/%<id>s/cancel", { id: CGI.escape(id) }),
41
- params: params,
42
- opts: opts
43
- )
44
- end
45
-
46
- def self.confirm(id, params = {}, opts = {})
47
- request_stripe_object(
48
- method: :post,
49
- path: format("/v1/gift_cards/transactions/%<id>s/confirm", { id: CGI.escape(id) }),
50
- params: params,
51
- opts: opts
52
- )
53
- end
54
- end
55
- end
56
- end
@@ -1,89 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- # An Order describes a purchase being made by a customer, including the
6
- # products & quantities being purchased, the order status, the payment information,
7
- # and the billing/shipping details.
8
- #
9
- # Related guide: [Orders overview](https://stripe.com/docs/orders)
10
- class Order < APIResource
11
- extend Stripe::APIOperations::Create
12
- extend Stripe::APIOperations::List
13
- include Stripe::APIOperations::Save
14
-
15
- OBJECT_NAME = "order"
16
-
17
- def cancel(params = {}, opts = {})
18
- request_stripe_object(
19
- method: :post,
20
- path: format("/v1/orders/%<id>s/cancel", { id: CGI.escape(self["id"]) }),
21
- params: params,
22
- opts: opts
23
- )
24
- end
25
-
26
- def list_line_items(params = {}, opts = {})
27
- request_stripe_object(
28
- method: :get,
29
- path: format("/v1/orders/%<id>s/line_items", { id: CGI.escape(self["id"]) }),
30
- params: params,
31
- opts: opts
32
- )
33
- end
34
-
35
- def reopen(params = {}, opts = {})
36
- request_stripe_object(
37
- method: :post,
38
- path: format("/v1/orders/%<id>s/reopen", { id: CGI.escape(self["id"]) }),
39
- params: params,
40
- opts: opts
41
- )
42
- end
43
-
44
- def submit(params = {}, opts = {})
45
- request_stripe_object(
46
- method: :post,
47
- path: format("/v1/orders/%<id>s/submit", { id: CGI.escape(self["id"]) }),
48
- params: params,
49
- opts: opts
50
- )
51
- end
52
-
53
- def self.cancel(id, params = {}, opts = {})
54
- request_stripe_object(
55
- method: :post,
56
- path: format("/v1/orders/%<id>s/cancel", { id: CGI.escape(id) }),
57
- params: params,
58
- opts: opts
59
- )
60
- end
61
-
62
- def self.list_line_items(id, params = {}, opts = {})
63
- request_stripe_object(
64
- method: :get,
65
- path: format("/v1/orders/%<id>s/line_items", { id: CGI.escape(id) }),
66
- params: params,
67
- opts: opts
68
- )
69
- end
70
-
71
- def self.reopen(id, params = {}, opts = {})
72
- request_stripe_object(
73
- method: :post,
74
- path: format("/v1/orders/%<id>s/reopen", { id: CGI.escape(id) }),
75
- params: params,
76
- opts: opts
77
- )
78
- end
79
-
80
- def self.submit(id, params = {}, opts = {})
81
- request_stripe_object(
82
- method: :post,
83
- path: format("/v1/orders/%<id>s/submit", { id: CGI.escape(id) }),
84
- params: params,
85
- opts: opts
86
- )
87
- end
88
- end
89
- end
@@ -1,29 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- # A quote phase describes the line items, coupons, and trialing status of a subscription for a predefined time period.
6
- class QuotePhase < APIResource
7
- extend Stripe::APIOperations::List
8
-
9
- OBJECT_NAME = "quote_phase"
10
-
11
- def list_line_items(params = {}, opts = {})
12
- request_stripe_object(
13
- method: :get,
14
- path: format("/v1/quote_phases/%<quote_phase>s/line_items", { quote_phase: CGI.escape(self["id"]) }),
15
- params: params,
16
- opts: opts
17
- )
18
- end
19
-
20
- def self.list_line_items(quote_phase, params = {}, opts = {})
21
- request_stripe_object(
22
- method: :get,
23
- path: format("/v1/quote_phases/%<quote_phase>s/line_items", { quote_phase: CGI.escape(quote_phase) }),
24
- params: params,
25
- opts: opts
26
- )
27
- end
28
- end
29
- end
@@ -1,31 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module Tax
6
- # A Tax `Calculation` allows you to calculate the tax to collect from your customer.
7
- class Calculation < APIResource
8
- extend Stripe::APIOperations::Create
9
-
10
- OBJECT_NAME = "tax.calculation"
11
-
12
- def list_line_items(params = {}, opts = {})
13
- request_stripe_object(
14
- method: :get,
15
- path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(self["id"]) }),
16
- params: params,
17
- opts: opts
18
- )
19
- end
20
-
21
- def self.list_line_items(calculation, params = {}, opts = {})
22
- request_stripe_object(
23
- method: :get,
24
- path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(calculation) }),
25
- params: params,
26
- opts: opts
27
- )
28
- end
29
- end
30
- end
31
- end
@@ -1,22 +0,0 @@
1
- # File generated from our OpenAPI spec
2
- # frozen_string_literal: true
3
-
4
- module Stripe
5
- module Tax
6
- # A Tax `Transaction` records the tax collected from or refunded to your customer.
7
- class Transaction < APIResource
8
- extend Stripe::APIOperations::Create
9
-
10
- OBJECT_NAME = "tax.transaction"
11
-
12
- def self.create_reversal(params = {}, opts = {})
13
- request_stripe_object(
14
- method: :post,
15
- path: "/v1/tax/transactions/create_reversal",
16
- params: params,
17
- opts: opts
18
- )
19
- end
20
- end
21
- end
22
- end