stripe 9.4.1 → 9.5.0.pre.beta.1
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 +219 -46
- data/OPENAPI_VERSION +1 -1
- data/README.md +11 -0
- data/VERSION +1 -1
- data/lib/data/ca-certificates.crt +3340 -290
- data/lib/stripe/api_operations/request.rb +2 -0
- data/lib/stripe/api_version.rb +1 -0
- data/lib/stripe/object_types.rb +18 -0
- data/lib/stripe/request_signing_authenticator.rb +83 -0
- data/lib/stripe/resources/capital/financing_offer.rb +32 -0
- data/lib/stripe/resources/capital/financing_summary.rb +12 -0
- data/lib/stripe/resources/capital/financing_transaction.rb +13 -0
- data/lib/stripe/resources/confirmation_token.rb +11 -0
- data/lib/stripe/resources/customer_session.rb +12 -0
- data/lib/stripe/resources/financial_connections/account.rb +39 -0
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +13 -0
- data/lib/stripe/resources/financial_connections/transaction.rb +13 -0
- data/lib/stripe/resources/gift_cards/card.rb +25 -0
- data/lib/stripe/resources/gift_cards/transaction.rb +56 -0
- data/lib/stripe/resources/issuing/personalization_design.rb +77 -0
- data/lib/stripe/resources/issuing/physical_bundle.rb +13 -0
- data/lib/stripe/resources/order.rb +89 -0
- data/lib/stripe/resources/quote.rb +94 -0
- data/lib/stripe/resources/quote_phase.rb +29 -0
- data/lib/stripe/resources/quote_preview_invoice.rb +42 -0
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +10 -0
- data/lib/stripe/resources/subscription_schedule.rb +18 -0
- data/lib/stripe/resources/tax/form.rb +39 -0
- data/lib/stripe/resources/tax/registration.rb +19 -0
- data/lib/stripe/resources/terminal/reader.rb +54 -0
- data/lib/stripe/resources.rb +17 -0
- data/lib/stripe/stripe_client.rb +60 -26
- data/lib/stripe/stripe_configuration.rb +2 -0
- data/lib/stripe/util.rb +8 -1
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +46 -0
- metadata +26 -8
|
@@ -27,6 +27,7 @@ module Stripe
|
|
|
27
27
|
class StripeConfiguration
|
|
28
28
|
attr_accessor :api_key
|
|
29
29
|
attr_accessor :api_version
|
|
30
|
+
attr_accessor :authenticator
|
|
30
31
|
attr_accessor :client_id
|
|
31
32
|
attr_accessor :enable_telemetry
|
|
32
33
|
attr_accessor :logger
|
|
@@ -64,6 +65,7 @@ module Stripe
|
|
|
64
65
|
|
|
65
66
|
def initialize
|
|
66
67
|
@api_version = ApiVersion::CURRENT
|
|
68
|
+
|
|
67
69
|
@ca_bundle_path = Stripe::DEFAULT_CA_BUNDLE_PATH
|
|
68
70
|
@enable_telemetry = true
|
|
69
71
|
@verify_ssl_certs = true
|
data/lib/stripe/util.rb
CHANGED
|
@@ -7,6 +7,7 @@ module Stripe
|
|
|
7
7
|
# Options that a user is allowed to specify.
|
|
8
8
|
OPTS_USER_SPECIFIED = Set[
|
|
9
9
|
:api_key,
|
|
10
|
+
:authenticator,
|
|
10
11
|
:idempotency_key,
|
|
11
12
|
:stripe_account,
|
|
12
13
|
:stripe_version
|
|
@@ -281,7 +282,13 @@ module Stripe
|
|
|
281
282
|
when String
|
|
282
283
|
{ api_key: opts }
|
|
283
284
|
when Hash
|
|
284
|
-
|
|
285
|
+
# If the user is using request signing for authentication,
|
|
286
|
+
# no need to check the api_key per request.
|
|
287
|
+
if !(opts.key?(:client) &&
|
|
288
|
+
opts.fetch(:client).config.authenticator) &&
|
|
289
|
+
opts.key?(:api_key)
|
|
290
|
+
check_api_key!(opts.fetch(:api_key))
|
|
291
|
+
end
|
|
285
292
|
# Explicitly use dup here instead of clone to avoid preserving freeze
|
|
286
293
|
# state on input params.
|
|
287
294
|
opts.dup
|
data/lib/stripe/version.rb
CHANGED
data/lib/stripe.rb
CHANGED
|
@@ -13,6 +13,7 @@ require "set"
|
|
|
13
13
|
require "socket"
|
|
14
14
|
require "uri"
|
|
15
15
|
require "forwardable"
|
|
16
|
+
require "base64"
|
|
16
17
|
|
|
17
18
|
# Version
|
|
18
19
|
require "stripe/api_version"
|
|
@@ -44,6 +45,7 @@ require "stripe/api_resource_test_helpers"
|
|
|
44
45
|
require "stripe/singleton_api_resource"
|
|
45
46
|
require "stripe/webhook"
|
|
46
47
|
require "stripe/stripe_configuration"
|
|
48
|
+
require "stripe/request_signing_authenticator"
|
|
47
49
|
|
|
48
50
|
# Named API resources
|
|
49
51
|
require "stripe/resources"
|
|
@@ -70,6 +72,7 @@ module Stripe
|
|
|
70
72
|
|
|
71
73
|
# User configurable options
|
|
72
74
|
def_delegators :@config, :api_key, :api_key=
|
|
75
|
+
def_delegators :@config, :authenticator, :authenticator=
|
|
73
76
|
def_delegators :@config, :api_version, :api_version=
|
|
74
77
|
def_delegators :@config, :stripe_account, :stripe_account=
|
|
75
78
|
def_delegators :@config, :api_base, :api_base=
|
|
@@ -116,6 +119,49 @@ module Stripe
|
|
|
116
119
|
version: version,
|
|
117
120
|
}
|
|
118
121
|
end
|
|
122
|
+
|
|
123
|
+
class Preview
|
|
124
|
+
def self._get_default_opts(opts)
|
|
125
|
+
{ api_mode: :preview }.merge(opts)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def self.get(url, opts = {})
|
|
129
|
+
Stripe.raw_request(:get, url, {}, _get_default_opts(opts))
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def self.post(url, params = {}, opts = {})
|
|
133
|
+
Stripe.raw_request(:post, url, params, _get_default_opts(opts))
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def self.delete(url, opts = {})
|
|
137
|
+
Stripe.raw_request(:delete, url, {}, _get_default_opts(opts))
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
class RawRequest
|
|
142
|
+
include Stripe::APIOperations::Request
|
|
143
|
+
|
|
144
|
+
def initialize
|
|
145
|
+
@opts = {}
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def execute(method, url, params = {}, opts = {})
|
|
149
|
+
resp, = execute_resource_request(method, url, params, opts)
|
|
150
|
+
|
|
151
|
+
resp
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Sends a request to Stripe REST API
|
|
156
|
+
def self.raw_request(method, url, params = {}, opts = {})
|
|
157
|
+
req = RawRequest.new
|
|
158
|
+
req.execute(method, url, params, opts)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def self.deserialize(data)
|
|
162
|
+
data = JSON.parse(data) if data.is_a?(String)
|
|
163
|
+
Util.convert_to_stripe_object(data, {})
|
|
164
|
+
end
|
|
119
165
|
end
|
|
120
166
|
|
|
121
167
|
Stripe.log_level = ENV["STRIPE_LOG"] unless ENV["STRIPE_LOG"].nil?
|
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: 9.
|
|
4
|
+
version: 9.5.0.pre.beta.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stripe
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-10-05 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.
|
|
@@ -50,6 +50,7 @@ files:
|
|
|
50
50
|
- lib/stripe/multipart_encoder.rb
|
|
51
51
|
- lib/stripe/oauth.rb
|
|
52
52
|
- lib/stripe/object_types.rb
|
|
53
|
+
- lib/stripe/request_signing_authenticator.rb
|
|
53
54
|
- lib/stripe/resources.rb
|
|
54
55
|
- lib/stripe/resources/account.rb
|
|
55
56
|
- lib/stripe/resources/account_link.rb
|
|
@@ -65,10 +66,14 @@ files:
|
|
|
65
66
|
- lib/stripe/resources/billing_portal/configuration.rb
|
|
66
67
|
- lib/stripe/resources/billing_portal/session.rb
|
|
67
68
|
- lib/stripe/resources/capability.rb
|
|
69
|
+
- lib/stripe/resources/capital/financing_offer.rb
|
|
70
|
+
- lib/stripe/resources/capital/financing_summary.rb
|
|
71
|
+
- lib/stripe/resources/capital/financing_transaction.rb
|
|
68
72
|
- lib/stripe/resources/card.rb
|
|
69
73
|
- lib/stripe/resources/cash_balance.rb
|
|
70
74
|
- lib/stripe/resources/charge.rb
|
|
71
75
|
- lib/stripe/resources/checkout/session.rb
|
|
76
|
+
- lib/stripe/resources/confirmation_token.rb
|
|
72
77
|
- lib/stripe/resources/country_spec.rb
|
|
73
78
|
- lib/stripe/resources/coupon.rb
|
|
74
79
|
- lib/stripe/resources/credit_note.rb
|
|
@@ -76,6 +81,7 @@ files:
|
|
|
76
81
|
- lib/stripe/resources/customer.rb
|
|
77
82
|
- lib/stripe/resources/customer_balance_transaction.rb
|
|
78
83
|
- lib/stripe/resources/customer_cash_balance_transaction.rb
|
|
84
|
+
- lib/stripe/resources/customer_session.rb
|
|
79
85
|
- lib/stripe/resources/discount.rb
|
|
80
86
|
- lib/stripe/resources/dispute.rb
|
|
81
87
|
- lib/stripe/resources/ephemeral_key.rb
|
|
@@ -84,10 +90,14 @@ files:
|
|
|
84
90
|
- lib/stripe/resources/file.rb
|
|
85
91
|
- lib/stripe/resources/file_link.rb
|
|
86
92
|
- lib/stripe/resources/financial_connections/account.rb
|
|
93
|
+
- lib/stripe/resources/financial_connections/account_inferred_balance.rb
|
|
87
94
|
- lib/stripe/resources/financial_connections/account_owner.rb
|
|
88
95
|
- lib/stripe/resources/financial_connections/account_ownership.rb
|
|
89
96
|
- lib/stripe/resources/financial_connections/session.rb
|
|
97
|
+
- lib/stripe/resources/financial_connections/transaction.rb
|
|
90
98
|
- lib/stripe/resources/funding_instructions.rb
|
|
99
|
+
- lib/stripe/resources/gift_cards/card.rb
|
|
100
|
+
- lib/stripe/resources/gift_cards/transaction.rb
|
|
91
101
|
- lib/stripe/resources/identity/verification_report.rb
|
|
92
102
|
- lib/stripe/resources/identity/verification_session.rb
|
|
93
103
|
- lib/stripe/resources/invoice.rb
|
|
@@ -97,11 +107,14 @@ files:
|
|
|
97
107
|
- lib/stripe/resources/issuing/card.rb
|
|
98
108
|
- lib/stripe/resources/issuing/cardholder.rb
|
|
99
109
|
- lib/stripe/resources/issuing/dispute.rb
|
|
110
|
+
- lib/stripe/resources/issuing/personalization_design.rb
|
|
111
|
+
- lib/stripe/resources/issuing/physical_bundle.rb
|
|
100
112
|
- lib/stripe/resources/issuing/token.rb
|
|
101
113
|
- lib/stripe/resources/issuing/transaction.rb
|
|
102
114
|
- lib/stripe/resources/line_item.rb
|
|
103
115
|
- lib/stripe/resources/login_link.rb
|
|
104
116
|
- lib/stripe/resources/mandate.rb
|
|
117
|
+
- lib/stripe/resources/order.rb
|
|
105
118
|
- lib/stripe/resources/payment_intent.rb
|
|
106
119
|
- lib/stripe/resources/payment_link.rb
|
|
107
120
|
- lib/stripe/resources/payment_method.rb
|
|
@@ -114,6 +127,9 @@ files:
|
|
|
114
127
|
- lib/stripe/resources/product.rb
|
|
115
128
|
- lib/stripe/resources/promotion_code.rb
|
|
116
129
|
- lib/stripe/resources/quote.rb
|
|
130
|
+
- lib/stripe/resources/quote_phase.rb
|
|
131
|
+
- lib/stripe/resources/quote_preview_invoice.rb
|
|
132
|
+
- lib/stripe/resources/quote_preview_subscription_schedule.rb
|
|
117
133
|
- lib/stripe/resources/radar/early_fraud_warning.rb
|
|
118
134
|
- lib/stripe/resources/radar/value_list.rb
|
|
119
135
|
- lib/stripe/resources/radar/value_list_item.rb
|
|
@@ -134,6 +150,8 @@ files:
|
|
|
134
150
|
- lib/stripe/resources/subscription_schedule.rb
|
|
135
151
|
- lib/stripe/resources/tax/calculation.rb
|
|
136
152
|
- lib/stripe/resources/tax/calculation_line_item.rb
|
|
153
|
+
- lib/stripe/resources/tax/form.rb
|
|
154
|
+
- lib/stripe/resources/tax/registration.rb
|
|
137
155
|
- lib/stripe/resources/tax/settings.rb
|
|
138
156
|
- lib/stripe/resources/tax/transaction.rb
|
|
139
157
|
- lib/stripe/resources/tax/transaction_line_item.rb
|
|
@@ -182,7 +200,7 @@ metadata:
|
|
|
182
200
|
github_repo: ssh://github.com/stripe/stripe-ruby
|
|
183
201
|
homepage_uri: https://stripe.com/docs/api?lang=ruby
|
|
184
202
|
source_code_uri: https://github.com/stripe/stripe-ruby
|
|
185
|
-
post_install_message:
|
|
203
|
+
post_install_message:
|
|
186
204
|
rdoc_options: []
|
|
187
205
|
require_paths:
|
|
188
206
|
- lib
|
|
@@ -193,12 +211,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
193
211
|
version: 2.3.0
|
|
194
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
213
|
requirements:
|
|
196
|
-
- - "
|
|
214
|
+
- - ">"
|
|
197
215
|
- !ruby/object:Gem::Version
|
|
198
|
-
version:
|
|
216
|
+
version: 1.3.1
|
|
199
217
|
requirements: []
|
|
200
|
-
rubygems_version: 3.3.
|
|
201
|
-
signing_key:
|
|
218
|
+
rubygems_version: 3.3.26
|
|
219
|
+
signing_key:
|
|
202
220
|
specification_version: 4
|
|
203
221
|
summary: Ruby bindings for the Stripe API
|
|
204
222
|
test_files: []
|