stripe 19.4.0.pre.alpha.2 → 19.4.0.pre.alpha.3

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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_version.rb +1 -1
  3. data/lib/stripe/event_types.rb +15 -0
  4. data/lib/stripe/events/v2_billing_contract_activated_event.rb +44 -0
  5. data/lib/stripe/events/v2_billing_contract_canceled_event.rb +44 -0
  6. data/lib/stripe/events/v2_billing_contract_created_event.rb +44 -0
  7. data/lib/stripe/events/v2_billing_contract_ended_event.rb +44 -0
  8. data/lib/stripe/events/v2_billing_contract_updated_event.rb +44 -0
  9. data/lib/stripe/params/capital/financing_transaction_list_params.rb +2 -2
  10. data/lib/stripe/params/checkout/session_create_params.rb +1 -1
  11. data/lib/stripe/params/invoice_create_preview_params.rb +1 -1
  12. data/lib/stripe/params/payment_intent_confirm_params.rb +10 -1
  13. data/lib/stripe/params/payment_intent_create_params.rb +10 -1
  14. data/lib/stripe/params/payment_intent_update_params.rb +10 -1
  15. data/lib/stripe/params/promotion_code_create_params.rb +1 -1
  16. data/lib/stripe/params/promotion_code_update_params.rb +1 -1
  17. data/lib/stripe/params/subscription_schedule_create_params.rb +2 -2
  18. data/lib/stripe/params/subscription_schedule_list_params.rb +1 -1
  19. data/lib/stripe/params/subscription_schedule_update_params.rb +2 -2
  20. data/lib/stripe/params/terminal/reader_activate_gift_card_params.rb +35 -0
  21. data/lib/stripe/params/terminal/reader_cashout_gift_card_params.rb +21 -0
  22. data/lib/stripe/params/terminal/reader_check_gift_card_balance_params.rb +21 -0
  23. data/lib/stripe/params/terminal/reader_collect_payment_method_params.rb +4 -0
  24. data/lib/stripe/params/terminal/reader_process_payment_intent_params.rb +4 -0
  25. data/lib/stripe/params/terminal/reader_reload_gift_card_params.rb +27 -0
  26. data/lib/stripe/params/v2/billing/contract_cancel_params.rb +1 -1
  27. data/lib/stripe/params/v2/billing/contract_create_params.rb +13 -175
  28. data/lib/stripe/params/v2/billing/contract_list_params.rb +1 -1
  29. data/lib/stripe/params/v2/billing/contract_update_params.rb +48 -495
  30. data/lib/stripe/params/v2/core/account_list_params.rb +9 -1
  31. data/lib/stripe/params/v2/data/analytics/metric_query_create_params.rb +2 -2
  32. data/lib/stripe/params.rb +8 -0
  33. data/lib/stripe/resources/account.rb +55 -3
  34. data/lib/stripe/resources/bank_account.rb +2 -2
  35. data/lib/stripe/resources/billing/alert_recovered.rb +17 -1
  36. data/lib/stripe/resources/capability.rb +2 -2
  37. data/lib/stripe/resources/capital/financing_transaction.rb +1 -1
  38. data/lib/stripe/resources/charge.rb +1 -1
  39. data/lib/stripe/resources/checkout/session.rb +21 -3
  40. data/lib/stripe/resources/confirmation_token.rb +1 -1
  41. data/lib/stripe/resources/dispute.rb +4 -2
  42. data/lib/stripe/resources/financial_connections/session.rb +2 -0
  43. data/lib/stripe/resources/invoice.rb +3 -0
  44. data/lib/stripe/resources/issuing/authorization.rb +52 -1
  45. data/lib/stripe/resources/issuing/transaction.rb +47 -1
  46. data/lib/stripe/resources/payment_attempt_record.rb +2 -2
  47. data/lib/stripe/resources/payment_intent.rb +28 -0
  48. data/lib/stripe/resources/payment_method.rb +1 -1
  49. data/lib/stripe/resources/payment_record.rb +2 -2
  50. data/lib/stripe/resources/person.rb +2 -2
  51. data/lib/stripe/resources/quote.rb +22 -1
  52. data/lib/stripe/resources/quote_preview_invoice.rb +3 -0
  53. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +44 -2
  54. data/lib/stripe/resources/setup_attempt.rb +16 -0
  55. data/lib/stripe/resources/setup_intent.rb +3 -0
  56. data/lib/stripe/resources/shared_payment/granted_token.rb +1 -1
  57. data/lib/stripe/resources/subscription_schedule.rb +44 -2
  58. data/lib/stripe/resources/tax/registration.rb +32 -0
  59. data/lib/stripe/resources/terminal/reader.rb +173 -0
  60. data/lib/stripe/resources/v2/billing/contract.rb +47 -330
  61. data/lib/stripe/resources/v2/billing/contract_pricing_line_quantity_change.rb +2 -2
  62. data/lib/stripe/resources/v2/core/account.rb +18 -0
  63. data/lib/stripe/resources/v2/money_management/payout_method.rb +16 -0
  64. data/lib/stripe/resources/v2/money_management/received_credit.rb +30 -0
  65. data/lib/stripe/resources.rb +15 -0
  66. data/lib/stripe/services/account_service.rb +1 -1
  67. data/lib/stripe/services/dispute_service.rb +1 -1
  68. data/lib/stripe/services/terminal/reader_service.rb +44 -0
  69. data/lib/stripe/services/v2/billing/contract_service.rb +7 -7
  70. data/lib/stripe/stripe_event_notification_handler.rb +30 -0
  71. data/lib/stripe/version.rb +1 -1
  72. data/rbi/stripe.rbi +1039 -1148
  73. metadata +11 -2
@@ -642,6 +642,16 @@ module Stripe
642
642
  autoload :V2BillingCadenceCanceledEventNotification, "stripe/events/v2_billing_cadence_canceled_event"
643
643
  autoload :V2BillingCadenceCreatedEvent, "stripe/events/v2_billing_cadence_created_event"
644
644
  autoload :V2BillingCadenceCreatedEventNotification, "stripe/events/v2_billing_cadence_created_event"
645
+ autoload :V2BillingContractActivatedEvent, "stripe/events/v2_billing_contract_activated_event"
646
+ autoload :V2BillingContractActivatedEventNotification, "stripe/events/v2_billing_contract_activated_event"
647
+ autoload :V2BillingContractCanceledEvent, "stripe/events/v2_billing_contract_canceled_event"
648
+ autoload :V2BillingContractCanceledEventNotification, "stripe/events/v2_billing_contract_canceled_event"
649
+ autoload :V2BillingContractCreatedEvent, "stripe/events/v2_billing_contract_created_event"
650
+ autoload :V2BillingContractCreatedEventNotification, "stripe/events/v2_billing_contract_created_event"
651
+ autoload :V2BillingContractEndedEvent, "stripe/events/v2_billing_contract_ended_event"
652
+ autoload :V2BillingContractEndedEventNotification, "stripe/events/v2_billing_contract_ended_event"
653
+ autoload :V2BillingContractUpdatedEvent, "stripe/events/v2_billing_contract_updated_event"
654
+ autoload :V2BillingContractUpdatedEventNotification, "stripe/events/v2_billing_contract_updated_event"
645
655
  autoload :V2BillingLicensedItemCreatedEvent, "stripe/events/v2_billing_licensed_item_created_event"
646
656
  autoload :V2BillingLicensedItemCreatedEventNotification, "stripe/events/v2_billing_licensed_item_created_event"
647
657
  autoload :V2BillingLicensedItemUpdatedEvent, "stripe/events/v2_billing_licensed_item_updated_event"
@@ -2074,6 +2084,11 @@ module Stripe
2074
2084
  stripe/events/v2_billing_cadence_billed_event
2075
2085
  stripe/events/v2_billing_cadence_canceled_event
2076
2086
  stripe/events/v2_billing_cadence_created_event
2087
+ stripe/events/v2_billing_contract_activated_event
2088
+ stripe/events/v2_billing_contract_canceled_event
2089
+ stripe/events/v2_billing_contract_created_event
2090
+ stripe/events/v2_billing_contract_ended_event
2091
+ stripe/events/v2_billing_contract_updated_event
2077
2092
  stripe/events/v2_billing_license_fee_created_event
2078
2093
  stripe/events/v2_billing_license_fee_updated_event
2079
2094
  stripe/events/v2_billing_license_fee_version_created_event
@@ -17,7 +17,7 @@ module Stripe
17
17
  # With [Connect](https://docs.stripe.com/docs/connect), you can create Stripe accounts for your users.
18
18
  # To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).
19
19
  #
20
- # If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/docs/connect/best-practices#onboarding) when
20
+ # If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/connect/marketplace/tasks/create#prefill-account-information) when
21
21
  # creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
22
22
  # You can prefill any information on the account.
23
23
  def create(params = {}, opts = {})
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Stripe
5
5
  class DisputeService < StripeService
6
- # Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost.
6
+ # Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost.
7
7
  #
8
8
  # The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible.
9
9
  def close(dispute, params = {}, opts = {})
@@ -4,6 +4,17 @@
4
4
  module Stripe
5
5
  module Terminal
6
6
  class ReaderService < StripeService
7
+ # Initiates a gift card activation flow on a Reader and optionally sets its balance.
8
+ def activate_gift_card(reader, params = {}, opts = {})
9
+ request(
10
+ method: :post,
11
+ path: format("/v1/terminal/readers/%<reader>s/activate_gift_card", { reader: CGI.escape(reader) }),
12
+ params: params,
13
+ opts: opts,
14
+ base_address: :api
15
+ )
16
+ end
17
+
7
18
  # Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details.
8
19
  def cancel_action(reader, params = {}, opts = {})
9
20
  request(
@@ -15,6 +26,28 @@ module Stripe
15
26
  )
16
27
  end
17
28
 
29
+ # Initiates a gift card cashout flow on a Reader. A cashout sets the gift card balance to 0.
30
+ def cashout_gift_card(reader, params = {}, opts = {})
31
+ request(
32
+ method: :post,
33
+ path: format("/v1/terminal/readers/%<reader>s/cashout_gift_card", { reader: CGI.escape(reader) }),
34
+ params: params,
35
+ opts: opts,
36
+ base_address: :api
37
+ )
38
+ end
39
+
40
+ # Initiates a gift card balance check flow on a Reader.
41
+ def check_gift_card_balance(reader, params = {}, opts = {})
42
+ request(
43
+ method: :post,
44
+ path: format("/v1/terminal/readers/%<reader>s/check_gift_card_balance", { reader: CGI.escape(reader) }),
45
+ params: params,
46
+ opts: opts,
47
+ base_address: :api
48
+ )
49
+ end
50
+
18
51
  # Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers.
19
52
  def collect_inputs(reader, params = {}, opts = {})
20
53
  request(
@@ -114,6 +147,17 @@ module Stripe
114
147
  )
115
148
  end
116
149
 
150
+ # Initiates a gift card reload flow on a Reader by adding the specified amount to its balance.
151
+ def reload_gift_card(reader, params = {}, opts = {})
152
+ request(
153
+ method: :post,
154
+ path: format("/v1/terminal/readers/%<reader>s/reload_gift_card", { reader: CGI.escape(reader) }),
155
+ params: params,
156
+ opts: opts,
157
+ base_address: :api
158
+ )
159
+ end
160
+
117
161
  # Retrieves a Reader object.
118
162
  def retrieve(reader, params = {}, opts = {})
119
163
  request(
@@ -12,7 +12,7 @@ module Stripe
12
12
  @pricing_lines = Stripe::V2::Billing::Contracts::PricingLinesService.new(@requestor)
13
13
  end
14
14
 
15
- # Activate a Draft Contract object by ID.
15
+ # Activate a draft contract.
16
16
  def activate(id, params = {}, opts = {})
17
17
  request(
18
18
  method: :post,
@@ -23,7 +23,7 @@ module Stripe
23
23
  )
24
24
  end
25
25
 
26
- # Cancel a Contract object by ID.
26
+ # Cancel an active contract.
27
27
  def cancel(id, params = {}, opts = {})
28
28
  request(
29
29
  method: :post,
@@ -34,7 +34,7 @@ module Stripe
34
34
  )
35
35
  end
36
36
 
37
- # Create a Contract object.
37
+ # Create a draft contract.
38
38
  def create(params = {}, opts = {})
39
39
  unless params.is_a?(Stripe::RequestParams)
40
40
  params = ::Stripe::V2::Billing::ContractCreateParams.coerce_params(params)
@@ -49,7 +49,7 @@ module Stripe
49
49
  )
50
50
  end
51
51
 
52
- # Delete a draft Contract object by ID.
52
+ # Delete a draft contract.
53
53
  def delete(id, params = {}, opts = {})
54
54
  request(
55
55
  method: :delete,
@@ -60,7 +60,7 @@ module Stripe
60
60
  )
61
61
  end
62
62
 
63
- # List Contract objects with pagination.
63
+ # List contracts.
64
64
  def list(params = {}, opts = {})
65
65
  request(
66
66
  method: :get,
@@ -71,7 +71,7 @@ module Stripe
71
71
  )
72
72
  end
73
73
 
74
- # Retrieve a Contract object by ID.
74
+ # Retrieve a contract.
75
75
  def retrieve(id, params = {}, opts = {})
76
76
  request(
77
77
  method: :get,
@@ -82,7 +82,7 @@ module Stripe
82
82
  )
83
83
  end
84
84
 
85
- # Update a Contract object by ID.
85
+ # Update a draft or active contract.
86
86
  def update(id, params = {}, opts = {})
87
87
  unless params.is_a?(Stripe::RequestParams)
88
88
  params = ::Stripe::V2::Billing::ContractUpdateParams.coerce_params(params)
@@ -1304,6 +1304,36 @@ module Stripe
1304
1304
  register("v2.billing.cadence.created", &handler)
1305
1305
  end
1306
1306
 
1307
+ def on_v2_billing_contract_activated(&handler)
1308
+ raise ArgumentError, "Block required to register event handler" if handler.nil?
1309
+
1310
+ register("v2.billing.contract.activated", &handler)
1311
+ end
1312
+
1313
+ def on_v2_billing_contract_canceled(&handler)
1314
+ raise ArgumentError, "Block required to register event handler" if handler.nil?
1315
+
1316
+ register("v2.billing.contract.canceled", &handler)
1317
+ end
1318
+
1319
+ def on_v2_billing_contract_created(&handler)
1320
+ raise ArgumentError, "Block required to register event handler" if handler.nil?
1321
+
1322
+ register("v2.billing.contract.created", &handler)
1323
+ end
1324
+
1325
+ def on_v2_billing_contract_ended(&handler)
1326
+ raise ArgumentError, "Block required to register event handler" if handler.nil?
1327
+
1328
+ register("v2.billing.contract.ended", &handler)
1329
+ end
1330
+
1331
+ def on_v2_billing_contract_updated(&handler)
1332
+ raise ArgumentError, "Block required to register event handler" if handler.nil?
1333
+
1334
+ register("v2.billing.contract.updated", &handler)
1335
+ end
1336
+
1307
1337
  def on_v2_billing_license_fee_created(&handler)
1308
1338
  raise ArgumentError, "Block required to register event handler" if handler.nil?
1309
1339
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "19.4.0-alpha.2"
4
+ VERSION = "19.4.0-alpha.3"
5
5
  end