stripe 17.3.0.pre.alpha.1 → 17.3.0.pre.alpha.2

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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_version.rb +1 -1
  3. data/lib/stripe/object_types.rb +1 -1
  4. data/lib/stripe/params/account_create_params.rb +33 -1
  5. data/lib/stripe/params/account_person_create_params.rb +33 -1
  6. data/lib/stripe/params/account_person_update_params.rb +33 -1
  7. data/lib/stripe/params/account_update_params.rb +33 -1
  8. data/lib/stripe/params/capital/financing_offer_create_params.rb +5 -5
  9. data/lib/stripe/params/capital/financing_offer_refill_params.rb +5 -5
  10. data/lib/stripe/params/delegated_checkout/requested_session_create_params.rb +1 -1
  11. data/lib/stripe/params/delegated_checkout/requested_session_update_params.rb +1 -1
  12. data/lib/stripe/params/invoice_create_preview_params.rb +57 -1
  13. data/lib/stripe/params/issuing/program_create_params.rb +21 -0
  14. data/lib/stripe/params/issuing/program_list_params.rb +24 -0
  15. data/lib/stripe/params/issuing/program_retrieve_params.rb +15 -0
  16. data/lib/stripe/params/issuing/program_update_params.rb +21 -0
  17. data/lib/stripe/params/quote_create_params.rb +210 -2
  18. data/lib/stripe/params/quote_update_params.rb +210 -2
  19. data/lib/stripe/params/subscription_schedule_create_params.rb +62 -2
  20. data/lib/stripe/params/subscription_schedule_update_params.rb +62 -2
  21. data/lib/stripe/params/test_helpers/capital/financing_offer_create_params.rb +5 -5
  22. data/lib/stripe/params/test_helpers/capital/financing_offer_refill_params.rb +5 -5
  23. data/lib/stripe/params/token_create_params.rb +66 -2
  24. data/lib/stripe/params.rb +4 -5
  25. data/lib/stripe/resources/delegated_checkout/requested_session.rb +19 -1
  26. data/lib/stripe/resources/discount.rb +2 -0
  27. data/lib/stripe/resources/invoice.rb +16 -0
  28. data/lib/stripe/resources/invoice_item.rb +16 -0
  29. data/lib/stripe/resources/invoice_line_item.rb +16 -0
  30. data/lib/stripe/resources/issuing/program.rb +69 -0
  31. data/lib/stripe/resources/person.rb +36 -0
  32. data/lib/stripe/resources/quote.rb +348 -1
  33. data/lib/stripe/resources/quote_preview_invoice.rb +16 -0
  34. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +174 -0
  35. data/lib/stripe/resources/subscription.rb +105 -2
  36. data/lib/stripe/resources/subscription_schedule.rb +174 -0
  37. data/lib/stripe/resources.rb +1 -1
  38. data/lib/stripe/services/issuing/program_service.rb +52 -0
  39. data/lib/stripe/services/issuing_service.rb +2 -1
  40. data/lib/stripe/services/v2_services.rb +1 -2
  41. data/lib/stripe/services.rb +1 -2
  42. data/lib/stripe/version.rb +1 -1
  43. data/rbi/stripe.rbi +2356 -203
  44. metadata +8 -10
  45. data/lib/stripe/params/v2/tax/automatic_rule_create_params.rb +0 -20
  46. data/lib/stripe/params/v2/tax/automatic_rule_deactivate_params.rb +0 -10
  47. data/lib/stripe/params/v2/tax/automatic_rule_find_params.rb +0 -17
  48. data/lib/stripe/params/v2/tax/automatic_rule_retrieve_params.rb +0 -10
  49. data/lib/stripe/params/v2/tax/automatic_rule_update_params.rb +0 -17
  50. data/lib/stripe/resources/v2/tax/automatic_rule.rb +0 -39
  51. data/lib/stripe/services/v2/tax/automatic_rule_service.rb +0 -65
  52. data/lib/stripe/services/v2/tax_service.rb +0 -15
@@ -113,7 +113,87 @@ module Stripe
113
113
  end
114
114
  end
115
115
 
116
+ class BillFrom < ::Stripe::StripeObject
117
+ class AmendmentStart < ::Stripe::StripeObject
118
+ # Use an index to specify the position of an amendment to start prebilling with.
119
+ attr_reader :index
120
+
121
+ def self.inner_class_types
122
+ @inner_class_types = {}
123
+ end
124
+
125
+ def self.field_remappings
126
+ @field_remappings = {}
127
+ end
128
+ end
129
+
130
+ class LineStartsAt < ::Stripe::StripeObject
131
+ # Unique identifier for the object.
132
+ attr_reader :id
133
+
134
+ def self.inner_class_types
135
+ @inner_class_types = {}
136
+ end
137
+
138
+ def self.field_remappings
139
+ @field_remappings = {}
140
+ end
141
+ end
142
+
143
+ class Relative < ::Stripe::StripeObject
144
+ # Specifies billing duration. Possible values are `day`, `week`, `month`, or `year`.
145
+ attr_reader :interval
146
+ # The multiplier applied to the interval.
147
+ attr_reader :interval_count
148
+
149
+ def self.inner_class_types
150
+ @inner_class_types = {}
151
+ end
152
+
153
+ def self.field_remappings
154
+ @field_remappings = {}
155
+ end
156
+ end
157
+ # Use an index to specify the position of an amendment to start prebilling with.
158
+ attr_reader :amendment_start
159
+ # The time the billing schedule applies from.
160
+ attr_reader :computed_timestamp
161
+ # Lets you bill the period starting from a particular Quote line.
162
+ attr_reader :line_starts_at
163
+ # Timestamp is calculated from the request time.
164
+ attr_reader :relative
165
+ # Use a precise Unix timestamp for prebilling to start. Must be earlier than `bill_until`.
166
+ attr_reader :timestamp
167
+ # Describes how the billing schedule determines the start date. Possible values are `timestamp`, `relative`, `amendment_start`, `now`, `quote_acceptance_date`, `line_starts_at`, or `pause_collection_start`.
168
+ attr_reader :type
169
+
170
+ def self.inner_class_types
171
+ @inner_class_types = {
172
+ amendment_start: AmendmentStart,
173
+ line_starts_at: LineStartsAt,
174
+ relative: Relative,
175
+ }
176
+ end
177
+
178
+ def self.field_remappings
179
+ @field_remappings = {}
180
+ end
181
+ end
182
+
116
183
  class BillUntil < ::Stripe::StripeObject
184
+ class AmendmentEnd < ::Stripe::StripeObject
185
+ # Use an index to specify the position of an amendment to end prebilling with.
186
+ attr_reader :index
187
+
188
+ def self.inner_class_types
189
+ @inner_class_types = {}
190
+ end
191
+
192
+ def self.field_remappings
193
+ @field_remappings = {}
194
+ end
195
+ end
196
+
117
197
  class Duration < ::Stripe::StripeObject
118
198
  # Specifies billing duration. Either `day`, `week`, `month` or `year`.
119
199
  attr_reader :interval
@@ -128,6 +208,19 @@ module Stripe
128
208
  @field_remappings = {}
129
209
  end
130
210
  end
211
+
212
+ class LineEndsAt < ::Stripe::StripeObject
213
+ # Unique identifier for the object.
214
+ attr_reader :id
215
+
216
+ def self.inner_class_types
217
+ @inner_class_types = {}
218
+ end
219
+
220
+ def self.field_remappings
221
+ @field_remappings = {}
222
+ end
223
+ end
131
224
  # The timestamp the billing schedule will apply until.
132
225
  attr_reader :computed_timestamp
133
226
  # Specifies the billing period.
@@ -136,9 +229,17 @@ module Stripe
136
229
  attr_reader :timestamp
137
230
  # Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`.
138
231
  attr_reader :type
232
+ # Use an index to specify the position of an amendment to end prebilling with.
233
+ attr_reader :amendment_end
234
+ # Lets you bill the period ending at a particular Quote line.
235
+ attr_reader :line_ends_at
139
236
 
140
237
  def self.inner_class_types
141
- @inner_class_types = { duration: Duration }
238
+ @inner_class_types = {
239
+ duration: Duration,
240
+ amendment_end: AmendmentEnd,
241
+ line_ends_at: LineEndsAt,
242
+ }
142
243
  end
143
244
 
144
245
  def self.field_remappings
@@ -151,9 +252,11 @@ module Stripe
151
252
  attr_reader :bill_until
152
253
  # Unique identifier for the billing schedule.
153
254
  attr_reader :key
255
+ # Specifies the start of the billing period.
256
+ attr_reader :bill_from
154
257
 
155
258
  def self.inner_class_types
156
- @inner_class_types = { applies_to: AppliesTo, bill_until: BillUntil }
259
+ @inner_class_types = { applies_to: AppliesTo, bill_until: BillUntil, bill_from: BillFrom }
157
260
  end
158
261
 
159
262
  def self.field_remappings
@@ -171,6 +171,8 @@ module Stripe
171
171
  attr_reader :on_behalf_of
172
172
  # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
173
173
  attr_reader :transfer_data
174
+ # Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.
175
+ attr_reader :phase_effective_at
174
176
 
175
177
  def self.inner_class_types
176
178
  @inner_class_types = {
@@ -654,6 +656,173 @@ module Stripe
654
656
  @field_remappings = {}
655
657
  end
656
658
  end
659
+
660
+ class BillingSchedule < ::Stripe::StripeObject
661
+ class AppliesTo < ::Stripe::StripeObject
662
+ # The billing schedule will apply to the subscription item with the given price ID.
663
+ attr_reader :price
664
+ # Controls which subscription items the billing schedule applies to.
665
+ attr_reader :type
666
+
667
+ def self.inner_class_types
668
+ @inner_class_types = {}
669
+ end
670
+
671
+ def self.field_remappings
672
+ @field_remappings = {}
673
+ end
674
+ end
675
+
676
+ class BillFrom < ::Stripe::StripeObject
677
+ class AmendmentStart < ::Stripe::StripeObject
678
+ # Use an index to specify the position of an amendment to start prebilling with.
679
+ attr_reader :index
680
+
681
+ def self.inner_class_types
682
+ @inner_class_types = {}
683
+ end
684
+
685
+ def self.field_remappings
686
+ @field_remappings = {}
687
+ end
688
+ end
689
+
690
+ class LineStartsAt < ::Stripe::StripeObject
691
+ # Unique identifier for the object.
692
+ attr_reader :id
693
+
694
+ def self.inner_class_types
695
+ @inner_class_types = {}
696
+ end
697
+
698
+ def self.field_remappings
699
+ @field_remappings = {}
700
+ end
701
+ end
702
+
703
+ class Relative < ::Stripe::StripeObject
704
+ # Specifies billing duration. Possible values are `day`, `week`, `month`, or `year`.
705
+ attr_reader :interval
706
+ # The multiplier applied to the interval.
707
+ attr_reader :interval_count
708
+
709
+ def self.inner_class_types
710
+ @inner_class_types = {}
711
+ end
712
+
713
+ def self.field_remappings
714
+ @field_remappings = {}
715
+ end
716
+ end
717
+ # Use an index to specify the position of an amendment to start prebilling with.
718
+ attr_reader :amendment_start
719
+ # The time the billing schedule applies from.
720
+ attr_reader :computed_timestamp
721
+ # Lets you bill the period starting from a particular Quote line.
722
+ attr_reader :line_starts_at
723
+ # Timestamp is calculated from the request time.
724
+ attr_reader :relative
725
+ # Use a precise Unix timestamp for prebilling to start. Must be earlier than `bill_until`.
726
+ attr_reader :timestamp
727
+ # Describes how the billing schedule determines the start date. Possible values are `timestamp`, `relative`, `amendment_start`, `now`, `quote_acceptance_date`, `line_starts_at`, or `pause_collection_start`.
728
+ attr_reader :type
729
+
730
+ def self.inner_class_types
731
+ @inner_class_types = {
732
+ amendment_start: AmendmentStart,
733
+ line_starts_at: LineStartsAt,
734
+ relative: Relative,
735
+ }
736
+ end
737
+
738
+ def self.field_remappings
739
+ @field_remappings = {}
740
+ end
741
+ end
742
+
743
+ class BillUntil < ::Stripe::StripeObject
744
+ class AmendmentEnd < ::Stripe::StripeObject
745
+ # Use an index to specify the position of an amendment to end prebilling with.
746
+ attr_reader :index
747
+
748
+ def self.inner_class_types
749
+ @inner_class_types = {}
750
+ end
751
+
752
+ def self.field_remappings
753
+ @field_remappings = {}
754
+ end
755
+ end
756
+
757
+ class Duration < ::Stripe::StripeObject
758
+ # Specifies billing duration. Either `day`, `week`, `month` or `year`.
759
+ attr_reader :interval
760
+ # The multiplier applied to the interval.
761
+ attr_reader :interval_count
762
+
763
+ def self.inner_class_types
764
+ @inner_class_types = {}
765
+ end
766
+
767
+ def self.field_remappings
768
+ @field_remappings = {}
769
+ end
770
+ end
771
+
772
+ class LineEndsAt < ::Stripe::StripeObject
773
+ # Unique identifier for the object.
774
+ attr_reader :id
775
+
776
+ def self.inner_class_types
777
+ @inner_class_types = {}
778
+ end
779
+
780
+ def self.field_remappings
781
+ @field_remappings = {}
782
+ end
783
+ end
784
+ # The timestamp the billing schedule will apply until.
785
+ attr_reader :computed_timestamp
786
+ # Specifies the billing period.
787
+ attr_reader :duration
788
+ # If specified, the billing schedule will apply until the specified timestamp.
789
+ attr_reader :timestamp
790
+ # Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`.
791
+ attr_reader :type
792
+ # Use an index to specify the position of an amendment to end prebilling with.
793
+ attr_reader :amendment_end
794
+ # Lets you bill the period ending at a particular Quote line.
795
+ attr_reader :line_ends_at
796
+
797
+ def self.inner_class_types
798
+ @inner_class_types = {
799
+ duration: Duration,
800
+ amendment_end: AmendmentEnd,
801
+ line_ends_at: LineEndsAt,
802
+ }
803
+ end
804
+
805
+ def self.field_remappings
806
+ @field_remappings = {}
807
+ end
808
+ end
809
+ # Specifies which subscription items the billing schedule applies to.
810
+ attr_reader :applies_to
811
+ # Specifies the billing period.
812
+ attr_reader :bill_until
813
+ # Unique identifier for the billing schedule.
814
+ attr_reader :key
815
+ # Specifies the start of the billing period.
816
+ attr_reader :bill_from
817
+
818
+ def self.inner_class_types
819
+ @inner_class_types = { applies_to: AppliesTo, bill_until: BillUntil, bill_from: BillFrom }
820
+ end
821
+
822
+ def self.field_remappings
823
+ @field_remappings = {}
824
+ end
825
+ end
657
826
  # ID of the Connect Application that created the schedule.
658
827
  attr_reader :application
659
828
  # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
@@ -700,6 +869,10 @@ module Stripe
700
869
  attr_reader :subscription
701
870
  # ID of the test clock this subscription schedule belongs to.
702
871
  attr_reader :test_clock
872
+ # Billing schedules for this subscription schedule.
873
+ attr_reader :billing_schedules
874
+ # The most recent invoice this subscription schedule has generated.
875
+ attr_reader :latest_invoice
703
876
 
704
877
  # Amends an existing subscription schedule.
705
878
  def amend(params = {}, opts = {})
@@ -799,6 +972,7 @@ module Stripe
799
972
  last_price_migration_error: LastPriceMigrationError,
800
973
  phases: Phase,
801
974
  prebilling: Prebilling,
975
+ billing_schedules: BillingSchedule,
802
976
  }
803
977
  end
804
978
 
@@ -86,6 +86,7 @@ require "stripe/resources/issuing/dispute_settlement_detail"
86
86
  require "stripe/resources/issuing/fraud_liability_debit"
87
87
  require "stripe/resources/issuing/personalization_design"
88
88
  require "stripe/resources/issuing/physical_bundle"
89
+ require "stripe/resources/issuing/program"
89
90
  require "stripe/resources/issuing/settlement"
90
91
  require "stripe/resources/issuing/token"
91
92
  require "stripe/resources/issuing/transaction"
@@ -225,7 +226,6 @@ require "stripe/resources/v2/money_management/transaction_entry"
225
226
  require "stripe/resources/v2/payments/off_session_payment"
226
227
  require "stripe/resources/v2/reporting/report"
227
228
  require "stripe/resources/v2/reporting/report_run"
228
- require "stripe/resources/v2/tax/automatic_rule"
229
229
  require "stripe/resources/webhook_endpoint"
230
230
  require "stripe/events/v1_account_updated_event"
231
231
  require "stripe/events/v1_application_fee_created_event"
@@ -0,0 +1,52 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Issuing
6
+ class ProgramService < StripeService
7
+ # Create a Program object.
8
+ def create(params = {}, opts = {})
9
+ request(
10
+ method: :post,
11
+ path: "/v1/issuing/programs",
12
+ params: params,
13
+ opts: opts,
14
+ base_address: :api
15
+ )
16
+ end
17
+
18
+ # List all of the programs the given Issuing user has access to.
19
+ def list(params = {}, opts = {})
20
+ request(
21
+ method: :get,
22
+ path: "/v1/issuing/programs",
23
+ params: params,
24
+ opts: opts,
25
+ base_address: :api
26
+ )
27
+ end
28
+
29
+ # Retrieves the program specified by the given id.
30
+ def retrieve(program, params = {}, opts = {})
31
+ request(
32
+ method: :get,
33
+ path: format("/v1/issuing/programs/%<program>s", { program: CGI.escape(program) }),
34
+ params: params,
35
+ opts: opts,
36
+ base_address: :api
37
+ )
38
+ end
39
+
40
+ # Updates a Program object.
41
+ def update(program, params = {}, opts = {})
42
+ request(
43
+ method: :post,
44
+ path: format("/v1/issuing/programs/%<program>s", { program: CGI.escape(program) }),
45
+ params: params,
46
+ opts: opts,
47
+ base_address: :api
48
+ )
49
+ end
50
+ end
51
+ end
52
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Stripe
5
5
  class IssuingService < StripeService
6
- attr_reader :authorizations, :cards, :cardholders, :credit_underwriting_records, :disputes, :dispute_settlement_details, :fraud_liability_debits, :personalization_designs, :physical_bundles, :tokens, :transactions
6
+ attr_reader :authorizations, :cards, :cardholders, :credit_underwriting_records, :disputes, :dispute_settlement_details, :fraud_liability_debits, :personalization_designs, :physical_bundles, :programs, :tokens, :transactions
7
7
 
8
8
  def initialize(requestor)
9
9
  super
@@ -17,6 +17,7 @@ module Stripe
17
17
  @fraud_liability_debits = Stripe::Issuing::FraudLiabilityDebitService.new(@requestor)
18
18
  @personalization_designs = Stripe::Issuing::PersonalizationDesignService.new(@requestor)
19
19
  @physical_bundles = Stripe::Issuing::PhysicalBundleService.new(@requestor)
20
+ @programs = Stripe::Issuing::ProgramService.new(@requestor)
20
21
  @tokens = Stripe::Issuing::TokenService.new(@requestor)
21
22
  @transactions = Stripe::Issuing::TransactionService.new(@requestor)
22
23
  end
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Stripe
5
5
  class V2Services < StripeService
6
- attr_reader :billing, :core, :money_management, :payments, :reporting, :tax, :test_helpers
6
+ attr_reader :billing, :core, :money_management, :payments, :reporting, :test_helpers
7
7
 
8
8
  def initialize(requestor)
9
9
  super
@@ -12,7 +12,6 @@ module Stripe
12
12
  @money_management = Stripe::V2::MoneyManagementService.new(@requestor)
13
13
  @payments = Stripe::V2::PaymentService.new(@requestor)
14
14
  @reporting = Stripe::V2::ReportingService.new(@requestor)
15
- @tax = Stripe::V2::TaxService.new(@requestor)
16
15
  @test_helpers = Stripe::V2::TestHelperService.new(@requestor)
17
16
  end
18
17
  end
@@ -98,6 +98,7 @@ require "stripe/services/issuing/dispute_settlement_detail_service"
98
98
  require "stripe/services/issuing/fraud_liability_debit_service"
99
99
  require "stripe/services/issuing/personalization_design_service"
100
100
  require "stripe/services/issuing/physical_bundle_service"
101
+ require "stripe/services/issuing/program_service"
101
102
  require "stripe/services/issuing/token_service"
102
103
  require "stripe/services/issuing/transaction_service"
103
104
  require "stripe/services/issuing_service"
@@ -264,8 +265,6 @@ require "stripe/services/v2/payments/off_session_payment_service"
264
265
  require "stripe/services/v2/reporting/report_run_service"
265
266
  require "stripe/services/v2/reporting/report_service"
266
267
  require "stripe/services/v2/reporting_service"
267
- require "stripe/services/v2/tax/automatic_rule_service"
268
- require "stripe/services/v2/tax_service"
269
268
  require "stripe/services/v2/test_helper_service"
270
269
  require "stripe/services/v2/test_helpers/financial_address_service"
271
270
  require "stripe/services/v2/test_helpers/money_management_service"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "17.3.0-alpha.1"
4
+ VERSION = "17.3.0-alpha.2"
5
5
  end