stripe 15.5.0.pre.beta.2 → 15.6.0.pre.alpha.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.
Files changed (207) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +117 -1
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +6 -4
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_requestor.rb +20 -18
  8. data/lib/stripe/api_version.rb +1 -1
  9. data/lib/stripe/errors.rb +26 -23
  10. data/lib/stripe/event_types.rb +83 -0
  11. data/lib/stripe/events/v2_billing_cadence_billed_event.rb +21 -0
  12. data/lib/stripe/events/v2_billing_cadence_canceled_event.rb +21 -0
  13. data/lib/stripe/events/v2_billing_cadence_created_event.rb +23 -0
  14. data/lib/stripe/events/v2_billing_cadence_errored_event.rb +21 -0
  15. data/lib/stripe/events/v2_billing_license_fee_created_event.rb +21 -0
  16. data/lib/stripe/events/v2_billing_license_fee_updated_event.rb +21 -0
  17. data/lib/stripe/events/v2_billing_license_fee_version_created_event.rb +23 -0
  18. data/lib/stripe/events/v2_billing_licensed_item_created_event.rb +21 -0
  19. data/lib/stripe/events/v2_billing_licensed_item_updated_event.rb +21 -0
  20. data/lib/stripe/events/v2_billing_metered_item_created_event.rb +21 -0
  21. data/lib/stripe/events/v2_billing_metered_item_updated_event.rb +21 -0
  22. data/lib/stripe/events/v2_billing_pricing_plan_component_created_event.rb +23 -0
  23. data/lib/stripe/events/v2_billing_pricing_plan_component_updated_event.rb +23 -0
  24. data/lib/stripe/events/v2_billing_pricing_plan_created_event.rb +21 -0
  25. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_awaiting_customer_action_event.rb +21 -0
  26. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_current_event.rb +21 -0
  27. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_past_due_event.rb +21 -0
  28. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_paused_event.rb +21 -0
  29. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_unpaid_event.rb +21 -0
  30. data/lib/stripe/events/v2_billing_pricing_plan_subscription_servicing_activated_event.rb +21 -0
  31. data/lib/stripe/events/v2_billing_pricing_plan_subscription_servicing_canceled_event.rb +21 -0
  32. data/lib/stripe/events/v2_billing_pricing_plan_subscription_servicing_paused_event.rb +21 -0
  33. data/lib/stripe/events/v2_billing_pricing_plan_updated_event.rb +21 -0
  34. data/lib/stripe/events/v2_billing_pricing_plan_version_created_event.rb +23 -0
  35. data/lib/stripe/events/v2_billing_rate_card_created_event.rb +23 -0
  36. data/lib/stripe/events/v2_billing_rate_card_rate_created_event.rb +23 -0
  37. data/lib/stripe/events/v2_billing_rate_card_subscription_activated_event.rb +21 -0
  38. data/lib/stripe/events/v2_billing_rate_card_subscription_canceled_event.rb +21 -0
  39. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_awaiting_customer_action_event.rb +21 -0
  40. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_current_event.rb +21 -0
  41. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_past_due_event.rb +21 -0
  42. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_paused_event.rb +21 -0
  43. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_unpaid_event.rb +21 -0
  44. data/lib/stripe/events/v2_billing_rate_card_subscription_servicing_activated_event.rb +21 -0
  45. data/lib/stripe/events/v2_billing_rate_card_subscription_servicing_canceled_event.rb +21 -0
  46. data/lib/stripe/events/v2_billing_rate_card_subscription_servicing_paused_event.rb +21 -0
  47. data/lib/stripe/events/v2_billing_rate_card_updated_event.rb +21 -0
  48. data/lib/stripe/events/v2_billing_rate_card_version_created_event.rb +23 -0
  49. data/lib/stripe/events/v2_core_health_api_error_firing_event.rb +13 -0
  50. data/lib/stripe/events/v2_core_health_api_error_resolved_event.rb +13 -0
  51. data/lib/stripe/events/v2_core_health_api_latency_firing_event.rb +13 -0
  52. data/lib/stripe/events/v2_core_health_api_latency_resolved_event.rb +13 -0
  53. data/lib/stripe/events/v2_core_health_authorization_rate_drop_firing_event.rb +13 -0
  54. data/lib/stripe/events/v2_core_health_authorization_rate_drop_resolved_event.rb +13 -0
  55. data/lib/stripe/events/v2_core_health_event_generation_failure_resolved_event.rb +13 -0
  56. data/lib/stripe/events/v2_core_health_fraud_rate_increased_event.rb +13 -0
  57. data/lib/stripe/events/v2_core_health_issuing_authorization_request_timeout_firing_event.rb +13 -0
  58. data/lib/stripe/events/v2_core_health_issuing_authorization_request_timeout_resolved_event.rb +13 -0
  59. data/lib/stripe/events/v2_core_health_payment_method_error_firing_event.rb +13 -0
  60. data/lib/stripe/events/v2_core_health_payment_method_error_resolved_event.rb +13 -0
  61. data/lib/stripe/events/v2_core_health_traffic_volume_drop_firing_event.rb +13 -0
  62. data/lib/stripe/events/v2_core_health_traffic_volume_drop_resolved_event.rb +13 -0
  63. data/lib/stripe/events/v2_core_health_webhook_latency_firing_event.rb +13 -0
  64. data/lib/stripe/events/v2_core_health_webhook_latency_resolved_event.rb +13 -0
  65. data/lib/stripe/events/v2_reporting_report_run_created_event.rb +21 -0
  66. data/lib/stripe/events/v2_reporting_report_run_failed_event.rb +21 -0
  67. data/lib/stripe/events/v2_reporting_report_run_succeeded_event.rb +21 -0
  68. data/lib/stripe/events/v2_reporting_report_run_updated_event.rb +21 -0
  69. data/lib/stripe/object_types.rb +27 -0
  70. data/lib/stripe/resources/account.rb +2 -2
  71. data/lib/stripe/resources/account_session.rb +94 -13
  72. data/lib/stripe/resources/balance.rb +2 -7
  73. data/lib/stripe/resources/balance_settings.rb +72 -65
  74. data/lib/stripe/resources/billing/alert.rb +128 -1
  75. data/lib/stripe/resources/billing/alert_triggered.rb +6 -0
  76. data/lib/stripe/resources/billing/credit_balance_summary.rb +50 -0
  77. data/lib/stripe/resources/billing/credit_balance_transaction.rb +50 -0
  78. data/lib/stripe/resources/billing/credit_grant.rb +61 -2
  79. data/lib/stripe/resources/billing/meter.rb +2 -2
  80. data/lib/stripe/resources/billing/meter_usage_row.rb +1 -1
  81. data/lib/stripe/resources/billing_portal/configuration.rb +12 -2
  82. data/lib/stripe/resources/charge.rb +36 -5
  83. data/lib/stripe/resources/checkout/session.rb +237 -6
  84. data/lib/stripe/resources/credit_note.rb +3 -3
  85. data/lib/stripe/resources/dispute.rb +1 -1
  86. data/lib/stripe/resources/file.rb +1 -1
  87. data/lib/stripe/resources/file_link.rb +1 -1
  88. data/lib/stripe/resources/invoice.rb +55 -1
  89. data/lib/stripe/resources/invoice_item.rb +48 -0
  90. data/lib/stripe/resources/invoice_line_item.rb +52 -0
  91. data/lib/stripe/resources/invoice_payment.rb +1 -1
  92. data/lib/stripe/resources/mandate.rb +65 -1
  93. data/lib/stripe/resources/payment_attempt_record.rb +86 -10
  94. data/lib/stripe/resources/payment_intent.rb +182 -4
  95. data/lib/stripe/resources/payment_link.rb +1 -1
  96. data/lib/stripe/resources/payment_method.rb +2 -0
  97. data/lib/stripe/resources/payment_record.rb +107 -14
  98. data/lib/stripe/resources/promotion_code.rb +5 -2
  99. data/lib/stripe/resources/quote_preview_invoice.rb +8 -1
  100. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +24 -0
  101. data/lib/stripe/resources/setup_attempt.rb +4 -1
  102. data/lib/stripe/resources/setup_intent.rb +194 -1
  103. data/lib/stripe/resources/subscription.rb +145 -9
  104. data/lib/stripe/resources/subscription_schedule.rb +124 -2
  105. data/lib/stripe/resources/terminal/configuration.rb +82 -0
  106. data/lib/stripe/resources/terminal/reader.rb +22 -0
  107. data/lib/stripe/resources/v2/billing/bill_setting.rb +62 -0
  108. data/lib/stripe/resources/v2/billing/bill_setting_version.rb +50 -0
  109. data/lib/stripe/resources/v2/billing/cadence.rb +182 -0
  110. data/lib/stripe/resources/v2/billing/collection_setting.rb +148 -0
  111. data/lib/stripe/resources/v2/billing/collection_setting_version.rb +136 -0
  112. data/lib/stripe/resources/v2/billing/custom_pricing_unit.rb +35 -0
  113. data/lib/stripe/resources/v2/billing/intent.rb +59 -0
  114. data/lib/stripe/resources/v2/billing/intent_action.rb +200 -0
  115. data/lib/stripe/resources/v2/billing/license_fee.rb +79 -0
  116. data/lib/stripe/resources/v2/billing/license_fee_subscription.rb +36 -0
  117. data/lib/stripe/resources/v2/billing/license_fee_version.rb +56 -0
  118. data/lib/stripe/resources/v2/billing/licensed_item.rb +44 -0
  119. data/lib/stripe/resources/v2/billing/metered_item.rb +58 -0
  120. data/lib/stripe/resources/v2/billing/pricing_plan.rb +43 -0
  121. data/lib/stripe/resources/v2/billing/pricing_plan_component.rb +58 -0
  122. data/lib/stripe/resources/v2/billing/pricing_plan_subscription.rb +63 -0
  123. data/lib/stripe/resources/v2/billing/pricing_plan_version.rb +30 -0
  124. data/lib/stripe/resources/v2/billing/profile.rb +38 -0
  125. data/lib/stripe/resources/v2/billing/rate_card.rb +53 -0
  126. data/lib/stripe/resources/v2/billing/rate_card_rate.rb +71 -0
  127. data/lib/stripe/resources/v2/billing/rate_card_subscription.rb +63 -0
  128. data/lib/stripe/resources/v2/billing/rate_card_version.rb +26 -0
  129. data/lib/stripe/resources/v2/billing/service_action.rb +117 -0
  130. data/lib/stripe/resources/v2/core/account.rb +8 -0
  131. data/lib/stripe/resources/v2/core/claimable_sandbox.rb +57 -0
  132. data/lib/stripe/resources/v2/event.rb +2 -0
  133. data/lib/stripe/resources/v2/money_management/financial_account.rb +4 -2
  134. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +1 -1
  135. data/lib/stripe/resources/v2/money_management/transaction.rb +2 -0
  136. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +2 -0
  137. data/lib/stripe/resources/v2/reporting/report.rb +64 -0
  138. data/lib/stripe/resources/v2/reporting/report_run.rb +89 -0
  139. data/lib/stripe/resources/v2/tax/automatic_rule.rb +31 -0
  140. data/lib/stripe/resources.rb +85 -0
  141. data/lib/stripe/services/account_session_service.rb +64 -13
  142. data/lib/stripe/services/balance_settings_service.rb +44 -41
  143. data/lib/stripe/services/billing/alert_service.rb +75 -1
  144. data/lib/stripe/services/billing/credit_balance_summary_service.rb +13 -1
  145. data/lib/stripe/services/billing/credit_grant_service.rb +29 -2
  146. data/lib/stripe/services/billing/meter_service.rb +1 -1
  147. data/lib/stripe/services/billing_portal/configuration_service.rb +10 -2
  148. data/lib/stripe/services/checkout/session_service.rb +166 -5
  149. data/lib/stripe/services/credit_note_preview_lines_service.rb +1 -1
  150. data/lib/stripe/services/credit_note_service.rb +2 -2
  151. data/lib/stripe/services/customer_service.rb +4 -4
  152. data/lib/stripe/services/file_link_service.rb +1 -1
  153. data/lib/stripe/services/file_service.rb +1 -1
  154. data/lib/stripe/services/invoice_payment_service.rb +1 -1
  155. data/lib/stripe/services/invoice_service.rb +47 -0
  156. data/lib/stripe/services/mandate_service.rb +40 -0
  157. data/lib/stripe/services/payment_attempt_record_service.rb +4 -1
  158. data/lib/stripe/services/payment_intent_service.rb +157 -3
  159. data/lib/stripe/services/payment_link_service.rb +1 -1
  160. data/lib/stripe/services/payment_record_service.rb +25 -5
  161. data/lib/stripe/services/quote_service.rb +4 -4
  162. data/lib/stripe/services/setup_intent_service.rb +153 -0
  163. data/lib/stripe/services/subscription_schedule_service.rb +100 -2
  164. data/lib/stripe/services/subscription_service.rb +134 -9
  165. data/lib/stripe/services/terminal/configuration_service.rb +64 -0
  166. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +22 -0
  167. data/lib/stripe/services/v1_services.rb +5 -5
  168. data/lib/stripe/services/v2/billing/bill_setting_service.rb +214 -0
  169. data/lib/stripe/services/v2/billing/bill_settings/version_service.rb +45 -0
  170. data/lib/stripe/services/v2/billing/cadence_service.rb +428 -0
  171. data/lib/stripe/services/v2/billing/collection_setting_service.rb +518 -0
  172. data/lib/stripe/services/v2/billing/collection_settings/version_service.rb +45 -0
  173. data/lib/stripe/services/v2/billing/custom_pricing_unit_service.rb +108 -0
  174. data/lib/stripe/services/v2/billing/intent_service.rb +465 -0
  175. data/lib/stripe/services/v2/billing/intents/action_service.rb +45 -0
  176. data/lib/stripe/services/v2/billing/license_fee_service.rb +250 -0
  177. data/lib/stripe/services/v2/billing/license_fee_subscription_service.rb +23 -0
  178. data/lib/stripe/services/v2/billing/license_fees/version_service.rb +45 -0
  179. data/lib/stripe/services/v2/billing/licensed_item_service.rb +149 -0
  180. data/lib/stripe/services/v2/billing/metered_item_service.rb +176 -0
  181. data/lib/stripe/services/v2/billing/pricing_plan_service.rb +142 -0
  182. data/lib/stripe/services/v2/billing/pricing_plan_subscription_service.rb +76 -0
  183. data/lib/stripe/services/v2/billing/pricing_plans/component_service.rb +162 -0
  184. data/lib/stripe/services/v2/billing/pricing_plans/version_service.rb +45 -0
  185. data/lib/stripe/services/v2/billing/profile_service.rb +144 -0
  186. data/lib/stripe/services/v2/billing/rate_card_service.rb +151 -0
  187. data/lib/stripe/services/v2/billing/rate_card_subscription_service.rb +144 -0
  188. data/lib/stripe/services/v2/billing/rate_cards/rate_service.rb +161 -0
  189. data/lib/stripe/services/v2/billing/rate_cards/version_service.rb +45 -0
  190. data/lib/stripe/services/v2/billing/service_action_service.rb +259 -0
  191. data/lib/stripe/services/v2/billing_service.rb +19 -2
  192. data/lib/stripe/services/v2/core/account_service.rb +16 -2
  193. data/lib/stripe/services/v2/core/claimable_sandbox_service.rb +50 -0
  194. data/lib/stripe/services/v2/core_service.rb +4 -3
  195. data/lib/stripe/services/v2/money_management/financial_account_service.rb +4 -1
  196. data/lib/stripe/services/v2/money_management_service.rb +3 -3
  197. data/lib/stripe/services/v2/reporting/report_run_service.rb +88 -0
  198. data/lib/stripe/services/v2/reporting/report_service.rb +25 -0
  199. data/lib/stripe/services/v2/reporting_service.rb +16 -0
  200. data/lib/stripe/services/v2/tax/automatic_rule_service.rb +99 -0
  201. data/lib/stripe/services/v2/tax_service.rb +15 -0
  202. data/lib/stripe/services/v2_services.rb +3 -1
  203. data/lib/stripe/services.rb +29 -0
  204. data/lib/stripe/stripe_service.rb +3 -1
  205. data/lib/stripe/version.rb +1 -1
  206. metadata +116 -3
  207. data/rbi/stripe.rbi +0 -199145
@@ -7,6 +7,8 @@ module Stripe
7
7
  class ListParams < Stripe::RequestParams
8
8
  # Filter results to only include this type of alert.
9
9
  attr_accessor :alert_type
10
+ # Filter results to only include alerts for the given customer.
11
+ attr_accessor :customer
10
12
  # A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
11
13
  attr_accessor :ending_before
12
14
  # Specifies which fields in the response should be expanded.
@@ -20,6 +22,7 @@ module Stripe
20
22
 
21
23
  def initialize(
22
24
  alert_type: nil,
25
+ customer: nil,
23
26
  ending_before: nil,
24
27
  expand: nil,
25
28
  limit: nil,
@@ -27,6 +30,7 @@ module Stripe
27
30
  starting_after: nil
28
31
  )
29
32
  @alert_type = alert_type
33
+ @customer = customer
30
34
  @ending_before = ending_before
31
35
  @expand = expand
32
36
  @limit = limit
@@ -36,6 +40,67 @@ module Stripe
36
40
  end
37
41
 
38
42
  class CreateParams < Stripe::RequestParams
43
+ class CreditBalanceThreshold < Stripe::RequestParams
44
+ class Filter < Stripe::RequestParams
45
+ # Limit the scope to this credit balance alert only to this customer.
46
+ attr_accessor :customer
47
+ # What type of filter is being applied to this credit balance alert.
48
+ attr_accessor :type
49
+
50
+ def initialize(customer: nil, type: nil)
51
+ @customer = customer
52
+ @type = type
53
+ end
54
+ end
55
+
56
+ class Lte < Stripe::RequestParams
57
+ class CustomPricingUnit < Stripe::RequestParams
58
+ # The ID of the custom pricing unit.
59
+ attr_accessor :id
60
+ # A positive decimal string representing the amount of the custom pricing unit threshold.
61
+ attr_accessor :value
62
+
63
+ def initialize(id: nil, value: nil)
64
+ @id = id
65
+ @value = value
66
+ end
67
+ end
68
+
69
+ class Monetary < Stripe::RequestParams
70
+ # Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `value` parameter.
71
+ attr_accessor :currency
72
+ # An integer representing the amount of the threshold.
73
+ attr_accessor :value
74
+
75
+ def initialize(currency: nil, value: nil)
76
+ @currency = currency
77
+ @value = value
78
+ end
79
+ end
80
+ # Specify the type of this balance. We currently only support `monetary` billing credits.
81
+ attr_accessor :balance_type
82
+ # The custom pricing unit amount.
83
+ attr_accessor :custom_pricing_unit
84
+ # The monetary amount.
85
+ attr_accessor :monetary
86
+
87
+ def initialize(balance_type: nil, custom_pricing_unit: nil, monetary: nil)
88
+ @balance_type = balance_type
89
+ @custom_pricing_unit = custom_pricing_unit
90
+ @monetary = monetary
91
+ end
92
+ end
93
+ # The filters allows limiting the scope of this credit balance alert. You must specify a customer filter at this time.
94
+ attr_accessor :filters
95
+ # Defines at which value the alert will fire.
96
+ attr_accessor :lte
97
+
98
+ def initialize(filters: nil, lte: nil)
99
+ @filters = filters
100
+ @lte = lte
101
+ end
102
+ end
103
+
39
104
  class UsageThreshold < Stripe::RequestParams
40
105
  class Filter < Stripe::RequestParams
41
106
  # Limit the scope to this usage alert only to this customer.
@@ -66,6 +131,8 @@ module Stripe
66
131
  end
67
132
  # The type of alert to create.
68
133
  attr_accessor :alert_type
134
+ # The configuration of the credit balance threshold.
135
+ attr_accessor :credit_balance_threshold
69
136
  # Specifies which fields in the response should be expanded.
70
137
  attr_accessor :expand
71
138
  # The title of the alert.
@@ -73,8 +140,15 @@ module Stripe
73
140
  # The configuration of the usage threshold.
74
141
  attr_accessor :usage_threshold
75
142
 
76
- def initialize(alert_type: nil, expand: nil, title: nil, usage_threshold: nil)
143
+ def initialize(
144
+ alert_type: nil,
145
+ credit_balance_threshold: nil,
146
+ expand: nil,
147
+ title: nil,
148
+ usage_threshold: nil
149
+ )
77
150
  @alert_type = alert_type
151
+ @credit_balance_threshold = credit_balance_threshold
78
152
  @expand = expand
79
153
  @title = title
80
154
  @usage_threshold = usage_threshold
@@ -7,6 +7,15 @@ module Stripe
7
7
  class RetrieveParams < Stripe::RequestParams
8
8
  class Filter < Stripe::RequestParams
9
9
  class ApplicabilityScope < Stripe::RequestParams
10
+ class BillableItem < Stripe::RequestParams
11
+ # The billable item ID this credit grant should apply to.
12
+ attr_accessor :id
13
+
14
+ def initialize(id: nil)
15
+ @id = id
16
+ end
17
+ end
18
+
10
19
  class Price < Stripe::RequestParams
11
20
  # The price ID this credit grant should apply to.
12
21
  attr_accessor :id
@@ -15,12 +24,15 @@ module Stripe
15
24
  @id = id
16
25
  end
17
26
  end
27
+ # A list of billable items that the credit grant can apply to. We currently only support metered billable items. Cannot be used in combination with `price_type` or `prices`.
28
+ attr_accessor :billable_items
18
29
  # The price type that credit grants can apply to. We currently only support the `metered` price type. Cannot be used in combination with `prices`.
19
30
  attr_accessor :price_type
20
31
  # A list of prices that the credit grant can apply to. We currently only support the `metered` prices. Cannot be used in combination with `price_type`.
21
32
  attr_accessor :prices
22
33
 
23
- def initialize(price_type: nil, prices: nil)
34
+ def initialize(billable_items: nil, price_type: nil, prices: nil)
35
+ @billable_items = billable_items
24
36
  @price_type = price_type
25
37
  @prices = prices
26
38
  end
@@ -37,6 +37,18 @@ module Stripe
37
37
 
38
38
  class CreateParams < Stripe::RequestParams
39
39
  class Amount < Stripe::RequestParams
40
+ class CustomPricingUnit < Stripe::RequestParams
41
+ # The ID of the custom pricing unit.
42
+ attr_accessor :id
43
+ # A positive integer representing the amount of the credit grant.
44
+ attr_accessor :value
45
+
46
+ def initialize(id: nil, value: nil)
47
+ @id = id
48
+ @value = value
49
+ end
50
+ end
51
+
40
52
  class Monetary < Stripe::RequestParams
41
53
  # Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `value` parameter.
42
54
  attr_accessor :currency
@@ -48,12 +60,15 @@ module Stripe
48
60
  @value = value
49
61
  end
50
62
  end
63
+ # The custom pricing unit amount.
64
+ attr_accessor :custom_pricing_unit
51
65
  # The monetary amount.
52
66
  attr_accessor :monetary
53
67
  # The type of this amount. We currently only support `monetary` billing credits.
54
68
  attr_accessor :type
55
69
 
56
- def initialize(monetary: nil, type: nil)
70
+ def initialize(custom_pricing_unit: nil, monetary: nil, type: nil)
71
+ @custom_pricing_unit = custom_pricing_unit
57
72
  @monetary = monetary
58
73
  @type = type
59
74
  end
@@ -61,6 +76,15 @@ module Stripe
61
76
 
62
77
  class ApplicabilityConfig < Stripe::RequestParams
63
78
  class Scope < Stripe::RequestParams
79
+ class BillableItem < Stripe::RequestParams
80
+ # The billable item ID this credit grant should apply to.
81
+ attr_accessor :id
82
+
83
+ def initialize(id: nil)
84
+ @id = id
85
+ end
86
+ end
87
+
64
88
  class Price < Stripe::RequestParams
65
89
  # The price ID this credit grant should apply to.
66
90
  attr_accessor :id
@@ -69,12 +93,15 @@ module Stripe
69
93
  @id = id
70
94
  end
71
95
  end
96
+ # A list of billable items that the credit grant can apply to. We currently only support metered billable items. Cannot be used in combination with `price_type` or `prices`.
97
+ attr_accessor :billable_items
72
98
  # The price type that credit grants can apply to. We currently only support the `metered` price type. Cannot be used in combination with `prices`.
73
99
  attr_accessor :price_type
74
100
  # A list of prices that the credit grant can apply to. We currently only support the `metered` prices. Cannot be used in combination with `price_type`.
75
101
  attr_accessor :prices
76
102
 
77
- def initialize(price_type: nil, prices: nil)
103
+ def initialize(billable_items: nil, price_type: nil, prices: nil)
104
+ @billable_items = billable_items
78
105
  @price_type = price_type
79
106
  @prices = prices
80
107
  end
@@ -76,7 +76,7 @@ module Stripe
76
76
  attr_accessor :display_name
77
77
  # The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
78
78
  attr_accessor :event_name
79
- # The time window to pre-aggregate meter events for, if any.
79
+ # The time window which meter events have been pre-aggregated for, if any.
80
80
  attr_accessor :event_time_window
81
81
  # Specifies which fields in the response should be expanded.
82
82
  attr_accessor :expand
@@ -233,6 +233,8 @@ module Stripe
233
233
  attr_accessor :login_page
234
234
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
235
235
  attr_accessor :metadata
236
+ # The name of the configuration.
237
+ attr_accessor :name
236
238
 
237
239
  def initialize(
238
240
  business_profile: nil,
@@ -240,7 +242,8 @@ module Stripe
240
242
  expand: nil,
241
243
  features: nil,
242
244
  login_page: nil,
243
- metadata: nil
245
+ metadata: nil,
246
+ name: nil
244
247
  )
245
248
  @business_profile = business_profile
246
249
  @default_return_url = default_return_url
@@ -248,6 +251,7 @@ module Stripe
248
251
  @features = features
249
252
  @login_page = login_page
250
253
  @metadata = metadata
254
+ @name = name
251
255
  end
252
256
  end
253
257
 
@@ -462,6 +466,8 @@ module Stripe
462
466
  attr_accessor :login_page
463
467
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
464
468
  attr_accessor :metadata
469
+ # The name of the configuration.
470
+ attr_accessor :name
465
471
 
466
472
  def initialize(
467
473
  active: nil,
@@ -470,7 +476,8 @@ module Stripe
470
476
  expand: nil,
471
477
  features: nil,
472
478
  login_page: nil,
473
- metadata: nil
479
+ metadata: nil,
480
+ name: nil
474
481
  )
475
482
  @active = active
476
483
  @business_profile = business_profile
@@ -479,6 +486,7 @@ module Stripe
479
486
  @features = features
480
487
  @login_page = login_page
481
488
  @metadata = metadata
489
+ @name = name
482
490
  end
483
491
  end
484
492
 
@@ -94,7 +94,7 @@ module Stripe
94
94
 
95
95
  class CreateParams < Stripe::RequestParams
96
96
  class AdaptivePricing < Stripe::RequestParams
97
- # Set to `true` to enable [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing). Defaults to your [dashboard setting](https://dashboard.stripe.com/settings/adaptive-pricing).
97
+ # If set to `true`, Adaptive Pricing is available on [eligible sessions](https://docs.stripe.com/payments/currencies/localize-prices/adaptive-pricing?payment-ui=stripe-hosted#restrictions). Defaults to your [dashboard setting](https://dashboard.stripe.com/settings/adaptive-pricing).
98
98
  attr_accessor :enabled
99
99
 
100
100
  def initialize(enabled: nil)
@@ -149,6 +149,81 @@ module Stripe
149
149
  end
150
150
  end
151
151
 
152
+ class CheckoutItem < Stripe::RequestParams
153
+ class PricingPlanSubscriptionItem < Stripe::RequestParams
154
+ class ComponentConfigurations < Stripe::RequestParams
155
+ class LicenseFeeComponent < Stripe::RequestParams
156
+ # Attribute for param field quantity
157
+ attr_accessor :quantity
158
+
159
+ def initialize(quantity: nil)
160
+ @quantity = quantity
161
+ end
162
+ end
163
+ # Attribute for param field type
164
+ attr_accessor :type
165
+ # Attribute for param field license_fee_component
166
+ attr_accessor :license_fee_component
167
+
168
+ def initialize(type: nil, license_fee_component: nil)
169
+ @type = type
170
+ @license_fee_component = license_fee_component
171
+ end
172
+ end
173
+ # Attribute for param field pricing_plan
174
+ attr_accessor :pricing_plan
175
+ # Attribute for param field pricing_plan_version
176
+ attr_accessor :pricing_plan_version
177
+ # Attribute for param field metadata
178
+ attr_accessor :metadata
179
+ # Attribute for param field component_configurations
180
+ attr_accessor :component_configurations
181
+
182
+ def initialize(
183
+ pricing_plan: nil,
184
+ pricing_plan_version: nil,
185
+ metadata: nil,
186
+ component_configurations: nil
187
+ )
188
+ @pricing_plan = pricing_plan
189
+ @pricing_plan_version = pricing_plan_version
190
+ @metadata = metadata
191
+ @component_configurations = component_configurations
192
+ end
193
+ end
194
+
195
+ class RateCardSubscriptionItem < Stripe::RequestParams
196
+ # Attribute for param field rate_card
197
+ attr_accessor :rate_card
198
+ # Attribute for param field metadata
199
+ attr_accessor :metadata
200
+ # Attribute for param field rate_card_version
201
+ attr_accessor :rate_card_version
202
+
203
+ def initialize(rate_card: nil, metadata: nil, rate_card_version: nil)
204
+ @rate_card = rate_card
205
+ @metadata = metadata
206
+ @rate_card_version = rate_card_version
207
+ end
208
+ end
209
+ # Attribute for param field type
210
+ attr_accessor :type
211
+ # Attribute for param field rate_card_subscription_item
212
+ attr_accessor :rate_card_subscription_item
213
+ # Attribute for param field pricing_plan_subscription_item
214
+ attr_accessor :pricing_plan_subscription_item
215
+
216
+ def initialize(
217
+ type: nil,
218
+ rate_card_subscription_item: nil,
219
+ pricing_plan_subscription_item: nil
220
+ )
221
+ @type = type
222
+ @rate_card_subscription_item = rate_card_subscription_item
223
+ @pricing_plan_subscription_item = pricing_plan_subscription_item
224
+ end
225
+ end
226
+
152
227
  class ConsentCollection < Stripe::RequestParams
153
228
  class PaymentMethodReuseAgreement < Stripe::RequestParams
154
229
  # Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's
@@ -355,13 +430,46 @@ module Stripe
355
430
  end
356
431
 
357
432
  class Discount < Stripe::RequestParams
433
+ class CouponData < Stripe::RequestParams
434
+ # A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed).
435
+ attr_accessor :amount_off
436
+ # Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed).
437
+ attr_accessor :currency
438
+ # Specifies how long the discount will be in effect if used on a subscription. Defaults to `once`.
439
+ attr_accessor :duration
440
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
441
+ attr_accessor :metadata
442
+ # Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set.
443
+ attr_accessor :name
444
+ # A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amount_off` is not passed).
445
+ attr_accessor :percent_off
446
+
447
+ def initialize(
448
+ amount_off: nil,
449
+ currency: nil,
450
+ duration: nil,
451
+ metadata: nil,
452
+ name: nil,
453
+ percent_off: nil
454
+ )
455
+ @amount_off = amount_off
456
+ @currency = currency
457
+ @duration = duration
458
+ @metadata = metadata
459
+ @name = name
460
+ @percent_off = percent_off
461
+ end
462
+ end
358
463
  # The ID of the coupon to apply to this Session.
359
464
  attr_accessor :coupon
465
+ # Data used to generate a new [Coupon](https://stripe.com/docs/api/coupon) object inline. One of `coupon` or `coupon_data` is required when updating discounts.
466
+ attr_accessor :coupon_data
360
467
  # The ID of a promotion code to apply to this Session.
361
468
  attr_accessor :promotion_code
362
469
 
363
- def initialize(coupon: nil, promotion_code: nil)
470
+ def initialize(coupon: nil, coupon_data: nil, promotion_code: nil)
364
471
  @coupon = coupon
472
+ @coupon_data = coupon_data
365
473
  @promotion_code = promotion_code
366
474
  end
367
475
  end
@@ -1487,8 +1595,50 @@ module Stripe
1487
1595
  end
1488
1596
 
1489
1597
  class Pix < Stripe::RequestParams
1598
+ class MandateOptions < Stripe::RequestParams
1599
+ # Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000.
1600
+ attr_accessor :amount
1601
+ # Determines if the amount includes the IOF tax. Defaults to `never`.
1602
+ attr_accessor :amount_includes_iof
1603
+ # Type of amount. Defaults to `maximum`.
1604
+ attr_accessor :amount_type
1605
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Only `brl` is supported currently.
1606
+ attr_accessor :currency
1607
+ # Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
1608
+ attr_accessor :end_date
1609
+ # Schedule at which the future payments will be charged. Defaults to `weekly`.
1610
+ attr_accessor :payment_schedule
1611
+ # Subscription name displayed to buyers in their bank app. Defaults to the displayable business name.
1612
+ attr_accessor :reference
1613
+ # Start date of the mandate, in `YYYY-MM-DD`. Start date should be at least 3 days in the future. Defaults to 3 days after the current date.
1614
+ attr_accessor :start_date
1615
+
1616
+ def initialize(
1617
+ amount: nil,
1618
+ amount_includes_iof: nil,
1619
+ amount_type: nil,
1620
+ currency: nil,
1621
+ end_date: nil,
1622
+ payment_schedule: nil,
1623
+ reference: nil,
1624
+ start_date: nil
1625
+ )
1626
+ @amount = amount
1627
+ @amount_includes_iof = amount_includes_iof
1628
+ @amount_type = amount_type
1629
+ @currency = currency
1630
+ @end_date = end_date
1631
+ @payment_schedule = payment_schedule
1632
+ @reference = reference
1633
+ @start_date = start_date
1634
+ end
1635
+ end
1636
+ # Determines if the amount includes the IOF tax. Defaults to `never`.
1637
+ attr_accessor :amount_includes_iof
1490
1638
  # The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds.
1491
1639
  attr_accessor :expires_after_seconds
1640
+ # Additional fields for mandate creation.
1641
+ attr_accessor :mandate_options
1492
1642
  # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1493
1643
  #
1494
1644
  # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
@@ -1498,8 +1648,15 @@ module Stripe
1498
1648
  # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1499
1649
  attr_accessor :setup_future_usage
1500
1650
 
1501
- def initialize(expires_after_seconds: nil, setup_future_usage: nil)
1651
+ def initialize(
1652
+ amount_includes_iof: nil,
1653
+ expires_after_seconds: nil,
1654
+ mandate_options: nil,
1655
+ setup_future_usage: nil
1656
+ )
1657
+ @amount_includes_iof = amount_includes_iof
1502
1658
  @expires_after_seconds = expires_after_seconds
1659
+ @mandate_options = mandate_options
1503
1660
  @setup_future_usage = setup_future_usage
1504
1661
  end
1505
1662
  end
@@ -2252,7 +2409,7 @@ module Stripe
2252
2409
  #
2253
2410
  # For `subscription` mode, there is a maximum of 20 line items and optional items with recurring Prices and 20 line items and optional items with one-time Prices.
2254
2411
  attr_accessor :optional_items
2255
- # Where the user is coming from. This informs the optimizations that are applied to the session. For example, a session originating from a mobile app may behave more like a native app, depending on the platform. This parameter is currently not allowed if `ui_mode` is `custom`.
2412
+ # Where the user is coming from. This informs the optimizations that are applied to the session.
2256
2413
  attr_accessor :origin_context
2257
2414
  # A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.
2258
2415
  attr_accessor :payment_intent_data
@@ -2323,6 +2480,8 @@ module Stripe
2323
2480
  attr_accessor :ui_mode
2324
2481
  # Wallet-specific configuration.
2325
2482
  attr_accessor :wallet_options
2483
+ # Attribute for param field checkout_items
2484
+ attr_accessor :checkout_items
2326
2485
 
2327
2486
  def initialize(
2328
2487
  adaptive_pricing: nil,
@@ -2370,7 +2529,8 @@ module Stripe
2370
2529
  success_url: nil,
2371
2530
  tax_id_collection: nil,
2372
2531
  ui_mode: nil,
2373
- wallet_options: nil
2532
+ wallet_options: nil,
2533
+ checkout_items: nil
2374
2534
  )
2375
2535
  @adaptive_pricing = adaptive_pricing
2376
2536
  @after_expiration = after_expiration
@@ -2418,6 +2578,7 @@ module Stripe
2418
2578
  @tax_id_collection = tax_id_collection
2419
2579
  @ui_mode = ui_mode
2420
2580
  @wallet_options = wallet_options
2581
+ @checkout_items = checkout_items
2421
2582
  end
2422
2583
  end
2423
2584
 
@@ -64,7 +64,7 @@ module Stripe
64
64
  class Refund < Stripe::RequestParams
65
65
  # Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount.
66
66
  attr_accessor :amount_refunded
67
- # ID of an existing refund to link this credit note to.
67
+ # ID of an existing refund to link this credit note to. Required when `type` is `refund`.
68
68
  attr_accessor :refund
69
69
 
70
70
  def initialize(amount_refunded: nil, refund: nil)
@@ -128,7 +128,7 @@ module Stripe
128
128
  class Refund < Stripe::RequestParams
129
129
  # Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount.
130
130
  attr_accessor :amount_refunded
131
- # ID of an existing refund to link this credit note to.
131
+ # ID of an existing refund to link this credit note to. Required when `type` is `refund`.
132
132
  attr_accessor :refund
133
133
 
134
134
  def initialize(amount_refunded: nil, refund: nil)
@@ -292,7 +292,7 @@ module Stripe
292
292
  class Refund < Stripe::RequestParams
293
293
  # Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount.
294
294
  attr_accessor :amount_refunded
295
- # ID of an existing refund to link this credit note to.
295
+ # ID of an existing refund to link this credit note to. Required when `type` is `refund`.
296
296
  attr_accessor :refund
297
297
 
298
298
  def initialize(amount_refunded: nil, refund: nil)
@@ -3,17 +3,17 @@
3
3
 
4
4
  module Stripe
5
5
  class CustomerService < StripeService
6
- attr_reader :cash_balance, :balance_transactions, :cash_balance_transactions, :payment_sources, :tax_ids, :payment_methods, :funding_instructions
6
+ attr_reader :balance_transactions, :cash_balance, :cash_balance_transactions, :funding_instructions, :payment_methods, :payment_sources, :tax_ids
7
7
 
8
8
  def initialize(requestor)
9
9
  super
10
- @cash_balance = Stripe::CustomerCashBalanceService.new(@requestor)
11
10
  @balance_transactions = Stripe::CustomerBalanceTransactionService.new(@requestor)
11
+ @cash_balance = Stripe::CustomerCashBalanceService.new(@requestor)
12
12
  @cash_balance_transactions = Stripe::CustomerCashBalanceTransactionService.new(@requestor)
13
+ @funding_instructions = Stripe::CustomerFundingInstructionsService.new(@requestor)
14
+ @payment_methods = Stripe::CustomerPaymentMethodService.new(@requestor)
13
15
  @payment_sources = Stripe::CustomerPaymentSourceService.new(@requestor)
14
16
  @tax_ids = Stripe::CustomerTaxIdService.new(@requestor)
15
- @payment_methods = Stripe::CustomerPaymentMethodService.new(@requestor)
16
- @funding_instructions = Stripe::CustomerFundingInstructionsService.new(@requestor)
17
17
  end
18
18
 
19
19
  class DeleteParams < Stripe::RequestParams; end
@@ -60,7 +60,7 @@ module Stripe
60
60
  attr_accessor :expand
61
61
  # The link isn't usable after this future timestamp.
62
62
  attr_accessor :expires_at
63
- # The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `financial_account_statement`, `identity_document_downloadable`, `issuing_regulatory_reporting`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`.
63
+ # The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `financial_account_statement`, `identity_document_downloadable`, `issuing_regulatory_reporting`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, `terminal_android_apk`, or `terminal_reader_splashscreen`.
64
64
  attr_accessor :file
65
65
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
66
66
  attr_accessor :metadata
@@ -53,7 +53,7 @@ module Stripe
53
53
 
54
54
  class CreateParams < Stripe::RequestParams
55
55
  class FileLinkData < Stripe::RequestParams
56
- # Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `issuing_regulatory_reporting`, `pci_document`, `tax_document_user_upload`, or `terminal_reader_splashscreen`.
56
+ # Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `issuing_regulatory_reporting`, `pci_document`, `tax_document_user_upload`, `terminal_android_apk`, or `terminal_reader_splashscreen`.
57
57
  attr_accessor :create
58
58
  # The link isn't available after this future timestamp.
59
59
  attr_accessor :expires_at
@@ -7,7 +7,7 @@ module Stripe
7
7
  class Payment < Stripe::RequestParams
8
8
  # Only return invoice payments associated by this payment intent ID.
9
9
  attr_accessor :payment_intent
10
- # Attribute for param field payment_record
10
+ # Only return invoice payments associated by this payment record ID.
11
11
  attr_accessor :payment_record
12
12
  # Only return invoice payments associated by this payment type.
13
13
  attr_accessor :type