stripe 13.2.0 → 13.3.0.pre.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1396 -645
  3. data/OPENAPI_VERSION +1 -1
  4. data/VERSION +1 -1
  5. data/lib/stripe/object_types.rb +32 -0
  6. data/lib/stripe/request_signing_authenticator.rb +79 -0
  7. data/lib/stripe/resources/account.rb +230 -0
  8. data/lib/stripe/resources/account_link.rb +9 -0
  9. data/lib/stripe/resources/account_notice.rb +60 -0
  10. data/lib/stripe/resources/account_session.rb +103 -0
  11. data/lib/stripe/resources/apple_pay_domain.rb +13 -0
  12. data/lib/stripe/resources/application.rb +20 -0
  13. data/lib/stripe/resources/application_fee.rb +34 -0
  14. data/lib/stripe/resources/application_fee_refund.rb +17 -0
  15. data/lib/stripe/resources/apps/secret.rb +22 -0
  16. data/lib/stripe/resources/balance.rb +59 -0
  17. data/lib/stripe/resources/balance_transaction.rb +34 -0
  18. data/lib/stripe/resources/bank_account.rb +60 -2
  19. data/lib/stripe/resources/billing/alert.rb +21 -0
  20. data/lib/stripe/resources/billing/alert_triggered.rb +26 -0
  21. data/lib/stripe/resources/billing/credit_balance_summary.rb +25 -0
  22. data/lib/stripe/resources/billing/credit_balance_transaction.rb +45 -1
  23. data/lib/stripe/resources/billing/credit_grant.rb +46 -2
  24. data/lib/stripe/resources/billing/meter.rb +49 -7
  25. data/lib/stripe/resources/billing/meter_error_report.rb +44 -0
  26. data/lib/stripe/resources/billing/meter_event.rb +17 -3
  27. data/lib/stripe/resources/billing/meter_event_adjustment.rb +17 -1
  28. data/lib/stripe/resources/billing/meter_event_summary.rb +15 -0
  29. data/lib/stripe/resources/billing_portal/configuration.rb +70 -0
  30. data/lib/stripe/resources/billing_portal/session.rb +61 -0
  31. data/lib/stripe/resources/capability.rb +38 -0
  32. data/lib/stripe/resources/capital/financing_offer.rb +94 -0
  33. data/lib/stripe/resources/capital/financing_summary.rb +32 -0
  34. data/lib/stripe/resources/capital/financing_transaction.rb +56 -0
  35. data/lib/stripe/resources/card.rb +72 -0
  36. data/lib/stripe/resources/cash_balance.rb +14 -0
  37. data/lib/stripe/resources/charge.rb +469 -0
  38. data/lib/stripe/resources/checkout/session.rb +496 -0
  39. data/lib/stripe/resources/climate/order.rb +55 -0
  40. data/lib/stripe/resources/climate/product.rb +24 -0
  41. data/lib/stripe/resources/climate/supplier.rb +18 -0
  42. data/lib/stripe/resources/confirmation_token.rb +297 -0
  43. data/lib/stripe/resources/connect_collection_transfer.rb +24 -0
  44. data/lib/stripe/resources/country_spec.rb +27 -0
  45. data/lib/stripe/resources/coupon.rb +44 -0
  46. data/lib/stripe/resources/credit_note.rb +91 -0
  47. data/lib/stripe/resources/credit_note_line_item.rb +46 -0
  48. data/lib/stripe/resources/customer.rb +93 -0
  49. data/lib/stripe/resources/customer_balance_transaction.rb +27 -0
  50. data/lib/stripe/resources/customer_cash_balance_transaction.rb +72 -0
  51. data/lib/stripe/resources/customer_session.rb +34 -0
  52. data/lib/stripe/resources/discount.rb +29 -0
  53. data/lib/stripe/resources/dispute.rb +88 -0
  54. data/lib/stripe/resources/entitlements/active_entitlement.rb +11 -0
  55. data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +23 -0
  56. data/lib/stripe/resources/entitlements/feature.rb +15 -0
  57. data/lib/stripe/resources/ephemeral_key.rb +13 -0
  58. data/lib/stripe/resources/event.rb +44 -0
  59. data/lib/stripe/resources/exchange_rate.rb +7 -0
  60. data/lib/stripe/resources/file.rb +23 -0
  61. data/lib/stripe/resources/file_link.rb +19 -0
  62. data/lib/stripe/resources/financial_connections/account.rb +87 -0
  63. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  64. data/lib/stripe/resources/financial_connections/account_owner.rb +17 -0
  65. data/lib/stripe/resources/financial_connections/account_ownership.rb +9 -0
  66. data/lib/stripe/resources/financial_connections/institution.rb +61 -0
  67. data/lib/stripe/resources/financial_connections/session.rb +49 -0
  68. data/lib/stripe/resources/financial_connections/transaction.rb +28 -0
  69. data/lib/stripe/resources/forwarding/request.rb +40 -0
  70. data/lib/stripe/resources/funding_instructions.rb +82 -0
  71. data/lib/stripe/resources/gift_cards/card.rb +96 -0
  72. data/lib/stripe/resources/gift_cards/transaction.rb +132 -0
  73. data/lib/stripe/resources/identity/verification_report.rb +92 -0
  74. data/lib/stripe/resources/identity/verification_session.rb +76 -0
  75. data/lib/stripe/resources/invoice.rb +418 -0
  76. data/lib/stripe/resources/invoice_item.rb +54 -0
  77. data/lib/stripe/resources/invoice_line_item.rb +83 -0
  78. data/lib/stripe/resources/invoice_payment.rb +46 -0
  79. data/lib/stripe/resources/invoice_rendering_template.rb +17 -0
  80. data/lib/stripe/resources/issuing/authorization.rb +129 -0
  81. data/lib/stripe/resources/issuing/card.rb +86 -0
  82. data/lib/stripe/resources/issuing/cardholder.rb +76 -0
  83. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +145 -0
  84. data/lib/stripe/resources/issuing/dispute.rb +65 -0
  85. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +49 -0
  86. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +43 -0
  87. data/lib/stripe/resources/issuing/personalization_design.rb +38 -0
  88. data/lib/stripe/resources/issuing/physical_bundle.rb +18 -0
  89. data/lib/stripe/resources/issuing/settlement.rb +49 -0
  90. data/lib/stripe/resources/issuing/token.rb +46 -0
  91. data/lib/stripe/resources/issuing/transaction.rb +106 -0
  92. data/lib/stripe/resources/line_item.rb +50 -0
  93. data/lib/stripe/resources/login_link.rb +7 -0
  94. data/lib/stripe/resources/mandate.rb +78 -0
  95. data/lib/stripe/resources/margin.rb +56 -0
  96. data/lib/stripe/resources/order.rb +322 -0
  97. data/lib/stripe/resources/payment_attempt_record.rb +100 -0
  98. data/lib/stripe/resources/payment_intent.rb +712 -0
  99. data/lib/stripe/resources/payment_link.rb +198 -0
  100. data/lib/stripe/resources/payment_method.rb +368 -0
  101. data/lib/stripe/resources/payment_method_configuration.rb +430 -0
  102. data/lib/stripe/resources/payment_method_domain.rb +57 -0
  103. data/lib/stripe/resources/payment_record.rb +194 -0
  104. data/lib/stripe/resources/payout.rb +56 -0
  105. data/lib/stripe/resources/person.rb +128 -0
  106. data/lib/stripe/resources/plan.rb +52 -0
  107. data/lib/stripe/resources/price.rb +77 -0
  108. data/lib/stripe/resources/product.rb +60 -0
  109. data/lib/stripe/resources/product_feature.rb +12 -0
  110. data/lib/stripe/resources/promotion_code.rb +35 -0
  111. data/lib/stripe/resources/quote.rb +356 -0
  112. data/lib/stripe/resources/quote_line.rb +136 -0
  113. data/lib/stripe/resources/quote_preview_invoice.rb +374 -0
  114. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +170 -0
  115. data/lib/stripe/resources/radar/early_fraud_warning.rb +17 -0
  116. data/lib/stripe/resources/radar/value_list.rb +23 -0
  117. data/lib/stripe/resources/radar/value_list_item.rb +17 -0
  118. data/lib/stripe/resources/refund.rb +130 -0
  119. data/lib/stripe/resources/reporting/report_run.rb +29 -0
  120. data/lib/stripe/resources/reporting/report_type.rb +19 -0
  121. data/lib/stripe/resources/reserve_transaction.rb +22 -0
  122. data/lib/stripe/resources/reversal.rb +21 -0
  123. data/lib/stripe/resources/review.rb +36 -0
  124. data/lib/stripe/resources/setup_attempt.rb +101 -0
  125. data/lib/stripe/resources/setup_intent.rb +158 -0
  126. data/lib/stripe/resources/shipping_rate.rb +42 -0
  127. data/lib/stripe/resources/sigma/scheduled_query_run.rb +26 -0
  128. data/lib/stripe/resources/source.rb +195 -0
  129. data/lib/stripe/resources/source_mandate_notification.rb +59 -0
  130. data/lib/stripe/resources/source_transaction.rb +48 -0
  131. data/lib/stripe/resources/subscription.rb +214 -0
  132. data/lib/stripe/resources/subscription_item.rb +46 -0
  133. data/lib/stripe/resources/subscription_schedule.rb +173 -0
  134. data/lib/stripe/resources/tax/association.rb +60 -0
  135. data/lib/stripe/resources/tax/calculation.rb +72 -0
  136. data/lib/stripe/resources/tax/calculation_line_item.rb +33 -0
  137. data/lib/stripe/resources/tax/form.rb +124 -0
  138. data/lib/stripe/resources/tax/registration.rb +379 -0
  139. data/lib/stripe/resources/tax/settings.rb +33 -0
  140. data/lib/stripe/resources/tax/transaction.rb +68 -0
  141. data/lib/stripe/resources/tax/transaction_line_item.rb +30 -0
  142. data/lib/stripe/resources/tax_code.rb +9 -0
  143. data/lib/stripe/resources/tax_deducted_at_source.rb +22 -0
  144. data/lib/stripe/resources/tax_id.rb +30 -0
  145. data/lib/stripe/resources/tax_rate.rb +42 -0
  146. data/lib/stripe/resources/terminal/configuration.rb +107 -0
  147. data/lib/stripe/resources/terminal/connection_token.rb +7 -0
  148. data/lib/stripe/resources/terminal/location.rb +20 -0
  149. data/lib/stripe/resources/terminal/reader.rb +178 -0
  150. data/lib/stripe/resources/terminal/reader_collected_data.rb +30 -0
  151. data/lib/stripe/resources/test_helpers/test_clock.rb +27 -0
  152. data/lib/stripe/resources/token.rb +29 -0
  153. data/lib/stripe/resources/topup.rb +33 -0
  154. data/lib/stripe/resources/transfer.rb +35 -0
  155. data/lib/stripe/resources/treasury/credit_reversal.rb +32 -0
  156. data/lib/stripe/resources/treasury/debit_reversal.rb +38 -0
  157. data/lib/stripe/resources/treasury/financial_account.rb +57 -0
  158. data/lib/stripe/resources/treasury/financial_account_features.rb +91 -0
  159. data/lib/stripe/resources/treasury/inbound_transfer.rb +66 -0
  160. data/lib/stripe/resources/treasury/outbound_payment.rb +85 -0
  161. data/lib/stripe/resources/treasury/outbound_transfer.rb +82 -0
  162. data/lib/stripe/resources/treasury/received_credit.rb +70 -0
  163. data/lib/stripe/resources/treasury/received_debit.rb +67 -0
  164. data/lib/stripe/resources/treasury/transaction.rb +42 -0
  165. data/lib/stripe/resources/treasury/transaction_entry.rb +34 -0
  166. data/lib/stripe/resources/usage_record.rb +13 -0
  167. data/lib/stripe/resources/usage_record_summary.rb +18 -0
  168. data/lib/stripe/resources/v2/amount.rb +9 -0
  169. data/lib/stripe/resources/v2/billing/meter_event.rb +18 -0
  170. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +20 -0
  171. data/lib/stripe/resources/v2/billing/meter_event_session.rb +14 -0
  172. data/lib/stripe/resources/v2/event.rb +21 -0
  173. data/lib/stripe/resources/v2/event_destination.rb +49 -0
  174. data/lib/stripe/resources/webhook_endpoint.rb +27 -0
  175. data/lib/stripe/resources.rb +31 -0
  176. data/lib/stripe/services/account_notice_service.rb +39 -0
  177. data/lib/stripe/services/billing/credit_balance_summary_service.rb +1 -1
  178. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +2 -2
  179. data/lib/stripe/services/billing/credit_grant_service.rb +3 -3
  180. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +1 -1
  181. data/lib/stripe/services/billing/meter_event_service.rb +1 -1
  182. data/lib/stripe/services/billing/meter_service.rb +5 -5
  183. data/lib/stripe/services/capital/financing_offer_service.rb +42 -0
  184. data/lib/stripe/services/capital/financing_summary_service.rb +19 -0
  185. data/lib/stripe/services/capital/financing_transaction_service.rb +31 -0
  186. data/lib/stripe/services/capital_service.rb +15 -0
  187. data/lib/stripe/services/financial_connections/account_inferred_balance_service.rb +19 -0
  188. data/lib/stripe/services/financial_connections/account_service.rb +3 -1
  189. data/lib/stripe/services/financial_connections/institution_service.rb +30 -0
  190. data/lib/stripe/services/financial_connections_service.rb +2 -1
  191. data/lib/stripe/services/gift_cards/card_service.rb +63 -0
  192. data/lib/stripe/services/gift_cards/transaction_service.rb +74 -0
  193. data/lib/stripe/services/gift_cards_service.rb +14 -0
  194. data/lib/stripe/services/invoice_payment_service.rb +28 -0
  195. data/lib/stripe/services/invoice_service.rb +44 -1
  196. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +74 -0
  197. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +30 -0
  198. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +30 -0
  199. data/lib/stripe/services/issuing_service.rb +5 -1
  200. data/lib/stripe/services/margin_service.rb +50 -0
  201. data/lib/stripe/services/order_line_item_service.rb +17 -0
  202. data/lib/stripe/services/order_service.rb +78 -0
  203. data/lib/stripe/services/payment_attempt_record_service.rb +28 -0
  204. data/lib/stripe/services/payment_intent_service.rb +37 -0
  205. data/lib/stripe/services/payment_record_service.rb +78 -0
  206. data/lib/stripe/services/quote_line_service.rb +17 -0
  207. data/lib/stripe/services/quote_preview_invoice_service.rb +17 -0
  208. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +17 -0
  209. data/lib/stripe/services/quote_service.rb +49 -1
  210. data/lib/stripe/services/subscription_schedule_service.rb +11 -0
  211. data/lib/stripe/services/tax/association_service.rb +19 -0
  212. data/lib/stripe/services/tax/form_service.rb +37 -0
  213. data/lib/stripe/services/tax_service.rb +3 -1
  214. data/lib/stripe/services/terminal/reader_collected_data_service.rb +19 -0
  215. data/lib/stripe/services/terminal/reader_service.rb +33 -0
  216. data/lib/stripe/services/terminal_service.rb +2 -1
  217. data/lib/stripe/services/v1_services.rb +8 -1
  218. data/lib/stripe/services.rb +25 -0
  219. data/lib/stripe/stripe_configuration.rb +3 -1
  220. data/lib/stripe/stripe_object.rb +5 -0
  221. data/lib/stripe/util.rb +7 -1
  222. data/lib/stripe/version.rb +1 -1
  223. data/lib/stripe.rb +45 -0
  224. data/stripe.gemspec +2 -1
  225. metadata +62 -4
@@ -15,6 +15,179 @@ module Stripe
15
15
  "subscription_schedule"
16
16
  end
17
17
 
18
+ class CurrentPhase < Stripe::StripeObject
19
+ attr_reader :end_date, :start_date
20
+ end
21
+
22
+ class DefaultSettings < Stripe::StripeObject
23
+ class AutomaticTax < Stripe::StripeObject
24
+ class Liability < Stripe::StripeObject
25
+ attr_reader :account, :type
26
+ end
27
+ attr_reader :disabled_reason, :enabled, :liability
28
+ end
29
+
30
+ class BillingThresholds < Stripe::StripeObject
31
+ attr_reader :amount_gte, :reset_billing_cycle_anchor
32
+ end
33
+
34
+ class InvoiceSettings < Stripe::StripeObject
35
+ class Issuer < Stripe::StripeObject
36
+ attr_reader :account, :type
37
+ end
38
+ attr_reader :account_tax_ids, :days_until_due, :issuer
39
+ end
40
+
41
+ class TransferData < Stripe::StripeObject
42
+ attr_reader :amount_percent, :destination
43
+ end
44
+ attr_reader :application_fee_percent, :automatic_tax, :billing_cycle_anchor, :billing_thresholds, :collection_method, :default_payment_method, :description, :invoice_settings, :on_behalf_of, :transfer_data
45
+ end
46
+
47
+ class LastPriceMigrationError < Stripe::StripeObject
48
+ class FailedTransition < Stripe::StripeObject
49
+ attr_reader :source_price, :target_price
50
+ end
51
+ attr_reader :errored_at, :failed_transitions, :type
52
+ end
53
+
54
+ class Phase < Stripe::StripeObject
55
+ class AddInvoiceItem < Stripe::StripeObject
56
+ class Discount < Stripe::StripeObject
57
+ class DiscountEnd < Stripe::StripeObject
58
+ attr_reader :timestamp, :type
59
+ end
60
+ attr_reader :coupon, :discount, :discount_end, :promotion_code
61
+ end
62
+ attr_reader :discounts, :price, :quantity, :tax_rates
63
+ end
64
+
65
+ class AutomaticTax < Stripe::StripeObject
66
+ class Liability < Stripe::StripeObject
67
+ attr_reader :account, :type
68
+ end
69
+ attr_reader :disabled_reason, :enabled, :liability
70
+ end
71
+
72
+ class BillingThresholds < Stripe::StripeObject
73
+ attr_reader :amount_gte, :reset_billing_cycle_anchor
74
+ end
75
+
76
+ class Discount < Stripe::StripeObject
77
+ class DiscountEnd < Stripe::StripeObject
78
+ attr_reader :timestamp, :type
79
+ end
80
+ attr_reader :coupon, :discount, :discount_end, :promotion_code
81
+ end
82
+
83
+ class InvoiceSettings < Stripe::StripeObject
84
+ class Issuer < Stripe::StripeObject
85
+ attr_reader :account, :type
86
+ end
87
+ attr_reader :account_tax_ids, :days_until_due, :issuer
88
+ end
89
+
90
+ class Item < Stripe::StripeObject
91
+ class BillingThresholds < Stripe::StripeObject
92
+ attr_reader :usage_gte
93
+ end
94
+
95
+ class Discount < Stripe::StripeObject
96
+ class DiscountEnd < Stripe::StripeObject
97
+ attr_reader :timestamp, :type
98
+ end
99
+ attr_reader :coupon, :discount, :discount_end, :promotion_code
100
+ end
101
+
102
+ class Trial < Stripe::StripeObject
103
+ attr_reader :converts_to, :type
104
+ end
105
+ attr_reader :billing_thresholds, :discounts, :metadata, :plan, :price, :quantity, :tax_rates, :trial
106
+ end
107
+
108
+ class PauseCollection < Stripe::StripeObject
109
+ attr_reader :behavior
110
+ end
111
+
112
+ class TransferData < Stripe::StripeObject
113
+ attr_reader :amount_percent, :destination
114
+ end
115
+
116
+ class TrialSettings < Stripe::StripeObject
117
+ class EndBehavior < Stripe::StripeObject
118
+ attr_reader :prorate_up_front
119
+ end
120
+ attr_reader :end_behavior
121
+ end
122
+ attr_reader :add_invoice_items, :application_fee_percent, :automatic_tax, :billing_cycle_anchor, :billing_thresholds, :collection_method, :coupon, :currency, :default_payment_method, :default_tax_rates, :description, :discounts, :end_date, :invoice_settings, :items, :metadata, :on_behalf_of, :pause_collection, :proration_behavior, :start_date, :transfer_data, :trial_continuation, :trial_end, :trial_settings
123
+ end
124
+
125
+ class Prebilling < Stripe::StripeObject
126
+ attr_reader :invoice, :period_end, :period_start, :update_behavior
127
+ end
128
+ # ID of the Connect Application that created the schedule.
129
+ attr_reader :application
130
+ # 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.
131
+ attr_reader :billing_behavior
132
+ # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
133
+ attr_reader :canceled_at
134
+ # Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
135
+ attr_reader :completed_at
136
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
137
+ attr_reader :created
138
+ # Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`.
139
+ attr_reader :current_phase
140
+ # ID of the customer who owns the subscription schedule.
141
+ attr_reader :customer
142
+ # Attribute for field default_settings
143
+ attr_reader :default_settings
144
+ # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
145
+ attr_reader :end_behavior
146
+ # Unique identifier for the object.
147
+ attr_reader :id
148
+ # Details of the most recent price migration that failed for the subscription schedule.
149
+ attr_reader :last_price_migration_error
150
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
151
+ attr_reader :livemode
152
+ # 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.
153
+ attr_reader :metadata
154
+ # String representing the object's type. Objects of the same type share the same value.
155
+ attr_reader :object
156
+ # Configuration for the subscription schedule's phases.
157
+ attr_reader :phases
158
+ # Time period and invoice for a Subscription billed in advance.
159
+ attr_reader :prebilling
160
+ # Time at which the subscription schedule was released. Measured in seconds since the Unix epoch.
161
+ attr_reader :released_at
162
+ # ID of the subscription once managed by the subscription schedule (if it is released).
163
+ attr_reader :released_subscription
164
+ # The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules).
165
+ attr_reader :status
166
+ # ID of the subscription managed by the subscription schedule.
167
+ attr_reader :subscription
168
+ # ID of the test clock this subscription schedule belongs to.
169
+ attr_reader :test_clock
170
+
171
+ # Amends an existing subscription schedule.
172
+ def amend(params = {}, opts = {})
173
+ request_stripe_object(
174
+ method: :post,
175
+ path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(self["id"]) }),
176
+ params: params,
177
+ opts: opts
178
+ )
179
+ end
180
+
181
+ # Amends an existing subscription schedule.
182
+ def self.amend(schedule, params = {}, opts = {})
183
+ request_stripe_object(
184
+ method: :post,
185
+ path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
186
+ params: params,
187
+ opts: opts
188
+ )
189
+ end
190
+
18
191
  # Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
19
192
  def cancel(params = {}, opts = {})
20
193
  request_stripe_object(
@@ -0,0 +1,60 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Tax
6
+ # A Tax Association exposes the Tax Transactions that Stripe attempted to create on your behalf based on the PaymentIntent input
7
+ class Association < APIResource
8
+ OBJECT_NAME = "tax.association"
9
+ def self.object_name
10
+ "tax.association"
11
+ end
12
+
13
+ class StatusDetails < Stripe::StripeObject
14
+ class Committed < Stripe::StripeObject
15
+ class Reversal < Stripe::StripeObject
16
+ class StatusDetails < Stripe::StripeObject
17
+ class Committed < Stripe::StripeObject
18
+ attr_reader :transaction
19
+ end
20
+
21
+ class Errored < Stripe::StripeObject
22
+ attr_reader :reason, :refund_id
23
+ end
24
+ attr_reader :committed, :errored
25
+ end
26
+ attr_reader :status, :status_details
27
+ end
28
+ attr_reader :reversals, :transaction
29
+ end
30
+
31
+ class Errored < Stripe::StripeObject
32
+ attr_reader :reason
33
+ end
34
+ attr_reader :committed, :errored
35
+ end
36
+ # The [Tax Calculation](https://stripe.com/docs/api/tax/calculations/object) that was included in PaymentIntent.
37
+ attr_reader :calculation
38
+ # Unique identifier for the object.
39
+ attr_reader :id
40
+ # String representing the object's type. Objects of the same type share the same value.
41
+ attr_reader :object
42
+ # The [PaymentIntent](https://stripe.com/docs/api/payment_intents/object) that this Tax Association is tracking.
43
+ attr_reader :payment_intent
44
+ # Status of the Tax Association.
45
+ attr_reader :status
46
+ # Attribute for field status_details
47
+ attr_reader :status_details
48
+
49
+ # Finds a tax association object by PaymentIntent id.
50
+ def self.find(params = {}, opts = {})
51
+ request_stripe_object(
52
+ method: :get,
53
+ path: "/v1/tax/associations/find",
54
+ params: params,
55
+ opts: opts
56
+ )
57
+ end
58
+ end
59
+ end
60
+ end
@@ -14,6 +14,78 @@ module Stripe
14
14
  "tax.calculation"
15
15
  end
16
16
 
17
+ class CustomerDetails < Stripe::StripeObject
18
+ class Address < Stripe::StripeObject
19
+ attr_reader :city, :country, :line1, :line2, :postal_code, :state
20
+ end
21
+
22
+ class TaxId < Stripe::StripeObject
23
+ attr_reader :type, :value
24
+ end
25
+ attr_reader :address, :address_source, :ip_address, :tax_ids, :taxability_override
26
+ end
27
+
28
+ class ShipFromDetails < Stripe::StripeObject
29
+ class Address < Stripe::StripeObject
30
+ attr_reader :city, :country, :line1, :line2, :postal_code, :state
31
+ end
32
+ attr_reader :address
33
+ end
34
+
35
+ class ShippingCost < Stripe::StripeObject
36
+ class TaxBreakdown < Stripe::StripeObject
37
+ class Jurisdiction < Stripe::StripeObject
38
+ attr_reader :country, :display_name, :level, :state
39
+ end
40
+
41
+ class TaxRateDetails < Stripe::StripeObject
42
+ attr_reader :display_name, :percentage_decimal, :tax_type
43
+ end
44
+ attr_reader :amount, :jurisdiction, :sourcing, :tax_rate_details, :taxability_reason, :taxable_amount
45
+ end
46
+ attr_reader :amount, :amount_tax, :shipping_rate, :tax_behavior, :tax_breakdown, :tax_code
47
+ end
48
+
49
+ class TaxBreakdown < Stripe::StripeObject
50
+ class TaxRateDetails < Stripe::StripeObject
51
+ class FlatAmount < Stripe::StripeObject
52
+ attr_reader :amount, :currency
53
+ end
54
+ attr_reader :country, :flat_amount, :percentage_decimal, :rate_type, :state, :tax_type
55
+ end
56
+ attr_reader :amount, :inclusive, :tax_rate_details, :taxability_reason, :taxable_amount
57
+ end
58
+ # Total amount after taxes in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
59
+ attr_reader :amount_total
60
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
61
+ attr_reader :currency
62
+ # The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource.
63
+ attr_reader :customer
64
+ # Attribute for field customer_details
65
+ attr_reader :customer_details
66
+ # Timestamp of date at which the tax calculation will expire.
67
+ attr_reader :expires_at
68
+ # Unique identifier for the calculation.
69
+ attr_reader :id
70
+ # The list of items the customer is purchasing.
71
+ attr_reader :line_items
72
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
73
+ attr_reader :livemode
74
+ # String representing the object's type. Objects of the same type share the same value.
75
+ attr_reader :object
76
+ # The details of the ship from location, such as the address.
77
+ attr_reader :ship_from_details
78
+ # The shipping cost details for the calculation.
79
+ attr_reader :shipping_cost
80
+ # The amount of tax to be collected on top of the line item prices.
81
+ attr_reader :tax_amount_exclusive
82
+ # The amount of tax already included in the line item prices.
83
+ attr_reader :tax_amount_inclusive
84
+ # Breakdown of individual tax amounts that add up to the total.
85
+ attr_reader :tax_breakdown
86
+ # Timestamp of date at which the tax rules and rates in effect applies for the calculation.
87
+ attr_reader :tax_date
88
+
17
89
  # Calculates tax based on the input and returns a Tax Calculation object.
18
90
  def self.create(params = {}, opts = {})
19
91
  request_stripe_object(
@@ -8,6 +8,39 @@ module Stripe
8
8
  def self.object_name
9
9
  "tax.calculation_line_item"
10
10
  end
11
+
12
+ class TaxBreakdown < Stripe::StripeObject
13
+ class Jurisdiction < Stripe::StripeObject
14
+ attr_reader :country, :display_name, :level, :state
15
+ end
16
+
17
+ class TaxRateDetails < Stripe::StripeObject
18
+ attr_reader :display_name, :percentage_decimal, :tax_type
19
+ end
20
+ attr_reader :amount, :jurisdiction, :sourcing, :tax_rate_details, :taxability_reason, :taxable_amount
21
+ end
22
+ # The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount.
23
+ attr_reader :amount
24
+ # The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
25
+ attr_reader :amount_tax
26
+ # Unique identifier for the object.
27
+ attr_reader :id
28
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
29
+ attr_reader :livemode
30
+ # String representing the object's type. Objects of the same type share the same value.
31
+ attr_reader :object
32
+ # The ID of an existing [Product](https://stripe.com/docs/api/products/object).
33
+ attr_reader :product
34
+ # The number of units of the item being purchased. For reversals, this is the quantity reversed.
35
+ attr_reader :quantity
36
+ # A custom identifier for this line item.
37
+ attr_reader :reference
38
+ # Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes.
39
+ attr_reader :tax_behavior
40
+ # Detailed account of taxes relevant to this line item.
41
+ attr_reader :tax_breakdown
42
+ # The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource.
43
+ attr_reader :tax_code
11
44
  end
12
45
  end
13
46
  end
@@ -0,0 +1,124 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Tax
6
+ # Tax forms are legal documents which are delivered to one or more tax authorities for information reporting purposes.
7
+ #
8
+ # Related guide: [US tax reporting for Connect platforms](https://stripe.com/docs/connect/tax-reporting)
9
+ class Form < APIResource
10
+ extend Stripe::APIOperations::List
11
+
12
+ OBJECT_NAME = "tax.form"
13
+ def self.object_name
14
+ "tax.form"
15
+ end
16
+
17
+ class AuSerr < Stripe::StripeObject
18
+ attr_reader :reporting_period_end_date, :reporting_period_start_date
19
+ end
20
+
21
+ class CaMrdp < Stripe::StripeObject
22
+ attr_reader :reporting_period_end_date, :reporting_period_start_date
23
+ end
24
+
25
+ class EuDac7 < Stripe::StripeObject
26
+ attr_reader :reporting_period_end_date, :reporting_period_start_date
27
+ end
28
+
29
+ class FilingStatus < Stripe::StripeObject
30
+ class Jurisdiction < Stripe::StripeObject
31
+ attr_reader :country, :level, :state
32
+ end
33
+ attr_reader :effective_at, :jurisdiction, :value
34
+ end
35
+
36
+ class GbMrdp < Stripe::StripeObject
37
+ attr_reader :reporting_period_end_date, :reporting_period_start_date
38
+ end
39
+
40
+ class NzMrdp < Stripe::StripeObject
41
+ attr_reader :reporting_period_end_date, :reporting_period_start_date
42
+ end
43
+
44
+ class Payee < Stripe::StripeObject
45
+ attr_reader :account, :external_reference, :type
46
+ end
47
+
48
+ class Us1099K < Stripe::StripeObject
49
+ attr_reader :reporting_year
50
+ end
51
+
52
+ class Us1099Misc < Stripe::StripeObject
53
+ attr_reader :reporting_year
54
+ end
55
+
56
+ class Us1099Nec < Stripe::StripeObject
57
+ attr_reader :reporting_year
58
+ end
59
+ # Attribute for field au_serr
60
+ attr_reader :au_serr
61
+ # Attribute for field ca_mrdp
62
+ attr_reader :ca_mrdp
63
+ # The form that corrects this form, if any.
64
+ attr_reader :corrected_by
65
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
66
+ attr_reader :created
67
+ # Attribute for field eu_dac7
68
+ attr_reader :eu_dac7
69
+ # A list of tax filing statuses. Note that a filing status will only be included if the form has been filed directly with the jurisdiction’s tax authority.
70
+ attr_reader :filing_statuses
71
+ # Attribute for field gb_mrdp
72
+ attr_reader :gb_mrdp
73
+ # Unique identifier for the object.
74
+ attr_reader :id
75
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
76
+ attr_reader :livemode
77
+ # Attribute for field nz_mrdp
78
+ attr_reader :nz_mrdp
79
+ # String representing the object's type. Objects of the same type share the same value.
80
+ attr_reader :object
81
+ # Attribute for field payee
82
+ attr_reader :payee
83
+ # The type of the tax form. An additional hash is included on the tax form with a name matching this value. It contains additional information specific to the tax form type.
84
+ attr_reader :type
85
+ # Attribute for field us_1099_k
86
+ attr_reader :us_1099_k
87
+ # Attribute for field us_1099_misc
88
+ attr_reader :us_1099_misc
89
+ # Attribute for field us_1099_nec
90
+ attr_reader :us_1099_nec
91
+
92
+ # Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first.
93
+ def self.list(filters = {}, opts = {})
94
+ request_stripe_object(method: :get, path: "/v1/tax/forms", params: filters, opts: opts)
95
+ end
96
+
97
+ # Download the PDF for a tax form.
98
+ def pdf(params = {}, opts = {}, &read_body_chunk_block)
99
+ opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
100
+ request_stream(
101
+ method: :get,
102
+ path: format("/v1/tax/forms/%<id>s/pdf", { id: CGI.escape(self["id"]) }),
103
+ params: params,
104
+ opts: opts,
105
+ base_address: :files,
106
+ &read_body_chunk_block
107
+ )
108
+ end
109
+
110
+ # Download the PDF for a tax form.
111
+ def self.pdf(id, params = {}, opts = {}, &read_body_chunk_block)
112
+ opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
113
+ execute_resource_request_stream(
114
+ :get,
115
+ format("/v1/tax/forms/%<id>s/pdf", { id: CGI.escape(id) }),
116
+ :files,
117
+ params,
118
+ opts,
119
+ &read_body_chunk_block
120
+ )
121
+ end
122
+ end
123
+ end
124
+ end