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
@@ -0,0 +1,142 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Billing
7
+ class PricingPlanService < StripeService
8
+ attr_reader :components, :versions
9
+
10
+ def initialize(requestor)
11
+ super
12
+ @components = Stripe::V2::Billing::PricingPlans::ComponentService.new(@requestor)
13
+ @versions = Stripe::V2::Billing::PricingPlans::VersionService.new(@requestor)
14
+ end
15
+
16
+ class ListParams < Stripe::RequestParams
17
+ # Filter for active/inactive PricingPlans. Mutually exclusive with `lookup_keys`.
18
+ attr_accessor :active
19
+ # Optionally set the maximum number of results per page. Defaults to 20.
20
+ attr_accessor :limit
21
+ # Filter by lookup keys. Mutually exclusive with `active`.
22
+ # You can specify up to 10 lookup keys.
23
+ attr_accessor :lookup_keys
24
+
25
+ def initialize(active: nil, limit: nil, lookup_keys: nil)
26
+ @active = active
27
+ @limit = limit
28
+ @lookup_keys = lookup_keys
29
+ end
30
+ end
31
+
32
+ class CreateParams < Stripe::RequestParams
33
+ # The currency of the PricingPlan.
34
+ attr_accessor :currency
35
+ # Description of pricing plan subscription.
36
+ attr_accessor :description
37
+ # Display name of the PricingPlan. Maximum 250 characters.
38
+ attr_accessor :display_name
39
+ # An internal key you can use to search for a particular PricingPlan. Maximum length of 200 characters.
40
+ attr_accessor :lookup_key
41
+ # Set of [key-value pairs](/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.
42
+ attr_accessor :metadata
43
+ # The Stripe Tax tax behavior - whether the PricingPlan is inclusive or exclusive of tax.
44
+ attr_accessor :tax_behavior
45
+
46
+ def initialize(
47
+ currency: nil,
48
+ description: nil,
49
+ display_name: nil,
50
+ lookup_key: nil,
51
+ metadata: nil,
52
+ tax_behavior: nil
53
+ )
54
+ @currency = currency
55
+ @description = description
56
+ @display_name = display_name
57
+ @lookup_key = lookup_key
58
+ @metadata = metadata
59
+ @tax_behavior = tax_behavior
60
+ end
61
+ end
62
+
63
+ class RetrieveParams < Stripe::RequestParams; end
64
+
65
+ class UpdateParams < Stripe::RequestParams
66
+ # Whether the PricingPlan is active.
67
+ attr_accessor :active
68
+ # Description of pricing plan subscription.
69
+ attr_accessor :description
70
+ # Display name of the PricingPlan. Maximum 250 characters.
71
+ attr_accessor :display_name
72
+ # The ID of the live version of the PricingPlan.
73
+ attr_accessor :live_version
74
+ # An internal key you can use to search for a particular PricingPlan. Maximum length of 200 characters.
75
+ attr_accessor :lookup_key
76
+ # Set of key-value pairs that you can attach to an object.
77
+ attr_accessor :metadata
78
+
79
+ def initialize(
80
+ active: nil,
81
+ description: nil,
82
+ display_name: nil,
83
+ live_version: nil,
84
+ lookup_key: nil,
85
+ metadata: nil
86
+ )
87
+ @active = active
88
+ @description = description
89
+ @display_name = display_name
90
+ @live_version = live_version
91
+ @lookup_key = lookup_key
92
+ @metadata = metadata
93
+ end
94
+ end
95
+
96
+ # Create a Pricing Plan object.
97
+ def create(params = {}, opts = {})
98
+ request(
99
+ method: :post,
100
+ path: "/v2/billing/pricing_plans",
101
+ params: params,
102
+ opts: opts,
103
+ base_address: :api
104
+ )
105
+ end
106
+
107
+ # List all Pricing Plan objects.
108
+ def list(params = {}, opts = {})
109
+ request(
110
+ method: :get,
111
+ path: "/v2/billing/pricing_plans",
112
+ params: params,
113
+ opts: opts,
114
+ base_address: :api
115
+ )
116
+ end
117
+
118
+ # Retrieve a Pricing Plan object.
119
+ def retrieve(id, params = {}, opts = {})
120
+ request(
121
+ method: :get,
122
+ path: format("/v2/billing/pricing_plans/%<id>s", { id: CGI.escape(id) }),
123
+ params: params,
124
+ opts: opts,
125
+ base_address: :api
126
+ )
127
+ end
128
+
129
+ # Update a Pricing Plan object.
130
+ def update(id, params = {}, opts = {})
131
+ request(
132
+ method: :post,
133
+ path: format("/v2/billing/pricing_plans/%<id>s", { id: CGI.escape(id) }),
134
+ params: params,
135
+ opts: opts,
136
+ base_address: :api
137
+ )
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
@@ -0,0 +1,76 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Billing
7
+ class PricingPlanSubscriptionService < StripeService
8
+ class ListParams < Stripe::RequestParams
9
+ class Payer < Stripe::RequestParams
10
+ # The ID of the Customer object. If provided, only Pricing Plan Subscriptions that are subscribed on the cadences with the specified payer will be returned.
11
+ attr_accessor :customer
12
+ # A string identifying the type of the payer. Currently the only supported value is `customer`.
13
+ attr_accessor :type
14
+
15
+ def initialize(customer: nil, type: nil)
16
+ @customer = customer
17
+ @type = type
18
+ end
19
+ end
20
+ # Filter by Billing Cadence ID. Mutually exclusive with `payer`, `pricing_plan`, and `pricing_plan_version`.
21
+ attr_accessor :billing_cadence
22
+ # Optionally set the maximum number of results per page. Defaults to 20.
23
+ attr_accessor :limit
24
+ # Filter by payer. Mutually exclusive with `billing_cadence`, `pricing_plan`, and `pricing_plan_version`.
25
+ attr_accessor :payer
26
+ # Filter by PricingPlan ID. Mutually exlcusive with `billing_cadence`, `payer`, and `pricing_plan_version`.
27
+ attr_accessor :pricing_plan
28
+ # Filter by Pricing Plan Version ID. Mutually exlcusive with `billing_cadence`, `payer`, and `pricing_plan`.
29
+ attr_accessor :pricing_plan_version
30
+ # Filter by servicing status.
31
+ attr_accessor :servicing_status
32
+
33
+ def initialize(
34
+ billing_cadence: nil,
35
+ limit: nil,
36
+ payer: nil,
37
+ pricing_plan: nil,
38
+ pricing_plan_version: nil,
39
+ servicing_status: nil
40
+ )
41
+ @billing_cadence = billing_cadence
42
+ @limit = limit
43
+ @payer = payer
44
+ @pricing_plan = pricing_plan
45
+ @pricing_plan_version = pricing_plan_version
46
+ @servicing_status = servicing_status
47
+ end
48
+ end
49
+
50
+ class RetrieveParams < Stripe::RequestParams; end
51
+
52
+ # List all Pricing Plan Subscription objects.
53
+ def list(params = {}, opts = {})
54
+ request(
55
+ method: :get,
56
+ path: "/v2/billing/pricing_plan_subscriptions",
57
+ params: params,
58
+ opts: opts,
59
+ base_address: :api
60
+ )
61
+ end
62
+
63
+ # Retrieve a Pricing Plan Subscription object.
64
+ def retrieve(id, params = {}, opts = {})
65
+ request(
66
+ method: :get,
67
+ path: format("/v2/billing/pricing_plan_subscriptions/%<id>s", { id: CGI.escape(id) }),
68
+ params: params,
69
+ opts: opts,
70
+ base_address: :api
71
+ )
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,162 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Billing
7
+ module PricingPlans
8
+ class ComponentService < StripeService
9
+ class ListParams < Stripe::RequestParams
10
+ # Optionally set the maximum number of results per page. Defaults to 20.
11
+ attr_accessor :limit
12
+ # Filter by lookup keys. Mutually exclusive with `pricing_plan_version`.
13
+ # You can specify up to 10 lookup keys.
14
+ attr_accessor :lookup_keys
15
+ # The ID of the Pricing Plan Version to list components for. Will use the latest version if not provided.
16
+ # Mutually exclusive with `lookup_keys`.
17
+ attr_accessor :pricing_plan_version
18
+
19
+ def initialize(limit: nil, lookup_keys: nil, pricing_plan_version: nil)
20
+ @limit = limit
21
+ @lookup_keys = lookup_keys
22
+ @pricing_plan_version = pricing_plan_version
23
+ end
24
+ end
25
+
26
+ class CreateParams < Stripe::RequestParams
27
+ class LicenseFee < Stripe::RequestParams
28
+ # The ID of the License Fee.
29
+ attr_accessor :id
30
+ # The version of the LicenseFee. Defaults to 'latest', if not specified.
31
+ attr_accessor :version
32
+
33
+ def initialize(id: nil, version: nil)
34
+ @id = id
35
+ @version = version
36
+ end
37
+ end
38
+
39
+ class RateCard < Stripe::RequestParams
40
+ # The ID of the Rate Card.
41
+ attr_accessor :id
42
+ # The version of the RateCard. Defaults to 'latest', if not specified.
43
+ attr_accessor :version
44
+
45
+ def initialize(id: nil, version: nil)
46
+ @id = id
47
+ @version = version
48
+ end
49
+ end
50
+
51
+ class ServiceAction < Stripe::RequestParams
52
+ # The ID of the service action.
53
+ attr_accessor :id
54
+
55
+ def initialize(id: nil)
56
+ @id = id
57
+ end
58
+ end
59
+ # An identifier that can be used to find this component.
60
+ attr_accessor :lookup_key
61
+ # Set of [key-value pairs](/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.
62
+ attr_accessor :metadata
63
+ # The type of the PricingPlanComponent.
64
+ attr_accessor :type
65
+ # Details if this component is a License Fee.
66
+ attr_accessor :license_fee
67
+ # Details if this component is a Rate Card.
68
+ attr_accessor :rate_card
69
+ # Details if this component is a Service Action.
70
+ attr_accessor :service_action
71
+
72
+ def initialize(
73
+ lookup_key: nil,
74
+ metadata: nil,
75
+ type: nil,
76
+ license_fee: nil,
77
+ rate_card: nil,
78
+ service_action: nil
79
+ )
80
+ @lookup_key = lookup_key
81
+ @metadata = metadata
82
+ @type = type
83
+ @license_fee = license_fee
84
+ @rate_card = rate_card
85
+ @service_action = service_action
86
+ end
87
+ end
88
+
89
+ class DeleteParams < Stripe::RequestParams; end
90
+ class RetrieveParams < Stripe::RequestParams; end
91
+
92
+ class UpdateParams < Stripe::RequestParams
93
+ # An identifier that can be used to find this component. Maximum length of 200 characters.
94
+ attr_accessor :lookup_key
95
+ # Set of key-value pairs that you can attach to an object.
96
+ attr_accessor :metadata
97
+
98
+ def initialize(lookup_key: nil, metadata: nil)
99
+ @lookup_key = lookup_key
100
+ @metadata = metadata
101
+ end
102
+ end
103
+
104
+ # Create a Pricing Plan Component object.
105
+ def create(pricing_plan_id, params = {}, opts = {})
106
+ request(
107
+ method: :post,
108
+ path: format("/v2/billing/pricing_plans/%<pricing_plan_id>s/components", { pricing_plan_id: CGI.escape(pricing_plan_id) }),
109
+ params: params,
110
+ opts: opts,
111
+ base_address: :api
112
+ )
113
+ end
114
+
115
+ # Remove a Pricing Plan Component from the latest version of a Pricing Plan.
116
+ def delete(pricing_plan_id, id, params = {}, opts = {})
117
+ request(
118
+ method: :delete,
119
+ path: format("/v2/billing/pricing_plans/%<pricing_plan_id>s/components/%<id>s", { pricing_plan_id: CGI.escape(pricing_plan_id), id: CGI.escape(id) }),
120
+ params: params,
121
+ opts: opts,
122
+ base_address: :api
123
+ )
124
+ end
125
+
126
+ # List all Pricing Plan Component objects for a Pricing Plan.
127
+ def list(pricing_plan_id, params = {}, opts = {})
128
+ request(
129
+ method: :get,
130
+ path: format("/v2/billing/pricing_plans/%<pricing_plan_id>s/components", { pricing_plan_id: CGI.escape(pricing_plan_id) }),
131
+ params: params,
132
+ opts: opts,
133
+ base_address: :api
134
+ )
135
+ end
136
+
137
+ # Retrieve a Pricing Plan Component object.
138
+ def retrieve(pricing_plan_id, id, params = {}, opts = {})
139
+ request(
140
+ method: :get,
141
+ path: format("/v2/billing/pricing_plans/%<pricing_plan_id>s/components/%<id>s", { pricing_plan_id: CGI.escape(pricing_plan_id), id: CGI.escape(id) }),
142
+ params: params,
143
+ opts: opts,
144
+ base_address: :api
145
+ )
146
+ end
147
+
148
+ # Update a Pricing Plan Component object.
149
+ def update(pricing_plan_id, id, params = {}, opts = {})
150
+ request(
151
+ method: :post,
152
+ path: format("/v2/billing/pricing_plans/%<pricing_plan_id>s/components/%<id>s", { pricing_plan_id: CGI.escape(pricing_plan_id), id: CGI.escape(id) }),
153
+ params: params,
154
+ opts: opts,
155
+ base_address: :api
156
+ )
157
+ end
158
+ end
159
+ end
160
+ end
161
+ end
162
+ end
@@ -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 Billing
7
+ module PricingPlans
8
+ class VersionService < StripeService
9
+ class ListParams < Stripe::RequestParams
10
+ # Optionally set the maximum number of results per page. Defaults to 20.
11
+ attr_accessor :limit
12
+
13
+ def initialize(limit: nil)
14
+ @limit = limit
15
+ end
16
+ end
17
+
18
+ class RetrieveParams < Stripe::RequestParams; end
19
+
20
+ # List all Pricing Plan Versions of a Pricing Plan.
21
+ def list(pricing_plan_id, params = {}, opts = {})
22
+ request(
23
+ method: :get,
24
+ path: format("/v2/billing/pricing_plans/%<pricing_plan_id>s/versions", { pricing_plan_id: CGI.escape(pricing_plan_id) }),
25
+ params: params,
26
+ opts: opts,
27
+ base_address: :api
28
+ )
29
+ end
30
+
31
+ # Retrieve a specific Pricing Plan Version of a Pricing Plan.
32
+ def retrieve(pricing_plan_id, id, params = {}, opts = {})
33
+ request(
34
+ method: :get,
35
+ path: format("/v2/billing/pricing_plans/%<pricing_plan_id>s/versions/%<id>s", { pricing_plan_id: CGI.escape(pricing_plan_id), 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,144 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Billing
7
+ class ProfileService < StripeService
8
+ class ListParams < Stripe::RequestParams
9
+ # Filter billing profiles by a customer. Mutually exclusive
10
+ # with `lookup_keys` and `default_payment_method`.
11
+ attr_accessor :customer
12
+ # Filter billing profiles by a default payment method. Mutually exclusive
13
+ # with `customer` and `lookup_keys`.
14
+ attr_accessor :default_payment_method
15
+ # Optionally set the maximum number of results per page. Defaults to 10.
16
+ attr_accessor :limit
17
+ # Filter billing profiles by lookup keys. Mutually exclusive
18
+ # with `customer` and `default_payment_method`.
19
+ # You can specify up to 10 lookup_keys.
20
+ attr_accessor :lookup_keys
21
+ # Filter billing profiles by status. Can be combined
22
+ # with all other filters. If not provided, all billing profiles will be returned.
23
+ attr_accessor :status
24
+
25
+ def initialize(
26
+ customer: nil,
27
+ default_payment_method: nil,
28
+ limit: nil,
29
+ lookup_keys: nil,
30
+ status: nil
31
+ )
32
+ @customer = customer
33
+ @default_payment_method = default_payment_method
34
+ @limit = limit
35
+ @lookup_keys = lookup_keys
36
+ @status = status
37
+ end
38
+ end
39
+
40
+ class CreateParams < Stripe::RequestParams
41
+ # The ID of the customer object.
42
+ attr_accessor :customer
43
+ # The ID of the payment method object.
44
+ attr_accessor :default_payment_method
45
+ # A customer-facing name for the billing profile.
46
+ # Maximum length of 250 characters.
47
+ attr_accessor :display_name
48
+ # An internal key you can use to search for a particular billing profile. It must be unique among billing profiles for a given customer.
49
+ # Maximum length of 200 characters.
50
+ attr_accessor :lookup_key
51
+ # Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
52
+ attr_accessor :metadata
53
+
54
+ def initialize(
55
+ customer: nil,
56
+ default_payment_method: nil,
57
+ display_name: nil,
58
+ lookup_key: nil,
59
+ metadata: nil
60
+ )
61
+ @customer = customer
62
+ @default_payment_method = default_payment_method
63
+ @display_name = display_name
64
+ @lookup_key = lookup_key
65
+ @metadata = metadata
66
+ end
67
+ end
68
+
69
+ class RetrieveParams < Stripe::RequestParams; end
70
+
71
+ class UpdateParams < Stripe::RequestParams
72
+ # The ID of the payment method object.
73
+ attr_accessor :default_payment_method
74
+ # A customer-facing name for the billing profile.
75
+ # Maximum length of 250 characters.
76
+ # To remove the display_name from the object, set it to null in the request.
77
+ attr_accessor :display_name
78
+ # An internal key you can use to search for a particular billing profile. It must be unique among billing profiles for a given customer.
79
+ # Maximum length of 200 characters.
80
+ # To remove the lookup_key from the object, set it to null in the request.
81
+ attr_accessor :lookup_key
82
+ # Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
83
+ attr_accessor :metadata
84
+
85
+ def initialize(
86
+ default_payment_method: nil,
87
+ display_name: nil,
88
+ lookup_key: nil,
89
+ metadata: nil
90
+ )
91
+ @default_payment_method = default_payment_method
92
+ @display_name = display_name
93
+ @lookup_key = lookup_key
94
+ @metadata = metadata
95
+ end
96
+ end
97
+
98
+ # Create a BillingProfile object.
99
+ def create(params = {}, opts = {})
100
+ request(
101
+ method: :post,
102
+ path: "/v2/billing/profiles",
103
+ params: params,
104
+ opts: opts,
105
+ base_address: :api
106
+ )
107
+ end
108
+
109
+ # List Billing Profiles.
110
+ def list(params = {}, opts = {})
111
+ request(
112
+ method: :get,
113
+ path: "/v2/billing/profiles",
114
+ params: params,
115
+ opts: opts,
116
+ base_address: :api
117
+ )
118
+ end
119
+
120
+ # Retrieve a BillingProfile object.
121
+ def retrieve(id, params = {}, opts = {})
122
+ request(
123
+ method: :get,
124
+ path: format("/v2/billing/profiles/%<id>s", { id: CGI.escape(id) }),
125
+ params: params,
126
+ opts: opts,
127
+ base_address: :api
128
+ )
129
+ end
130
+
131
+ # Update a BillingProfile object.
132
+ def update(id, params = {}, opts = {})
133
+ request(
134
+ method: :post,
135
+ path: format("/v2/billing/profiles/%<id>s", { id: CGI.escape(id) }),
136
+ params: params,
137
+ opts: opts,
138
+ base_address: :api
139
+ )
140
+ end
141
+ end
142
+ end
143
+ end
144
+ end