stripe 8.6.0.pre.beta.4 → 8.6.0.pre.beta.6

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: 8e7519c6f28a8327b6653a879c443e420d3939b228d3ce7e26d78fb5059d2508
4
- data.tar.gz: ec5c5dab4ae100c4266cb7f482edb7428498896412ef03a5879e2f53ce86010d
3
+ metadata.gz: 81d0ddbdb1d081579fb52860e1295326a1e3b9863e84ac8167146525320e7c59
4
+ data.tar.gz: 7145dd01065eae301d8ff96f547dee29893f7b7d5e922bd1ed1b6559f57e614e
5
5
  SHA512:
6
- metadata.gz: f96ccd66620b95fc1727bce8d8bab15b5749049e21aa5276f6733c596aea93ab66074d03df67c118ef07cb598f625655fbb513d2288b6a517b300f2fb215aaef
7
- data.tar.gz: 8163d80485ac0adc4797a52f22c832121cb690e0f7a07f35706be90bd2818be4ad3eb15bb464397defa9cca30b701f7c62d52ca8f48c6055eff3778bf29b4406
6
+ metadata.gz: 9be55e03a197319fcf3115c89e664119e8b1c271e163fc4ac91fe4088f9413cc0dbe9a411f7e4fc1c10b15d75cd9521889807236af044ed9b5c20b45a9272af6
7
+ data.tar.gz: 8951c0d63c7124b8c4b9c627e41bb1bc8b6fdc3e63d88d2fdc7faa917f0545a4b362c7886822ce6b817041a28d091e3b1ea5535bb92fa38cead45b6fe9753705
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.6.0-beta.6 - 2023-06-22
4
+ * [#1237](https://github.com/stripe/stripe-ruby/pull/1237) Update generated code for beta
5
+ * Add support for new resource `CustomerSession`
6
+ * Add support for `create` method on resource `CustomerSession`
7
+ * [#1233](https://github.com/stripe/stripe-ruby/pull/1233) Update generated code for beta
8
+ * [#1229](https://github.com/stripe/stripe-ruby/pull/1229) Update generated code for beta
9
+
10
+ ## 8.6.0-beta.5 - 2023-06-01
11
+ * [#1227](https://github.com/stripe/stripe-ruby/pull/1227) Update generated code for beta
12
+ * [#1228](https://github.com/stripe/stripe-ruby/pull/1228) Document raw_request
13
+ * [#1222](https://github.com/stripe/stripe-ruby/pull/1222) Update generated code for beta
14
+ * [#1224](https://github.com/stripe/stripe-ruby/pull/1224) Handle developer message in preview error responses
15
+
3
16
  ## 8.6.0-beta.4 - 2023-05-19
4
17
  * [#1220](https://github.com/stripe/stripe-ruby/pull/1220) Update generated code for beta
5
18
  * Add support for `subscribe` and `unsubscribe` methods on resource `FinancialConnections.Account`
data/Gemfile CHANGED
@@ -25,6 +25,9 @@ group :development do
25
25
  # up-to-date, but it's not the end of the world if it's not.
26
26
  gem "rubocop", "0.80"
27
27
 
28
+ # jaro_winkler 1.5.5 installation fails for jruby
29
+ gem "jaro_winkler", "1.5.4"
30
+
28
31
  platforms :mri do
29
32
  gem "byebug"
30
33
  gem "pry"
data/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v351
1
+ v392
data/README.md CHANGED
@@ -266,7 +266,7 @@ For example:
266
266
  ```ruby
267
267
  Stripe::Instrumentation.subscribe(:request_end) do |request_event|
268
268
  # Filter out high-cardinality ids from `path`
269
- path_parts = event.path.split("/").drop(2)
269
+ path_parts = request_event.path.split("/").drop(2)
270
270
  resource = path_parts.map { |part| part.match?(/\A[a-z_]+\z/) ? part : ":id" }.join("/")
271
271
 
272
272
  tags = {
@@ -323,6 +323,17 @@ If your beta feature requires a `Stripe-Version` header to be sent, use the `Str
323
323
  Stripe.api_version += "; feature_beta=v3"
324
324
  ```
325
325
 
326
+ ### Custom requests
327
+
328
+ If you would like to send a request to an undocumented API (for example you are in a private beta), or if you prefer to bypass the method definitions in the library and specify your request details directly, you can use the `raw_request` method on `Stripe`.
329
+
330
+ ```ruby
331
+ resp = Stripe.raw_request(:post, "/v1/beta_endpoint", {param: 123}, {stripe_version: "2022-11-15; feature_beta=v3"})
332
+
333
+ # (Optional) resp is a StripeResponse. You can use `Stripe.deserialize` to get a StripeObject.
334
+ deserialized_resp = Stripe.deserialize(resp.http_body)
335
+ ```
336
+
326
337
  ## Support
327
338
 
328
339
  New features and bug fixes are released on the latest major version of the Stripe Ruby library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 8.6.0-beta.4
1
+ 8.6.0-beta.6
@@ -4,6 +4,6 @@
4
4
  module Stripe
5
5
  module ApiVersion
6
6
  CURRENT = "2022-11-15"
7
- PREVIEW = "2023-05-16.preview-v2"
7
+ PREVIEW = "2023-06-08.preview-v2"
8
8
  end
9
9
  end
@@ -39,6 +39,7 @@ module Stripe
39
39
  Customer::OBJECT_NAME => Customer,
40
40
  CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction,
41
41
  CustomerCashBalanceTransaction::OBJECT_NAME => CustomerCashBalanceTransaction,
42
+ CustomerSession::OBJECT_NAME => CustomerSession,
42
43
  Discount::OBJECT_NAME => Discount,
43
44
  Dispute::OBJECT_NAME => Dispute,
44
45
  EphemeralKey::OBJECT_NAME => EphemeralKey,
@@ -2,11 +2,10 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
- # To charge a credit or a debit card, you create a `Charge` object. You can
6
- # retrieve and refund individual charges as well as list all charges. Charges
7
- # are identified by a unique, random ID.
8
- #
9
- # Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges)
5
+ # The `Charge` object represents a single attempt to move money into your Stripe account.
6
+ # PaymentIntent confirmation is the most common way to create Charges, but transferring
7
+ # money to a different Stripe account through Connect also creates Charges.
8
+ # Some legacy payment flows create Charges directly, which is not recommended for new integrations.
10
9
  class Charge < APIResource
11
10
  extend Stripe::APIOperations::Create
12
11
  extend Stripe::APIOperations::List
@@ -0,0 +1,12 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ # A customer session allows you to grant client access to Stripe's frontend SDKs (like BillingJs)
6
+ # control over a customer.
7
+ class CustomerSession < APIResource
8
+ extend Stripe::APIOperations::Create
9
+
10
+ OBJECT_NAME = "customer_session"
11
+ end
12
+ end
@@ -11,7 +11,7 @@ module Stripe
11
11
  # If your invoice is configured to be billed through automatic charges,
12
12
  # Stripe automatically finalizes your invoice and attempts payment. Note
13
13
  # that finalizing the invoice,
14
- # [when automatic](https://stripe.com/docs/billing/invoices/workflow/#auto_advance), does
14
+ # [when automatic](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection), does
15
15
  # not happen immediately as the invoice is created. Stripe waits
16
16
  # until one hour after the last webhook was successfully sent (or the last
17
17
  # webhook timed out after failing). If you (and the platforms you may have
@@ -2,6 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # Login Links are single-use login link for an Express account to access their Stripe dashboard.
5
6
  class LoginLink < APIResource
6
7
  OBJECT_NAME = "login_link"
7
8
 
@@ -10,11 +10,11 @@ module Stripe
10
10
  # Reversing a transfer that was made for a [destination
11
11
  # charge](https://stripe.com/docs/connect/destination-charges) is allowed only up to the amount of
12
12
  # the charge. It is possible to reverse a
13
- # [transfer_group](https://stripe.com/docs/connect/charges-transfers#transfer-options)
13
+ # [transfer_group](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options)
14
14
  # transfer only if the destination account has enough balance to cover the
15
15
  # reversal.
16
16
  #
17
- # Related guide: [Reversing transfers](https://stripe.com/docs/connect/charges-transfers#reversing-transfers)
17
+ # Related guide: [Reversing transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#reversing-transfers)
18
18
  class Reversal < APIResource
19
19
  extend Stripe::APIOperations::List
20
20
  include Stripe::APIOperations::Save
@@ -22,8 +22,6 @@ module Stripe
22
22
  # objects or [Custom accounts](https://stripe.com/docs/api#external_accounts). Note that
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
- #
26
- # Related guide: [Accept a payment with Charges and Tokens](https://stripe.com/docs/payments/accept-a-payment-charges#web-create-token)
27
25
  class Token < APIResource
28
26
  extend Stripe::APIOperations::Create
29
27
 
@@ -11,7 +11,7 @@ module Stripe
11
11
  # information, read about the
12
12
  # [transfer/payout split](https://stripe.com/docs/transfer-payout-split).
13
13
  #
14
- # Related guide: [Creating separate charges and transfers](https://stripe.com/docs/connect/charges-transfers)
14
+ # Related guide: [Creating separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers)
15
15
  class Transfer < APIResource
16
16
  extend Stripe::APIOperations::Create
17
17
  extend Stripe::APIOperations::List
@@ -28,6 +28,7 @@ require "stripe/resources/credit_note_line_item"
28
28
  require "stripe/resources/customer"
29
29
  require "stripe/resources/customer_balance_transaction"
30
30
  require "stripe/resources/customer_cash_balance_transaction"
31
+ require "stripe/resources/customer_session"
31
32
  require "stripe/resources/discount"
32
33
  require "stripe/resources/dispute"
33
34
  require "stripe/resources/ephemeral_key"
@@ -768,10 +768,11 @@ module Stripe
768
768
  end
769
769
 
770
770
  private def specific_api_error(resp, error_data, context)
771
+ message = error_data[:message] || error_data[:developer_message]
771
772
  Util.log_error("Stripe API error",
772
773
  status: resp.http_status,
773
774
  error_code: error_data[:code],
774
- error_message: error_data[:message],
775
+ error_message: message,
775
776
  error_param: error_data[:param],
776
777
  error_type: error_data[:type],
777
778
  idempotency_key: context.idempotency_key,
@@ -792,26 +793,26 @@ module Stripe
792
793
  when 400, 404
793
794
  case error_data[:type]
794
795
  when "idempotency_error"
795
- IdempotencyError.new(error_data[:message], **opts)
796
+ IdempotencyError.new(message, **opts)
796
797
  else
797
798
  InvalidRequestError.new(
798
- error_data[:message], error_data[:param],
799
+ message, error_data[:param],
799
800
  **opts
800
801
  )
801
802
  end
802
803
  when 401
803
- AuthenticationError.new(error_data[:message], **opts)
804
+ AuthenticationError.new(message, **opts)
804
805
  when 402
805
806
  CardError.new(
806
- error_data[:message], error_data[:param],
807
+ message, error_data[:param],
807
808
  **opts
808
809
  )
809
810
  when 403
810
- PermissionError.new(error_data[:message], **opts)
811
+ PermissionError.new(message, **opts)
811
812
  when 429
812
- RateLimitError.new(error_data[:message], **opts)
813
+ RateLimitError.new(message, **opts)
813
814
  else
814
- APIError.new(error_data[:message], **opts)
815
+ APIError.new(message, **opts)
815
816
  end
816
817
  end
817
818
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "8.6.0-beta.4"
4
+ VERSION = "8.6.0-beta.6"
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: 8.6.0.pre.beta.4
4
+ version: 8.6.0.pre.beta.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-19 00:00:00.000000000 Z
11
+ date: 2023-06-22 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.
@@ -80,6 +80,7 @@ files:
80
80
  - lib/stripe/resources/customer.rb
81
81
  - lib/stripe/resources/customer_balance_transaction.rb
82
82
  - lib/stripe/resources/customer_cash_balance_transaction.rb
83
+ - lib/stripe/resources/customer_session.rb
83
84
  - lib/stripe/resources/discount.rb
84
85
  - lib/stripe/resources/dispute.rb
85
86
  - lib/stripe/resources/ephemeral_key.rb