stripe 19.1.0 → 19.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_requestor.rb +3 -0
  3. data/lib/stripe/api_version.rb +1 -1
  4. data/lib/stripe/event_types.rb +16 -0
  5. data/lib/stripe/events/v2_commerce_product_catalog_imports_failed_event.rb +44 -0
  6. data/lib/stripe/events/v2_commerce_product_catalog_imports_processing_event.rb +44 -0
  7. data/lib/stripe/events/v2_commerce_product_catalog_imports_succeeded_event.rb +44 -0
  8. data/lib/stripe/events/v2_commerce_product_catalog_imports_succeeded_with_errors_event.rb +44 -0
  9. data/lib/stripe/object_types.rb +1 -0
  10. data/lib/stripe/params/account_create_params.rb +26 -0
  11. data/lib/stripe/params/account_update_params.rb +26 -0
  12. data/lib/stripe/params/balance_settings_update_params.rb +42 -2
  13. data/lib/stripe/params/charge_create_params.rb +4 -1
  14. data/lib/stripe/params/checkout/session_create_params.rb +28 -15
  15. data/lib/stripe/params/confirmation_token_create_params.rb +11 -1
  16. data/lib/stripe/params/invoice_create_preview_params.rb +60 -0
  17. data/lib/stripe/params/payment_intent_capture_params.rb +2 -2
  18. data/lib/stripe/params/payment_intent_confirm_params.rb +38 -5
  19. data/lib/stripe/params/payment_intent_create_params.rb +65 -6
  20. data/lib/stripe/params/payment_intent_increment_authorization_params.rb +2 -2
  21. data/lib/stripe/params/payment_intent_update_params.rb +58 -5
  22. data/lib/stripe/params/payment_link_create_params.rb +30 -1
  23. data/lib/stripe/params/payment_link_update_params.rb +29 -0
  24. data/lib/stripe/params/payment_method_configuration_create_params.rb +43 -1
  25. data/lib/stripe/params/payment_method_configuration_list_params.rb +4 -0
  26. data/lib/stripe/params/payment_method_configuration_update_params.rb +43 -1
  27. data/lib/stripe/params/payment_method_create_params.rb +11 -1
  28. data/lib/stripe/params/payout_create_params.rb +1 -1
  29. data/lib/stripe/params/setup_intent_confirm_params.rb +18 -2
  30. data/lib/stripe/params/setup_intent_create_params.rb +18 -2
  31. data/lib/stripe/params/setup_intent_update_params.rb +18 -2
  32. data/lib/stripe/params/subscription_create_params.rb +61 -11
  33. data/lib/stripe/params/subscription_item_create_params.rb +1 -7
  34. data/lib/stripe/params/subscription_item_delete_params.rb +1 -7
  35. data/lib/stripe/params/subscription_item_update_params.rb +1 -7
  36. data/lib/stripe/params/subscription_schedule_create_params.rb +4 -0
  37. data/lib/stripe/params/subscription_schedule_update_params.rb +4 -0
  38. data/lib/stripe/params/subscription_update_params.rb +62 -8
  39. data/lib/stripe/params/terminal/configuration_create_params.rb +52 -0
  40. data/lib/stripe/params/terminal/configuration_update_params.rb +52 -0
  41. data/lib/stripe/params/test_helpers/confirmation_token_create_params.rb +11 -1
  42. data/lib/stripe/params/test_helpers/test_clock_create_params.rb +4 -1
  43. data/lib/stripe/params/v2/billing/meter_event_adjustment_create_params.rb +2 -2
  44. data/lib/stripe/params/v2/commerce/product_catalog/import_create_params.rb +25 -0
  45. data/lib/stripe/params/v2/commerce/product_catalog/import_list_params.rb +54 -0
  46. data/lib/stripe/params/v2/commerce/product_catalog/import_retrieve_params.rb +12 -0
  47. data/lib/stripe/params/v2/core/account_create_params.rb +28 -6
  48. data/lib/stripe/params/v2/core/account_token_create_params.rb +27 -5
  49. data/lib/stripe/params/v2/core/account_update_params.rb +29 -7
  50. data/lib/stripe/params/v2/core/event_destination_create_params.rb +23 -0
  51. data/lib/stripe/params.rb +1342 -614
  52. data/lib/stripe/railtie.rb +8 -0
  53. data/lib/stripe/resources/account.rb +4 -0
  54. data/lib/stripe/resources/balance_settings.rb +42 -2
  55. data/lib/stripe/resources/charge.rb +35 -0
  56. data/lib/stripe/resources/checkout/session.rb +23 -7
  57. data/lib/stripe/resources/confirmation_token.rb +26 -0
  58. data/lib/stripe/resources/discount.rb +2 -2
  59. data/lib/stripe/resources/invoice.rb +2 -0
  60. data/lib/stripe/resources/invoice_item.rb +34 -1
  61. data/lib/stripe/resources/issuing/dispute.rb +1 -1
  62. data/lib/stripe/resources/issuing/personalization_design.rb +1 -1
  63. data/lib/stripe/resources/mandate.rb +13 -0
  64. data/lib/stripe/resources/payment_attempt_record.rb +40 -10
  65. data/lib/stripe/resources/payment_intent.rb +71 -5
  66. data/lib/stripe/resources/payment_link.rb +40 -0
  67. data/lib/stripe/resources/payment_method.rb +26 -0
  68. data/lib/stripe/resources/payment_method_configuration.rb +68 -0
  69. data/lib/stripe/resources/payment_record.rb +40 -10
  70. data/lib/stripe/resources/radar/payment_evaluation.rb +1 -1
  71. data/lib/stripe/resources/refund.rb +13 -0
  72. data/lib/stripe/resources/setup_attempt.rb +13 -0
  73. data/lib/stripe/resources/setup_intent.rb +26 -0
  74. data/lib/stripe/resources/subscription.rb +77 -4
  75. data/lib/stripe/resources/subscription_item.rb +2 -0
  76. data/lib/stripe/resources/subscription_schedule.rb +2 -0
  77. data/lib/stripe/resources/terminal/configuration.rb +64 -0
  78. data/lib/stripe/resources/terminal/reader.rb +116 -0
  79. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +3 -3
  80. data/lib/stripe/resources/v2/billing/meter_event_session.rb +3 -3
  81. data/lib/stripe/resources/v2/commerce/product_catalog_import.rb +274 -0
  82. data/lib/stripe/resources/v2/core/account.rb +37 -10
  83. data/lib/stripe/resources/v2/core/account_token.rb +1 -1
  84. data/lib/stripe/resources/v2/core/event.rb +1 -0
  85. data/lib/stripe/resources/v2/core/event_destination.rb +24 -0
  86. data/lib/stripe/resources.rb +500 -178
  87. data/lib/stripe/services/payment_intent_service.rb +3 -1
  88. data/lib/stripe/services/subscription_service.rb +2 -2
  89. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -1
  90. data/lib/stripe/services/v2/commerce/product_catalog/import_service.rb +45 -0
  91. data/lib/stripe/services/v2/commerce/product_catalog_service.rb +17 -0
  92. data/lib/stripe/services/v2/commerce_service.rb +15 -0
  93. data/lib/stripe/services/v2/core/account_service.rb +1 -1
  94. data/lib/stripe/services/v2/core/account_token_service.rb +5 -1
  95. data/lib/stripe/services/v2/core/accounts/person_token_service.rb +2 -1
  96. data/lib/stripe/services/v2/core/event_service.rb +2 -1
  97. data/lib/stripe/services/v2_services.rb +2 -1
  98. data/lib/stripe/services.rb +469 -189
  99. data/lib/stripe/version.rb +1 -1
  100. data/lib/stripe.rb +25 -4
  101. data/rbi/stripe.rbi +2785 -253
  102. metadata +14 -2
@@ -134,7 +134,9 @@ module Stripe
134
134
  # Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
135
135
  # After it's captured, a PaymentIntent can no longer be incremented.
136
136
  #
137
- # Learn more about [incremental authorizations](https://docs.stripe.com/docs/terminal/features/incremental-authorizations).
137
+ # Learn more about incremental authorizations with
138
+ # [in-person payments](https://docs.stripe.com/docs/terminal/features/incremental-authorizations) and
139
+ # [online payments](https://docs.stripe.com/docs/payments/incremental-authorization?platform=web&ui=elements).
138
140
  def increment_authorization(intent, params = {}, opts = {})
139
141
  request(
140
142
  method: :post,
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Stripe
5
5
  class SubscriptionService < StripeService
6
- # Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata).
6
+ # Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details.
7
7
  #
8
8
  # Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true.
9
9
  #
@@ -70,7 +70,7 @@ module Stripe
70
70
  )
71
71
  end
72
72
 
73
- # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If no resumption invoice is generated, the subscription becomes active immediately. If a resumption invoice is generated, the subscription remains paused until the invoice is paid or marked uncollectible. If the invoice isn't paid by the expiration date, it is voided and the subscription remains paused. You can only resume subscriptions with collection_method set to charge_automatically. send_invoice subscriptions are not supported.
73
+ # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. Resume is only available for subscriptions that use charge_automatically collection. If Stripe doesn't generate a resumption invoice, the subscription becomes active immediately. When a resumption invoice is generated, Stripe finalizes it immediately. If the invoice is paid or marked uncollectible, the subscription becomes active. If the invoice is manually voided, the subscription stays paused. If there is no payment attempt within 23 hours, Stripe voids the invoice and the subscription stays paused. Learn more about [resuming subscriptions](https://docs.stripe.com/docs/billing/subscriptions/pause#resume-subscriptions).
74
74
  def resume(subscription, params = {}, opts = {})
75
75
  request(
76
76
  method: :post,
@@ -5,7 +5,7 @@ module Stripe
5
5
  module V2
6
6
  module Billing
7
7
  class MeterEventSessionService < StripeService
8
- # Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you will need to create a new meter event session when your token expires.
8
+ # Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you need to create a new meter event session when your token expires.
9
9
  def create(params = {}, opts = {})
10
10
  request(
11
11
  method: :post,
@@ -0,0 +1,45 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Commerce
7
+ module ProductCatalog
8
+ class ImportService < StripeService
9
+ # Creates a ProductCatalogImport.
10
+ def create(params = {}, opts = {})
11
+ request(
12
+ method: :post,
13
+ path: "/v2/commerce/product_catalog/imports",
14
+ params: params,
15
+ opts: opts,
16
+ base_address: :api
17
+ )
18
+ end
19
+
20
+ # Returns a list of ProductCatalogImport objects.
21
+ def list(params = {}, opts = {})
22
+ request(
23
+ method: :get,
24
+ path: "/v2/commerce/product_catalog/imports",
25
+ params: params,
26
+ opts: opts,
27
+ base_address: :api
28
+ )
29
+ end
30
+
31
+ # Retrieves a ProductCatalogImport by ID.
32
+ def retrieve(id, params = {}, opts = {})
33
+ request(
34
+ method: :get,
35
+ path: format("/v2/commerce/product_catalog/imports/%<id>s", { id: CGI.escape(id) }),
36
+ params: params,
37
+ opts: opts,
38
+ base_address: :api
39
+ )
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,17 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Commerce
7
+ class ProductCatalogService < StripeService
8
+ attr_reader :imports
9
+
10
+ def initialize(requestor)
11
+ super
12
+ @imports = Stripe::V2::Commerce::ProductCatalog::ImportService.new(@requestor)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ class CommerceService < StripeService
7
+ attr_reader :product_catalog
8
+
9
+ def initialize(requestor)
10
+ super
11
+ @product_catalog = Stripe::V2::Commerce::ProductCatalogService.new(@requestor)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -26,7 +26,7 @@ module Stripe
26
26
  )
27
27
  end
28
28
 
29
- # An Account is a representation of a company, individual or other entity that a user interacts with. Accounts contain identifying information about the entity, and configurations that store the features an account has access to. An account can be configured as any or all of the following configurations: Customer, Merchant and/or Recipient.
29
+ # Create an Account that represents a company, individual, or other entity that your business interacts with. Accounts contain identifying information about the entity, and configurations that store the features an account has access to. An account can be configured as any or all of the following configurations: Customer, Merchant and/or Recipient.
30
30
  #
31
31
  # ** raises RateLimitError
32
32
  def create(params = {}, opts = {})
@@ -5,7 +5,11 @@ module Stripe
5
5
  module V2
6
6
  module Core
7
7
  class AccountTokenService < StripeService
8
- # Creates an Account Token.
8
+ # Create an account token with a publishable key and pass it to the Accounts v2 API to
9
+ # create or update an account without its data touching your server.
10
+ # Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens).
11
+ # In live mode, you can only create account tokens with your application's publishable key.
12
+ # In test mode, you can create account tokens with your secret key or publishable key.
9
13
  #
10
14
  # ** raises RateLimitError
11
15
  def create(params = {}, opts = {})
@@ -6,7 +6,8 @@ module Stripe
6
6
  module Core
7
7
  module Accounts
8
8
  class PersonTokenService < StripeService
9
- # Creates a Person Token associated with an Account.
9
+ # Creates a single-use token that represents the details for a person. Use this when you create or update persons associated with an Account v2. Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens).
10
+ # You can only create person tokens with your application's publishable key and in live mode. You can use your application's secret key to create person tokens only in test mode.
10
11
  #
11
12
  # ** raises RateLimitError
12
13
  def create(account_id, params = {}, opts = {})
@@ -16,7 +16,8 @@ module Stripe
16
16
  )
17
17
  end
18
18
 
19
- # Retrieves the details of an event.
19
+ # Retrieves the details of an event if it was created in the last 30 days. Supply the unique
20
+ # identifier of the event, which might have been delivered to your event destination.
20
21
  def retrieve(id, params = {}, opts = {})
21
22
  request(
22
23
  method: :get,
@@ -3,11 +3,12 @@
3
3
 
4
4
  module Stripe
5
5
  class V2Services < StripeService
6
- attr_reader :billing, :core
6
+ attr_reader :billing, :commerce, :core
7
7
 
8
8
  def initialize(requestor)
9
9
  super
10
10
  @billing = Stripe::V2::BillingService.new(@requestor)
11
+ @commerce = Stripe::V2::CommerceService.new(@requestor)
11
12
  @core = Stripe::V2::CoreService.new(@requestor)
12
13
  end
13
14
  end