stripe 11.2.0 → 11.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/Gemfile +0 -4
- data/OPENAPI_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/stripe/api_operations/nested_resource.rb +22 -2
- data/lib/stripe/resources/account.rb +28 -15
- data/lib/stripe/resources/bank_account.rb +4 -3
- data/lib/stripe/resources/event.rb +3 -3
- data/lib/stripe/resources/invoice.rb +5 -1
- data/lib/stripe/resources/issuing/authorization.rb +11 -0
- data/lib/stripe/resources/login_link.rb +1 -1
- data/lib/stripe/resources/person.rb +2 -3
- data/lib/stripe/resources/token.rb +2 -2
- data/lib/stripe/resources/treasury/outbound_payment.rb +20 -0
- data/lib/stripe/resources/treasury/outbound_transfer.rb +20 -0
- data/lib/stripe/resources/webhook_endpoint.rb +2 -2
- data/lib/stripe/stripe_client.rb +8 -1
- data/lib/stripe/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd6a3e42dbb95019d823e6954b1d21e2fabcb3944bd75f5e39645d50afabca9e
|
4
|
+
data.tar.gz: e3251ac60295b039a63a29645ab59e0dd3ab02b6abec5a71c4b7d2f3eee21fad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a26e79aca89d810145faac1b9e95e895b4f45408144abe167f7c5ce7fd2b496c419c8cdc9af617299730897ccfe51bb2a01947a8ad103b91c7eb8b61acb9bf9
|
7
|
+
data.tar.gz: a60299c26fc4519bb9d681eb8d7ec43782ebc3dde09bfe90a316bb53d4ae9455587246689394269b5cd8d6b7f269f741ea2acca0dfcf148630a2126eeb3481bf
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,19 @@
|
|
1
1
|
# Changelog
|
2
|
+
## 11.4.0 - 2024-05-09
|
3
|
+
* [#1397](https://github.com/stripe/stripe-ruby/pull/1397) Update generated code
|
4
|
+
* Add support for `update` test helper method on resources `Treasury.OutboundPayment` and `Treasury.OutboundTransfer`
|
5
|
+
* [#1399](https://github.com/stripe/stripe-ruby/pull/1399) Pass params to transfer reversal
|
6
|
+
* Allow `Stripe::Transfer.retrieve_reversal()` to accept a params hash as the third argument, followed by opts. No changes to existing calls are necessary, but in a future major version this method will be updated to only accept params as the first argument. Fixes [#1393](https://github.com/stripe/stripe-ruby/issues/1393)
|
7
|
+
* [#1389](https://github.com/stripe/stripe-ruby/pull/1389) Removed jaro_winkler as a dependency
|
8
|
+
* [#1396](https://github.com/stripe/stripe-ruby/pull/1396) Start tracking `StripeClient#request` usage
|
9
|
+
|
10
|
+
## 11.3.0 - 2024-05-02
|
11
|
+
* [#1387](https://github.com/stripe/stripe-ruby/pull/1387) Update generated code
|
12
|
+
|
13
|
+
* [#1392](https://github.com/stripe/stripe-ruby/pull/1392) Deprecate Ruby methods based on OpenAPI spec
|
14
|
+
- Mark as deprecated the `approve` and `decline` methods in `lib/stripe/resources/issuing/authorization.rb`. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
15
|
+
* [#1391](https://github.com/stripe/stripe-ruby/pull/1391) Add Ruby 3.3 to CI test matrix
|
16
|
+
|
2
17
|
## 11.2.0 - 2024-04-18
|
3
18
|
* [#1385](https://github.com/stripe/stripe-ruby/pull/1385) Update generated code
|
4
19
|
* Add support for `create_preview` method on resource `Invoice`
|
data/Gemfile
CHANGED
@@ -27,10 +27,6 @@ group :development do
|
|
27
27
|
# The latest version of rubocop is only compatible with Ruby 2.7+
|
28
28
|
gem "rubocop", "1.57.2" if RUBY_VERSION >= "2.7"
|
29
29
|
|
30
|
-
# jaro_winkler 1.5.5 installation fails for jruby
|
31
|
-
# don't install on truffleruby
|
32
|
-
gem "jaro_winkler", "1.5.4" unless RUBY_ENGINE == "truffleruby"
|
33
|
-
|
34
30
|
gem "sorbet"
|
35
31
|
gem "tapioca"
|
36
32
|
|
data/OPENAPI_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
v1011
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
11.
|
1
|
+
11.4.0
|
@@ -35,6 +35,7 @@ module Stripe
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
# rubocop:disable Metrics/MethodLength
|
38
39
|
private def define_operation(
|
39
40
|
resource,
|
40
41
|
operation,
|
@@ -53,12 +54,30 @@ module Stripe
|
|
53
54
|
)
|
54
55
|
end
|
55
56
|
when :retrieve
|
57
|
+
# TODO: (Major) Split params_or_opts to params and opts and get rid of the complicated way to add params
|
56
58
|
define_singleton_method(:"retrieve_#{resource}") \
|
57
|
-
do |id, nested_id,
|
59
|
+
do |id, nested_id, params_or_opts = {}, definitely_opts = nil|
|
60
|
+
opts = nil
|
61
|
+
params = nil
|
62
|
+
if definitely_opts.nil?
|
63
|
+
unrecognized_key = params_or_opts.keys.find { |k| !Util::OPTS_USER_SPECIFIED.include?(k) }
|
64
|
+
if unrecognized_key
|
65
|
+
raise ArgumentError,
|
66
|
+
"Unrecognized request option: #{unrecognized_key}. Did you mean to specify this as " \
|
67
|
+
"retrieve params? " \
|
68
|
+
"If so, you must explicitly pass an opts hash as a fourth argument. " \
|
69
|
+
"For example: .retrieve(#{id}, #{nested_id}, {#{unrecognized_key}: 'foo'}, {})"
|
70
|
+
end
|
71
|
+
|
72
|
+
opts = params_or_opts
|
73
|
+
else
|
74
|
+
opts = definitely_opts
|
75
|
+
params = params_or_opts
|
76
|
+
end
|
58
77
|
request_stripe_object(
|
59
78
|
method: :get,
|
60
79
|
path: send(resource_url_method, id, nested_id),
|
61
|
-
params:
|
80
|
+
params: params,
|
62
81
|
opts: opts
|
63
82
|
)
|
64
83
|
end
|
@@ -96,6 +115,7 @@ module Stripe
|
|
96
115
|
raise ArgumentError, "Unknown operation: #{operation.inspect}"
|
97
116
|
end
|
98
117
|
end
|
118
|
+
# rubocop:enable Metrics/MethodLength
|
99
119
|
end
|
100
120
|
end
|
101
121
|
end
|
@@ -6,9 +6,14 @@ module Stripe
|
|
6
6
|
# properties on the account like its current requirements or if the account is
|
7
7
|
# enabled to make live charges or receive payouts.
|
8
8
|
#
|
9
|
-
# For
|
10
|
-
#
|
11
|
-
#
|
9
|
+
# For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
|
10
|
+
# is `application`, which includes Custom accounts, the properties below are always
|
11
|
+
# returned.
|
12
|
+
#
|
13
|
+
# For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
|
14
|
+
# is `stripe`, which includes Standard and Express accounts, some properties are only returned
|
15
|
+
# until you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions)
|
16
|
+
# to start Connect Onboarding. Learn about the [differences between accounts](https://stripe.com/connect/accounts).
|
12
17
|
class Account < APIResource
|
13
18
|
extend Stripe::APIOperations::Create
|
14
19
|
include Stripe::APIOperations::Delete
|
@@ -39,9 +44,11 @@ module Stripe
|
|
39
44
|
request_stripe_object(method: :post, path: "/v1/accounts", params: params, opts: opts)
|
40
45
|
end
|
41
46
|
|
42
|
-
# With [Connect](https://stripe.com/
|
47
|
+
# With [Connect](https://stripe.com/connect), you can delete accounts you manage.
|
48
|
+
#
|
49
|
+
# Test-mode accounts can be deleted at any time.
|
43
50
|
#
|
44
|
-
#
|
51
|
+
# Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero.
|
45
52
|
#
|
46
53
|
# If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
|
47
54
|
def self.delete(id, params = {}, opts = {})
|
@@ -53,9 +60,11 @@ module Stripe
|
|
53
60
|
)
|
54
61
|
end
|
55
62
|
|
56
|
-
# With [Connect](https://stripe.com/
|
63
|
+
# With [Connect](https://stripe.com/connect), you can delete accounts you manage.
|
57
64
|
#
|
58
|
-
#
|
65
|
+
# Test-mode accounts can be deleted at any time.
|
66
|
+
#
|
67
|
+
# Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero.
|
59
68
|
#
|
60
69
|
# If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
|
61
70
|
def delete(params = {}, opts = {})
|
@@ -92,9 +101,9 @@ module Stripe
|
|
92
101
|
)
|
93
102
|
end
|
94
103
|
|
95
|
-
# With [Connect](https://stripe.com/
|
104
|
+
# With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious.
|
96
105
|
#
|
97
|
-
#
|
106
|
+
# Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero.
|
98
107
|
def reject(params = {}, opts = {})
|
99
108
|
request_stripe_object(
|
100
109
|
method: :post,
|
@@ -104,9 +113,9 @@ module Stripe
|
|
104
113
|
)
|
105
114
|
end
|
106
115
|
|
107
|
-
# With [Connect](https://stripe.com/
|
116
|
+
# With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious.
|
108
117
|
#
|
109
|
-
#
|
118
|
+
# Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero.
|
110
119
|
def self.reject(account, params = {}, opts = {})
|
111
120
|
request_stripe_object(
|
112
121
|
method: :post,
|
@@ -116,12 +125,16 @@ module Stripe
|
|
116
125
|
)
|
117
126
|
end
|
118
127
|
|
119
|
-
# Updates a [connected account](https://stripe.com/
|
128
|
+
# Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are
|
120
129
|
# left unchanged.
|
121
130
|
#
|
122
|
-
# For
|
123
|
-
#
|
124
|
-
#
|
131
|
+
# For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
|
132
|
+
# is application, which includes Custom accounts, you can update any information on the account.
|
133
|
+
#
|
134
|
+
# For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
|
135
|
+
# is stripe, which includes Standard and Express accounts, you can update all information until you create
|
136
|
+
# an [Account Link or <a href="/api/account_sessions">Account Session](https://stripe.com/api/account_links) to start Connect onboarding,
|
137
|
+
# after which some properties can no longer be updated.
|
125
138
|
#
|
126
139
|
# To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our
|
127
140
|
# [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
|
@@ -4,11 +4,12 @@
|
|
4
4
|
module Stripe
|
5
5
|
# These bank accounts are payment methods on `Customer` objects.
|
6
6
|
#
|
7
|
-
# On the other hand [External Accounts](https://stripe.com/
|
8
|
-
# destinations on `Account` objects for [
|
7
|
+
# On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer
|
8
|
+
# destinations on `Account` objects for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
|
9
|
+
# is `application`, which includes [Custom accounts](https://stripe.com/connect/custom-accounts).
|
9
10
|
# They can be bank accounts or debit cards as well, and are documented in the links above.
|
10
11
|
#
|
11
|
-
# Related guide: [Bank debits and transfers](https://stripe.com/
|
12
|
+
# Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers)
|
12
13
|
class BankAccount < APIResource
|
13
14
|
include Stripe::APIOperations::Delete
|
14
15
|
extend Stripe::APIOperations::List
|
@@ -23,10 +23,10 @@ module Stripe
|
|
23
23
|
# `Event` objects directly to an endpoint on your server. You can manage
|
24
24
|
# webhooks in your
|
25
25
|
# [account settings](https://dashboard.stripe.com/account/webhooks). Learn how
|
26
|
-
# to [listen for events](https://stripe.com/
|
26
|
+
# to [listen for events](https://docs.stripe.com/webhooks)
|
27
27
|
# so that your integration can automatically trigger reactions.
|
28
28
|
#
|
29
|
-
# When using [Connect](https://stripe.com/
|
29
|
+
# When using [Connect](https://docs.stripe.com/connect), you can also receive event notifications
|
30
30
|
# that occur in connected accounts. For these events, there's an
|
31
31
|
# additional `account` attribute in the received `Event` object.
|
32
32
|
#
|
@@ -40,7 +40,7 @@ module Stripe
|
|
40
40
|
"event"
|
41
41
|
end
|
42
42
|
|
43
|
-
# List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/
|
43
|
+
# List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header).
|
44
44
|
def self.list(filters = {}, opts = {})
|
45
45
|
request_stripe_object(method: :get, path: "/v1/events", params: filters, opts: opts)
|
46
46
|
end
|
@@ -56,6 +56,8 @@ module Stripe
|
|
56
56
|
# Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
|
57
57
|
#
|
58
58
|
# You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
|
59
|
+
#
|
60
|
+
# Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
|
59
61
|
def self.create_preview(params = {}, opts = {})
|
60
62
|
request_stripe_object(
|
61
63
|
method: :post,
|
@@ -196,7 +198,9 @@ module Stripe
|
|
196
198
|
#
|
197
199
|
# Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
|
198
200
|
#
|
199
|
-
# You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the
|
201
|
+
# You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
|
202
|
+
#
|
203
|
+
# Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
|
200
204
|
def self.upcoming(params = {}, opts = {})
|
201
205
|
request_stripe_object(method: :get, path: "/v1/invoices/upcoming", params: params, opts: opts)
|
202
206
|
end
|
@@ -9,6 +9,7 @@ module Stripe
|
|
9
9
|
#
|
10
10
|
# Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations)
|
11
11
|
class Authorization < APIResource
|
12
|
+
extend Gem::Deprecate
|
12
13
|
extend Stripe::APIOperations::List
|
13
14
|
include Stripe::APIOperations::Save
|
14
15
|
|
@@ -27,6 +28,7 @@ module Stripe
|
|
27
28
|
opts: opts
|
28
29
|
)
|
29
30
|
end
|
31
|
+
deprecate :approve, :none, 2024, 3
|
30
32
|
|
31
33
|
# [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
32
34
|
# This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
@@ -38,6 +40,10 @@ module Stripe
|
|
38
40
|
opts: opts
|
39
41
|
)
|
40
42
|
end
|
43
|
+
class << self
|
44
|
+
extend Gem::Deprecate
|
45
|
+
deprecate :approve, :none, 2024, 3
|
46
|
+
end
|
41
47
|
|
42
48
|
# [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
43
49
|
# This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
@@ -49,6 +55,7 @@ module Stripe
|
|
49
55
|
opts: opts
|
50
56
|
)
|
51
57
|
end
|
58
|
+
deprecate :decline, :none, 2024, 3
|
52
59
|
|
53
60
|
# [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
54
61
|
# This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
@@ -60,6 +67,10 @@ module Stripe
|
|
60
67
|
opts: opts
|
61
68
|
)
|
62
69
|
end
|
70
|
+
class << self
|
71
|
+
extend Gem::Deprecate
|
72
|
+
deprecate :decline, :none, 2024, 3
|
73
|
+
end
|
63
74
|
|
64
75
|
# Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
65
76
|
def self.list(filters = {}, opts = {})
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
-
# Login Links are single-use
|
5
|
+
# Login Links are single-use URLs for a connected account to access the Express Dashboard. The connected account's [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/object#account_object-controller-stripe_dashboard-type) must be `express` to have access to the Express Dashboard.
|
6
6
|
class LoginLink < APIResource
|
7
7
|
OBJECT_NAME = "login_link"
|
8
8
|
def self.object_name
|
@@ -4,10 +4,9 @@
|
|
4
4
|
module Stripe
|
5
5
|
# This is an object representing a person associated with a Stripe account.
|
6
6
|
#
|
7
|
-
# A platform cannot access a
|
8
|
-
# See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps.
|
7
|
+
# A platform cannot access a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding.
|
9
8
|
#
|
10
|
-
#
|
9
|
+
# See the [Standard onboarding](https://stripe.com/connect/standard-accounts) or [Express onboarding](https://stripe.com/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](https://stripe.com/connect/handling-api-verification#person-information).
|
11
10
|
class Person < APIResource
|
12
11
|
include Stripe::APIOperations::Save
|
13
12
|
|
@@ -19,7 +19,7 @@ module Stripe
|
|
19
19
|
#
|
20
20
|
# You can't store or use tokens more than once. To store card or bank account
|
21
21
|
# information for later use, create [Customer](https://stripe.com/docs/api#customers)
|
22
|
-
# objects or [
|
22
|
+
# objects or [External accounts](https://stripe.com/api#external_accounts).
|
23
23
|
# [Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection,
|
24
24
|
# performs best with integrations that use client-side tokenization.
|
25
25
|
class Token < APIResource
|
@@ -31,7 +31,7 @@ module Stripe
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# Creates a single-use token that represents a bank account's details.
|
34
|
-
# You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [
|
34
|
+
# You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts.
|
35
35
|
def self.create(params = {}, opts = {})
|
36
36
|
request_stripe_object(method: :post, path: "/v1/tokens", params: params, opts: opts)
|
37
37
|
end
|
@@ -124,6 +124,26 @@ module Stripe
|
|
124
124
|
opts: opts
|
125
125
|
)
|
126
126
|
end
|
127
|
+
|
128
|
+
# Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states.
|
129
|
+
def self.update(id, params = {}, opts = {})
|
130
|
+
request_stripe_object(
|
131
|
+
method: :post,
|
132
|
+
path: format("/v1/test_helpers/treasury/outbound_payments/%<id>s", { id: CGI.escape(id) }),
|
133
|
+
params: params,
|
134
|
+
opts: opts
|
135
|
+
)
|
136
|
+
end
|
137
|
+
|
138
|
+
# Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states.
|
139
|
+
def update(params = {}, opts = {})
|
140
|
+
@resource.request_stripe_object(
|
141
|
+
method: :post,
|
142
|
+
path: format("/v1/test_helpers/treasury/outbound_payments/%<id>s", { id: CGI.escape(@resource["id"]) }),
|
143
|
+
params: params,
|
144
|
+
opts: opts
|
145
|
+
)
|
146
|
+
end
|
127
147
|
end
|
128
148
|
end
|
129
149
|
end
|
@@ -124,6 +124,26 @@ module Stripe
|
|
124
124
|
opts: opts
|
125
125
|
)
|
126
126
|
end
|
127
|
+
|
128
|
+
# Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states.
|
129
|
+
def self.update(outbound_transfer, params = {}, opts = {})
|
130
|
+
request_stripe_object(
|
131
|
+
method: :post,
|
132
|
+
path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s", { outbound_transfer: CGI.escape(outbound_transfer) }),
|
133
|
+
params: params,
|
134
|
+
opts: opts
|
135
|
+
)
|
136
|
+
end
|
137
|
+
|
138
|
+
# Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states.
|
139
|
+
def update(params = {}, opts = {})
|
140
|
+
@resource.request_stripe_object(
|
141
|
+
method: :post,
|
142
|
+
path: format("/v1/test_helpers/treasury/outbound_transfers/%<outbound_transfer>s", { outbound_transfer: CGI.escape(@resource["id"]) }),
|
143
|
+
params: params,
|
144
|
+
opts: opts
|
145
|
+
)
|
146
|
+
end
|
127
147
|
end
|
128
148
|
end
|
129
149
|
end
|
@@ -2,13 +2,13 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
module Stripe
|
5
|
-
# You can configure [webhook endpoints](https://stripe.com/
|
5
|
+
# You can configure [webhook endpoints](https://docs.stripe.com/webhooks/) via the API to be
|
6
6
|
# notified about events that happen in your Stripe account or connected
|
7
7
|
# accounts.
|
8
8
|
#
|
9
9
|
# Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints.
|
10
10
|
#
|
11
|
-
# Related guide: [Setting up webhooks](https://stripe.com/
|
11
|
+
# Related guide: [Setting up webhooks](https://docs.stripe.com/webhooks/configure)
|
12
12
|
class WebhookEndpoint < APIResource
|
13
13
|
extend Stripe::APIOperations::Create
|
14
14
|
include Stripe::APIOperations::Delete
|
data/lib/stripe/stripe_client.rb
CHANGED
@@ -18,6 +18,11 @@ module Stripe
|
|
18
18
|
@system_profiler = SystemProfiler.new
|
19
19
|
@last_request_metrics = nil
|
20
20
|
|
21
|
+
# The following attribute is only used to log whether or not
|
22
|
+
# StripeClient#request has been called. To be removed in a
|
23
|
+
# future major version.
|
24
|
+
@usage = []
|
25
|
+
|
21
26
|
@config = case config_arg
|
22
27
|
when Hash
|
23
28
|
Stripe.config.reverse_duplicate_merge(config_arg)
|
@@ -186,6 +191,7 @@ module Stripe
|
|
186
191
|
# charge, resp = client.request { Charge.create }
|
187
192
|
#
|
188
193
|
def request
|
194
|
+
@usage = ["stripe_client_request"]
|
189
195
|
old_stripe_client = self.class.current_thread_context.active_client
|
190
196
|
self.class.current_thread_context.active_client = self
|
191
197
|
|
@@ -200,6 +206,7 @@ module Stripe
|
|
200
206
|
res = yield
|
201
207
|
[res, self.class.current_thread_context.last_responses[object_id]]
|
202
208
|
ensure
|
209
|
+
@usage = []
|
203
210
|
self.class.current_thread_context.active_client = old_stripe_client
|
204
211
|
self.class.current_thread_context.last_responses.delete(object_id)
|
205
212
|
end
|
@@ -583,7 +590,7 @@ module Stripe
|
|
583
590
|
if config.enable_telemetry? && context.request_id
|
584
591
|
request_duration_ms = (request_duration * 1000).to_i
|
585
592
|
@last_request_metrics =
|
586
|
-
StripeRequestMetrics.new(context.request_id, request_duration_ms, usage: usage)
|
593
|
+
StripeRequestMetrics.new(context.request_id, request_duration_ms, usage: usage + @usage)
|
587
594
|
end
|
588
595
|
|
589
596
|
# We rescue all exceptions from a request so that we have an easy spot to
|
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: 11.
|
4
|
+
version: 11.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-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.
|
@@ -216,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
216
|
- !ruby/object:Gem::Version
|
217
217
|
version: '0'
|
218
218
|
requirements: []
|
219
|
-
rubygems_version: 3.3.
|
219
|
+
rubygems_version: 3.3.27
|
220
220
|
signing_key:
|
221
221
|
specification_version: 4
|
222
222
|
summary: Ruby bindings for the Stripe API
|