stripe 12.7.0.pre.beta.2 → 13.1.0.pre.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +96 -9
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +4 -3
  5. data/VERSION +1 -1
  6. data/examples/README.md +11 -0
  7. data/examples/meter_event_stream.rb +47 -0
  8. data/examples/new_example.rb +24 -0
  9. data/examples/stripe_webhook_handler.rb +28 -0
  10. data/lib/stripe/api_operations/nested_resource.rb +1 -21
  11. data/lib/stripe/api_operations/request.rb +19 -70
  12. data/lib/stripe/api_operations/save.rb +4 -3
  13. data/lib/stripe/api_operations/singleton_save.rb +5 -2
  14. data/lib/stripe/api_requestor.rb +1131 -0
  15. data/lib/stripe/api_resource.rb +22 -14
  16. data/lib/stripe/api_version.rb +1 -2
  17. data/lib/stripe/connection_manager.rb +1 -1
  18. data/lib/stripe/errors.rb +8 -2
  19. data/lib/stripe/event_types.rb +14 -0
  20. data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +23 -0
  21. data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +13 -0
  22. data/lib/stripe/list_object.rb +2 -3
  23. data/lib/stripe/oauth.rb +8 -15
  24. data/lib/stripe/object_types.rb +16 -1
  25. data/lib/stripe/request_options.rb +128 -0
  26. data/lib/stripe/resources/billing/credit_balance_summary.rb +14 -0
  27. data/lib/stripe/resources/billing/credit_balance_transaction.rb +26 -0
  28. data/lib/stripe/resources/billing/credit_grant.rb +88 -0
  29. data/lib/stripe/resources/billing/meter.rb +2 -0
  30. data/lib/stripe/resources/customer.rb +2 -3
  31. data/lib/stripe/resources/file.rb +7 -5
  32. data/lib/stripe/resources/issuing/card.rb +20 -0
  33. data/lib/stripe/resources/quote.rb +4 -4
  34. data/lib/stripe/resources/source.rb +3 -2
  35. data/lib/stripe/resources/subscription.rb +6 -6
  36. data/lib/stripe/resources/tax/form.rb +4 -4
  37. data/lib/stripe/resources/usage_record_summary.rb +1 -0
  38. data/lib/stripe/resources/v2/billing/meter_event.rb +16 -0
  39. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +15 -0
  40. data/lib/stripe/resources/v2/billing/meter_event_session.rb +15 -0
  41. data/lib/stripe/resources/v2/event.rb +13 -0
  42. data/lib/stripe/resources.rb +9 -0
  43. data/lib/stripe/search_result_object.rb +1 -1
  44. data/lib/stripe/services/account_capability_service.rb +39 -0
  45. data/lib/stripe/services/account_external_account_service.rb +68 -0
  46. data/lib/stripe/services/account_link_service.rb +17 -0
  47. data/lib/stripe/services/account_login_link_service.rb +19 -0
  48. data/lib/stripe/services/account_notice_service.rb +39 -0
  49. data/lib/stripe/services/account_person_service.rb +61 -0
  50. data/lib/stripe/services/account_service.rb +100 -0
  51. data/lib/stripe/services/account_session_service.rb +17 -0
  52. data/lib/stripe/services/apple_pay_domain_service.rb +50 -0
  53. data/lib/stripe/services/application_fee_refund_service.rb +60 -0
  54. data/lib/stripe/services/application_fee_service.rb +35 -0
  55. data/lib/stripe/services/apps/secret_service.rb +52 -0
  56. data/lib/stripe/services/apps_service.rb +13 -0
  57. data/lib/stripe/services/balance_service.rb +12 -0
  58. data/lib/stripe/services/balance_transaction_service.rb +32 -0
  59. data/lib/stripe/services/billing/alert_service.rb +74 -0
  60. data/lib/stripe/services/billing/credit_balance_summary_service.rb +19 -0
  61. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +30 -0
  62. data/lib/stripe/services/billing/credit_grant_service.rb +74 -0
  63. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +19 -0
  64. data/lib/stripe/services/billing/meter_event_service.rb +19 -0
  65. data/lib/stripe/services/billing/meter_event_summary_service.rb +19 -0
  66. data/lib/stripe/services/billing/meter_service.rb +81 -0
  67. data/lib/stripe/services/billing_portal/configuration_service.rb +52 -0
  68. data/lib/stripe/services/billing_portal/session_service.rb +19 -0
  69. data/lib/stripe/services/billing_portal_service.rb +14 -0
  70. data/lib/stripe/services/billing_service.rb +20 -0
  71. data/lib/stripe/services/capital/financing_offer_service.rb +42 -0
  72. data/lib/stripe/services/capital/financing_summary_service.rb +19 -0
  73. data/lib/stripe/services/capital/financing_transaction_service.rb +31 -0
  74. data/lib/stripe/services/capital_service.rb +15 -0
  75. data/lib/stripe/services/charge_service.rb +69 -0
  76. data/lib/stripe/services/checkout/session_line_item_service.rb +19 -0
  77. data/lib/stripe/services/checkout/session_service.rb +72 -0
  78. data/lib/stripe/services/checkout_service.rb +13 -0
  79. data/lib/stripe/services/climate/order_service.rb +68 -0
  80. data/lib/stripe/services/climate/product_service.rb +30 -0
  81. data/lib/stripe/services/climate/supplier_service.rb +30 -0
  82. data/lib/stripe/services/climate_service.rb +15 -0
  83. data/lib/stripe/services/confirmation_token_service.rb +17 -0
  84. data/lib/stripe/services/country_spec_service.rb +28 -0
  85. data/lib/stripe/services/coupon_service.rb +51 -0
  86. data/lib/stripe/services/credit_note_line_item_service.rb +17 -0
  87. data/lib/stripe/services/credit_note_preview_lines_service.rb +17 -0
  88. data/lib/stripe/services/credit_note_service.rb +93 -0
  89. data/lib/stripe/services/customer_balance_transaction_service.rb +50 -0
  90. data/lib/stripe/services/customer_cash_balance_service.rb +28 -0
  91. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +28 -0
  92. data/lib/stripe/services/customer_funding_instructions_service.rb +19 -0
  93. data/lib/stripe/services/customer_payment_method_service.rb +28 -0
  94. data/lib/stripe/services/customer_payment_source_service.rb +76 -0
  95. data/lib/stripe/services/customer_service.rb +89 -0
  96. data/lib/stripe/services/customer_session_service.rb +17 -0
  97. data/lib/stripe/services/customer_tax_id_service.rb +50 -0
  98. data/lib/stripe/services/dispute_service.rb +48 -0
  99. data/lib/stripe/services/entitlements/active_entitlement_service.rb +30 -0
  100. data/lib/stripe/services/entitlements/feature_service.rb +52 -0
  101. data/lib/stripe/services/entitlements_service.rb +14 -0
  102. data/lib/stripe/services/ephemeral_key_service.rb +28 -0
  103. data/lib/stripe/services/event_service.rb +22 -0
  104. data/lib/stripe/services/exchange_rate_service.rb +28 -0
  105. data/lib/stripe/services/file_link_service.rb +38 -0
  106. data/lib/stripe/services/file_service.rb +35 -0
  107. data/lib/stripe/services/financial_connections/account_inferred_balance_service.rb +19 -0
  108. data/lib/stripe/services/financial_connections/account_owner_service.rb +19 -0
  109. data/lib/stripe/services/financial_connections/account_service.rb +83 -0
  110. data/lib/stripe/services/financial_connections/institution_service.rb +30 -0
  111. data/lib/stripe/services/financial_connections/session_service.rb +30 -0
  112. data/lib/stripe/services/financial_connections/transaction_service.rb +30 -0
  113. data/lib/stripe/services/financial_connections_service.rb +16 -0
  114. data/lib/stripe/services/forwarding/request_service.rb +41 -0
  115. data/lib/stripe/services/forwarding_service.rb +13 -0
  116. data/lib/stripe/services/gift_cards/card_service.rb +63 -0
  117. data/lib/stripe/services/gift_cards/transaction_service.rb +74 -0
  118. data/lib/stripe/services/gift_cards_service.rb +14 -0
  119. data/lib/stripe/services/identity/verification_report_service.rb +30 -0
  120. data/lib/stripe/services/identity/verification_session_service.rb +106 -0
  121. data/lib/stripe/services/identity_service.rb +14 -0
  122. data/lib/stripe/services/invoice_item_service.rb +61 -0
  123. data/lib/stripe/services/invoice_line_item_service.rb +31 -0
  124. data/lib/stripe/services/invoice_payment_service.rb +28 -0
  125. data/lib/stripe/services/invoice_rendering_template_service.rb +50 -0
  126. data/lib/stripe/services/invoice_service.rb +245 -0
  127. data/lib/stripe/services/invoice_upcoming_lines_service.rb +17 -0
  128. data/lib/stripe/services/issuing/authorization_service.rb +65 -0
  129. data/lib/stripe/services/issuing/card_service.rb +52 -0
  130. data/lib/stripe/services/issuing/cardholder_service.rb +52 -0
  131. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +74 -0
  132. data/lib/stripe/services/issuing/dispute_service.rb +63 -0
  133. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +30 -0
  134. data/lib/stripe/services/issuing/personalization_design_service.rb +52 -0
  135. data/lib/stripe/services/issuing/physical_bundle_service.rb +30 -0
  136. data/lib/stripe/services/issuing/token_service.rb +41 -0
  137. data/lib/stripe/services/issuing/transaction_service.rb +41 -0
  138. data/lib/stripe/services/issuing_service.rb +23 -0
  139. data/lib/stripe/services/mandate_service.rb +17 -0
  140. data/lib/stripe/services/margin_service.rb +50 -0
  141. data/lib/stripe/services/oauth_service.rb +63 -0
  142. data/lib/stripe/services/order_line_item_service.rb +17 -0
  143. data/lib/stripe/services/order_service.rb +78 -0
  144. data/lib/stripe/services/payment_intent_service.rb +230 -0
  145. data/lib/stripe/services/payment_link_line_item_service.rb +17 -0
  146. data/lib/stripe/services/payment_link_service.rb +57 -0
  147. data/lib/stripe/services/payment_method_configuration_service.rb +50 -0
  148. data/lib/stripe/services/payment_method_domain_service.rb +66 -0
  149. data/lib/stripe/services/payment_method_service.rb +86 -0
  150. data/lib/stripe/services/payout_service.rb +66 -0
  151. data/lib/stripe/services/plan_service.rb +49 -0
  152. data/lib/stripe/services/price_service.rb +52 -0
  153. data/lib/stripe/services/product_feature_service.rb +50 -0
  154. data/lib/stripe/services/product_service.rb +70 -0
  155. data/lib/stripe/services/promotion_code_service.rb +50 -0
  156. data/lib/stripe/services/quote_computed_upfront_line_items_service.rb +17 -0
  157. data/lib/stripe/services/quote_line_item_service.rb +17 -0
  158. data/lib/stripe/services/quote_line_service.rb +17 -0
  159. data/lib/stripe/services/quote_preview_invoice_service.rb +17 -0
  160. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +17 -0
  161. data/lib/stripe/services/quote_service.rb +140 -0
  162. data/lib/stripe/services/radar/early_fraud_warning_service.rb +32 -0
  163. data/lib/stripe/services/radar/value_list_item_service.rb +52 -0
  164. data/lib/stripe/services/radar/value_list_service.rb +63 -0
  165. data/lib/stripe/services/radar_service.rb +15 -0
  166. data/lib/stripe/services/refund_service.rb +63 -0
  167. data/lib/stripe/services/reporting/report_run_service.rb +41 -0
  168. data/lib/stripe/services/reporting/report_type_service.rb +30 -0
  169. data/lib/stripe/services/reporting_service.rb +14 -0
  170. data/lib/stripe/services/review_service.rb +33 -0
  171. data/lib/stripe/services/setup_attempt_service.rb +17 -0
  172. data/lib/stripe/services/setup_intent_service.rb +105 -0
  173. data/lib/stripe/services/shipping_rate_service.rb +50 -0
  174. data/lib/stripe/services/sigma/scheduled_query_run_service.rb +30 -0
  175. data/lib/stripe/services/sigma_service.rb +13 -0
  176. data/lib/stripe/services/source_service.rb +64 -0
  177. data/lib/stripe/services/source_transaction_service.rb +17 -0
  178. data/lib/stripe/services/subscription_item_service.rb +69 -0
  179. data/lib/stripe/services/subscription_item_usage_record_service.rb +23 -0
  180. data/lib/stripe/services/subscription_item_usage_record_summary_service.rb +19 -0
  181. data/lib/stripe/services/subscription_schedule_service.rb +83 -0
  182. data/lib/stripe/services/subscription_service.rb +127 -0
  183. data/lib/stripe/services/tax/association_service.rb +19 -0
  184. data/lib/stripe/services/tax/calculation_line_item_service.rb +19 -0
  185. data/lib/stripe/services/tax/calculation_service.rb +37 -0
  186. data/lib/stripe/services/tax/form_service.rb +37 -0
  187. data/lib/stripe/services/tax/registration_service.rb +54 -0
  188. data/lib/stripe/services/tax/settings_service.rb +30 -0
  189. data/lib/stripe/services/tax/transaction_line_item_service.rb +19 -0
  190. data/lib/stripe/services/tax/transaction_service.rb +48 -0
  191. data/lib/stripe/services/tax_code_service.rb +22 -0
  192. data/lib/stripe/services/tax_id_service.rb +38 -0
  193. data/lib/stripe/services/tax_rate_service.rb +38 -0
  194. data/lib/stripe/services/tax_service.rb +18 -0
  195. data/lib/stripe/services/terminal/configuration_service.rb +63 -0
  196. data/lib/stripe/services/terminal/connection_token_service.rb +19 -0
  197. data/lib/stripe/services/terminal/location_service.rb +64 -0
  198. data/lib/stripe/services/terminal/reader_collected_data_service.rb +19 -0
  199. data/lib/stripe/services/terminal/reader_service.rb +151 -0
  200. data/lib/stripe/services/terminal_service.rb +17 -0
  201. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +19 -0
  202. data/lib/stripe/services/test_helpers/customer_service.rb +19 -0
  203. data/lib/stripe/services/test_helpers/issuing/authorization_service.rb +76 -0
  204. data/lib/stripe/services/test_helpers/issuing/card_service.rb +65 -0
  205. data/lib/stripe/services/test_helpers/issuing/personalization_design_service.rb +43 -0
  206. data/lib/stripe/services/test_helpers/issuing/transaction_service.rb +43 -0
  207. data/lib/stripe/services/test_helpers/issuing_service.rb +19 -0
  208. data/lib/stripe/services/test_helpers/refund_service.rb +19 -0
  209. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +21 -0
  210. data/lib/stripe/services/test_helpers/terminal_service.rb +15 -0
  211. data/lib/stripe/services/test_helpers/test_clock_service.rb +63 -0
  212. data/lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb +43 -0
  213. data/lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb +54 -0
  214. data/lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb +54 -0
  215. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +21 -0
  216. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +21 -0
  217. data/lib/stripe/services/test_helpers/treasury_service.rb +19 -0
  218. data/lib/stripe/services/test_helpers_service.rb +19 -0
  219. data/lib/stripe/services/token_service.rb +23 -0
  220. data/lib/stripe/services/topup_service.rb +49 -0
  221. data/lib/stripe/services/transfer_reversal_service.rb +56 -0
  222. data/lib/stripe/services/transfer_service.rb +47 -0
  223. data/lib/stripe/services/treasury/credit_reversal_service.rb +41 -0
  224. data/lib/stripe/services/treasury/debit_reversal_service.rb +41 -0
  225. data/lib/stripe/services/treasury/financial_account_features_service.rb +30 -0
  226. data/lib/stripe/services/treasury/financial_account_service.rb +59 -0
  227. data/lib/stripe/services/treasury/inbound_transfer_service.rb +52 -0
  228. data/lib/stripe/services/treasury/outbound_payment_service.rb +52 -0
  229. data/lib/stripe/services/treasury/outbound_transfer_service.rb +52 -0
  230. data/lib/stripe/services/treasury/received_credit_service.rb +30 -0
  231. data/lib/stripe/services/treasury/received_debit_service.rb +30 -0
  232. data/lib/stripe/services/treasury/transaction_entry_service.rb +30 -0
  233. data/lib/stripe/services/treasury/transaction_service.rb +30 -0
  234. data/lib/stripe/services/treasury_service.rb +22 -0
  235. data/lib/stripe/services/v1_services.rb +94 -0
  236. data/lib/stripe/services/v2/billing/meter_event_adjustment_service.rb +21 -0
  237. data/lib/stripe/services/v2/billing/meter_event_service.rb +21 -0
  238. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +21 -0
  239. data/lib/stripe/services/v2/billing/meter_event_stream_service.rb +23 -0
  240. data/lib/stripe/services/v2/billing_service.rb +18 -0
  241. data/lib/stripe/services/v2/core/event_service.rb +32 -0
  242. data/lib/stripe/services/v2/core_service.rb +15 -0
  243. data/lib/stripe/services/v2_services.rb +14 -0
  244. data/lib/stripe/services/webhook_endpoint_service.rb +61 -0
  245. data/lib/stripe/services.rb +203 -0
  246. data/lib/stripe/singleton_api_resource.rb +1 -18
  247. data/lib/stripe/stripe_client.rb +51 -1067
  248. data/lib/stripe/stripe_configuration.rb +33 -19
  249. data/lib/stripe/stripe_object.rb +37 -18
  250. data/lib/stripe/stripe_service.rb +32 -0
  251. data/lib/stripe/thin_event.rb +17 -0
  252. data/lib/stripe/util.rb +68 -39
  253. data/lib/stripe/v2_list_object.rb +84 -0
  254. data/lib/stripe/version.rb +1 -1
  255. data/lib/stripe/webhook.rb +1 -1
  256. data/lib/stripe.rb +33 -27
  257. metadata +223 -2
@@ -0,0 +1,48 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Tax
6
+ class TransactionService < StripeService
7
+ attr_reader :line_items
8
+
9
+ def initialize(requestor)
10
+ super(requestor)
11
+ @line_items = Stripe::Tax::TransactionLineItemService.new(@requestor)
12
+ end
13
+
14
+ # Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days.
15
+ def create_from_calculation(params = {}, opts = {})
16
+ request(
17
+ method: :post,
18
+ path: "/v1/tax/transactions/create_from_calculation",
19
+ params: params,
20
+ opts: opts,
21
+ base_address: :api
22
+ )
23
+ end
24
+
25
+ # Partially or fully reverses a previously created Transaction.
26
+ def create_reversal(params = {}, opts = {})
27
+ request(
28
+ method: :post,
29
+ path: "/v1/tax/transactions/create_reversal",
30
+ params: params,
31
+ opts: opts,
32
+ base_address: :api
33
+ )
34
+ end
35
+
36
+ # Retrieves a Tax Transaction object.
37
+ def retrieve(transaction, params = {}, opts = {})
38
+ request(
39
+ method: :get,
40
+ path: format("/v1/tax/transactions/%<transaction>s", { transaction: CGI.escape(transaction) }),
41
+ params: params,
42
+ opts: opts,
43
+ base_address: :api
44
+ )
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,22 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ class TaxCodeService < StripeService
6
+ # A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations.
7
+ def list(params = {}, opts = {})
8
+ request(method: :get, path: "/v1/tax_codes", params: params, opts: opts, base_address: :api)
9
+ end
10
+
11
+ # Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information.
12
+ def retrieve(id, params = {}, opts = {})
13
+ request(
14
+ method: :get,
15
+ path: format("/v1/tax_codes/%<id>s", { id: CGI.escape(id) }),
16
+ params: params,
17
+ opts: opts,
18
+ base_address: :api
19
+ )
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,38 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ class TaxIdService < StripeService
6
+ # Creates a new account or customer tax_id object.
7
+ def create(params = {}, opts = {})
8
+ request(method: :post, path: "/v1/tax_ids", params: params, opts: opts, base_address: :api)
9
+ end
10
+
11
+ # Deletes an existing account or customer tax_id object.
12
+ def delete(id, params = {}, opts = {})
13
+ request(
14
+ method: :delete,
15
+ path: format("/v1/tax_ids/%<id>s", { id: CGI.escape(id) }),
16
+ params: params,
17
+ opts: opts,
18
+ base_address: :api
19
+ )
20
+ end
21
+
22
+ # Returns a list of tax IDs.
23
+ def list(params = {}, opts = {})
24
+ request(method: :get, path: "/v1/tax_ids", params: params, opts: opts, base_address: :api)
25
+ end
26
+
27
+ # Retrieves an account or customer tax_id object.
28
+ def retrieve(id, params = {}, opts = {})
29
+ request(
30
+ method: :get,
31
+ path: format("/v1/tax_ids/%<id>s", { id: CGI.escape(id) }),
32
+ params: params,
33
+ opts: opts,
34
+ base_address: :api
35
+ )
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ class TaxRateService < StripeService
6
+ # Creates a new tax rate.
7
+ def create(params = {}, opts = {})
8
+ request(method: :post, path: "/v1/tax_rates", params: params, opts: opts, base_address: :api)
9
+ end
10
+
11
+ # Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.
12
+ def list(params = {}, opts = {})
13
+ request(method: :get, path: "/v1/tax_rates", params: params, opts: opts, base_address: :api)
14
+ end
15
+
16
+ # Retrieves a tax rate with the given ID
17
+ def retrieve(tax_rate, params = {}, opts = {})
18
+ request(
19
+ method: :get,
20
+ path: format("/v1/tax_rates/%<tax_rate>s", { tax_rate: CGI.escape(tax_rate) }),
21
+ params: params,
22
+ opts: opts,
23
+ base_address: :api
24
+ )
25
+ end
26
+
27
+ # Updates an existing tax rate.
28
+ def update(tax_rate, params = {}, opts = {})
29
+ request(
30
+ method: :post,
31
+ path: format("/v1/tax_rates/%<tax_rate>s", { tax_rate: CGI.escape(tax_rate) }),
32
+ params: params,
33
+ opts: opts,
34
+ base_address: :api
35
+ )
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,18 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ class TaxService < StripeService
6
+ attr_reader :associations, :calculations, :forms, :registrations, :settings, :transactions
7
+
8
+ def initialize(requestor)
9
+ super(requestor)
10
+ @associations = Stripe::Tax::AssociationService.new(@requestor)
11
+ @calculations = Stripe::Tax::CalculationService.new(@requestor)
12
+ @forms = Stripe::Tax::FormService.new(@requestor)
13
+ @registrations = Stripe::Tax::RegistrationService.new(@requestor)
14
+ @settings = Stripe::Tax::SettingsService.new(@requestor)
15
+ @transactions = Stripe::Tax::TransactionService.new(@requestor)
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,63 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Terminal
6
+ class ConfigurationService < StripeService
7
+ # Creates a new Configuration object.
8
+ def create(params = {}, opts = {})
9
+ request(
10
+ method: :post,
11
+ path: "/v1/terminal/configurations",
12
+ params: params,
13
+ opts: opts,
14
+ base_address: :api
15
+ )
16
+ end
17
+
18
+ # Deletes a Configuration object.
19
+ def delete(configuration, params = {}, opts = {})
20
+ request(
21
+ method: :delete,
22
+ path: format("/v1/terminal/configurations/%<configuration>s", { configuration: CGI.escape(configuration) }),
23
+ params: params,
24
+ opts: opts,
25
+ base_address: :api
26
+ )
27
+ end
28
+
29
+ # Returns a list of Configuration objects.
30
+ def list(params = {}, opts = {})
31
+ request(
32
+ method: :get,
33
+ path: "/v1/terminal/configurations",
34
+ params: params,
35
+ opts: opts,
36
+ base_address: :api
37
+ )
38
+ end
39
+
40
+ # Retrieves a Configuration object.
41
+ def retrieve(configuration, params = {}, opts = {})
42
+ request(
43
+ method: :get,
44
+ path: format("/v1/terminal/configurations/%<configuration>s", { configuration: CGI.escape(configuration) }),
45
+ params: params,
46
+ opts: opts,
47
+ base_address: :api
48
+ )
49
+ end
50
+
51
+ # Updates a new Configuration object.
52
+ def update(configuration, params = {}, opts = {})
53
+ request(
54
+ method: :post,
55
+ path: format("/v1/terminal/configurations/%<configuration>s", { configuration: CGI.escape(configuration) }),
56
+ params: params,
57
+ opts: opts,
58
+ base_address: :api
59
+ )
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,19 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Terminal
6
+ class ConnectionTokenService < StripeService
7
+ # To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token.
8
+ def create(params = {}, opts = {})
9
+ request(
10
+ method: :post,
11
+ path: "/v1/terminal/connection_tokens",
12
+ params: params,
13
+ opts: opts,
14
+ base_address: :api
15
+ )
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,64 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Terminal
6
+ class LocationService < StripeService
7
+ # Creates a new Location object.
8
+ # For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide.
9
+ def create(params = {}, opts = {})
10
+ request(
11
+ method: :post,
12
+ path: "/v1/terminal/locations",
13
+ params: params,
14
+ opts: opts,
15
+ base_address: :api
16
+ )
17
+ end
18
+
19
+ # Deletes a Location object.
20
+ def delete(location, params = {}, opts = {})
21
+ request(
22
+ method: :delete,
23
+ path: format("/v1/terminal/locations/%<location>s", { location: CGI.escape(location) }),
24
+ params: params,
25
+ opts: opts,
26
+ base_address: :api
27
+ )
28
+ end
29
+
30
+ # Returns a list of Location objects.
31
+ def list(params = {}, opts = {})
32
+ request(
33
+ method: :get,
34
+ path: "/v1/terminal/locations",
35
+ params: params,
36
+ opts: opts,
37
+ base_address: :api
38
+ )
39
+ end
40
+
41
+ # Retrieves a Location object.
42
+ def retrieve(location, params = {}, opts = {})
43
+ request(
44
+ method: :get,
45
+ path: format("/v1/terminal/locations/%<location>s", { location: CGI.escape(location) }),
46
+ params: params,
47
+ opts: opts,
48
+ base_address: :api
49
+ )
50
+ end
51
+
52
+ # Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
53
+ def update(location, params = {}, opts = {})
54
+ request(
55
+ method: :post,
56
+ path: format("/v1/terminal/locations/%<location>s", { location: CGI.escape(location) }),
57
+ params: params,
58
+ opts: opts,
59
+ base_address: :api
60
+ )
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,19 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Terminal
6
+ class ReaderCollectedDataService < StripeService
7
+ # Retrieve data collected using Reader hardware.
8
+ def retrieve(reader_collected_data, params = {}, opts = {})
9
+ request(
10
+ method: :get,
11
+ path: format("/v1/terminal/reader_collected_data/%<reader_collected_data>s", { reader_collected_data: CGI.escape(reader_collected_data) }),
12
+ params: params,
13
+ opts: opts,
14
+ base_address: :api
15
+ )
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,151 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Terminal
6
+ class ReaderService < StripeService
7
+ # Cancels the current reader action.
8
+ def cancel_action(reader, params = {}, opts = {})
9
+ request(
10
+ method: :post,
11
+ path: format("/v1/terminal/readers/%<reader>s/cancel_action", { reader: CGI.escape(reader) }),
12
+ params: params,
13
+ opts: opts,
14
+ base_address: :api
15
+ )
16
+ end
17
+
18
+ # Initiates an input collection flow on a Reader.
19
+ def collect_inputs(reader, params = {}, opts = {})
20
+ request(
21
+ method: :post,
22
+ path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(reader) }),
23
+ params: params,
24
+ opts: opts,
25
+ base_address: :api
26
+ )
27
+ end
28
+
29
+ # Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
30
+ def collect_payment_method(reader, params = {}, opts = {})
31
+ request(
32
+ method: :post,
33
+ path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(reader) }),
34
+ params: params,
35
+ opts: opts,
36
+ base_address: :api
37
+ )
38
+ end
39
+
40
+ # Finalizes a payment on a Reader.
41
+ def confirm_payment_intent(reader, params = {}, opts = {})
42
+ request(
43
+ method: :post,
44
+ path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(reader) }),
45
+ params: params,
46
+ opts: opts,
47
+ base_address: :api
48
+ )
49
+ end
50
+
51
+ # Creates a new Reader object.
52
+ def create(params = {}, opts = {})
53
+ request(
54
+ method: :post,
55
+ path: "/v1/terminal/readers",
56
+ params: params,
57
+ opts: opts,
58
+ base_address: :api
59
+ )
60
+ end
61
+
62
+ # Deletes a Reader object.
63
+ def delete(reader, params = {}, opts = {})
64
+ request(
65
+ method: :delete,
66
+ path: format("/v1/terminal/readers/%<reader>s", { reader: CGI.escape(reader) }),
67
+ params: params,
68
+ opts: opts,
69
+ base_address: :api
70
+ )
71
+ end
72
+
73
+ # Returns a list of Reader objects.
74
+ def list(params = {}, opts = {})
75
+ request(
76
+ method: :get,
77
+ path: "/v1/terminal/readers",
78
+ params: params,
79
+ opts: opts,
80
+ base_address: :api
81
+ )
82
+ end
83
+
84
+ # Initiates a payment flow on a Reader.
85
+ def process_payment_intent(reader, params = {}, opts = {})
86
+ request(
87
+ method: :post,
88
+ path: format("/v1/terminal/readers/%<reader>s/process_payment_intent", { reader: CGI.escape(reader) }),
89
+ params: params,
90
+ opts: opts,
91
+ base_address: :api
92
+ )
93
+ end
94
+
95
+ # Initiates a setup intent flow on a Reader.
96
+ def process_setup_intent(reader, params = {}, opts = {})
97
+ request(
98
+ method: :post,
99
+ path: format("/v1/terminal/readers/%<reader>s/process_setup_intent", { reader: CGI.escape(reader) }),
100
+ params: params,
101
+ opts: opts,
102
+ base_address: :api
103
+ )
104
+ end
105
+
106
+ # Initiates a refund on a Reader
107
+ def refund_payment(reader, params = {}, opts = {})
108
+ request(
109
+ method: :post,
110
+ path: format("/v1/terminal/readers/%<reader>s/refund_payment", { reader: CGI.escape(reader) }),
111
+ params: params,
112
+ opts: opts,
113
+ base_address: :api
114
+ )
115
+ end
116
+
117
+ # Retrieves a Reader object.
118
+ def retrieve(reader, params = {}, opts = {})
119
+ request(
120
+ method: :get,
121
+ path: format("/v1/terminal/readers/%<reader>s", { reader: CGI.escape(reader) }),
122
+ params: params,
123
+ opts: opts,
124
+ base_address: :api
125
+ )
126
+ end
127
+
128
+ # Sets reader display to show cart details.
129
+ def set_reader_display(reader, params = {}, opts = {})
130
+ request(
131
+ method: :post,
132
+ path: format("/v1/terminal/readers/%<reader>s/set_reader_display", { reader: CGI.escape(reader) }),
133
+ params: params,
134
+ opts: opts,
135
+ base_address: :api
136
+ )
137
+ end
138
+
139
+ # Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
140
+ def update(reader, params = {}, opts = {})
141
+ request(
142
+ method: :post,
143
+ path: format("/v1/terminal/readers/%<reader>s", { reader: CGI.escape(reader) }),
144
+ params: params,
145
+ opts: opts,
146
+ base_address: :api
147
+ )
148
+ end
149
+ end
150
+ end
151
+ end
@@ -0,0 +1,17 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ class TerminalService < StripeService
6
+ attr_reader :configurations, :connection_tokens, :locations, :readers, :reader_collected_data
7
+
8
+ def initialize(requestor)
9
+ super(requestor)
10
+ @configurations = Stripe::Terminal::ConfigurationService.new(@requestor)
11
+ @connection_tokens = Stripe::Terminal::ConnectionTokenService.new(@requestor)
12
+ @locations = Stripe::Terminal::LocationService.new(@requestor)
13
+ @readers = Stripe::Terminal::ReaderService.new(@requestor)
14
+ @reader_collected_data = Stripe::Terminal::ReaderCollectedDataService.new(@requestor)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module TestHelpers
6
+ class ConfirmationTokenService < StripeService
7
+ # Creates a test mode Confirmation Token server side for your integration tests.
8
+ def create(params = {}, opts = {})
9
+ request(
10
+ method: :post,
11
+ path: "/v1/test_helpers/confirmation_tokens",
12
+ params: params,
13
+ opts: opts,
14
+ base_address: :api
15
+ )
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module TestHelpers
6
+ class CustomerService < StripeService
7
+ # Create an incoming testmode bank transfer
8
+ def fund_cash_balance(customer, params = {}, opts = {})
9
+ request(
10
+ method: :post,
11
+ path: format("/v1/test_helpers/customers/%<customer>s/fund_cash_balance", { customer: CGI.escape(customer) }),
12
+ params: params,
13
+ opts: opts,
14
+ base_address: :api
15
+ )
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,76 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module TestHelpers
6
+ module Issuing
7
+ class AuthorizationService < StripeService
8
+ # Capture a test-mode authorization.
9
+ def capture(authorization, params = {}, opts = {})
10
+ request(
11
+ method: :post,
12
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/capture", { authorization: CGI.escape(authorization) }),
13
+ params: params,
14
+ opts: opts,
15
+ base_address: :api
16
+ )
17
+ end
18
+
19
+ # Create a test-mode authorization.
20
+ def create(params = {}, opts = {})
21
+ request(
22
+ method: :post,
23
+ path: "/v1/test_helpers/issuing/authorizations",
24
+ params: params,
25
+ opts: opts,
26
+ base_address: :api
27
+ )
28
+ end
29
+
30
+ # Expire a test-mode Authorization.
31
+ def expire(authorization, params = {}, opts = {})
32
+ request(
33
+ method: :post,
34
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/expire", { authorization: CGI.escape(authorization) }),
35
+ params: params,
36
+ opts: opts,
37
+ base_address: :api
38
+ )
39
+ end
40
+
41
+ # Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.
42
+ def finalize_amount(authorization, params = {}, opts = {})
43
+ request(
44
+ method: :post,
45
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/finalize_amount", { authorization: CGI.escape(authorization) }),
46
+ params: params,
47
+ opts: opts,
48
+ base_address: :api
49
+ )
50
+ end
51
+
52
+ # Increment a test-mode Authorization.
53
+ def increment(authorization, params = {}, opts = {})
54
+ request(
55
+ method: :post,
56
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/increment", { authorization: CGI.escape(authorization) }),
57
+ params: params,
58
+ opts: opts,
59
+ base_address: :api
60
+ )
61
+ end
62
+
63
+ # Reverse a test-mode Authorization.
64
+ def reverse(authorization, params = {}, opts = {})
65
+ request(
66
+ method: :post,
67
+ path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/reverse", { authorization: CGI.escape(authorization) }),
68
+ params: params,
69
+ opts: opts,
70
+ base_address: :api
71
+ )
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,65 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module TestHelpers
6
+ module Issuing
7
+ class CardService < StripeService
8
+ # Updates the shipping status of the specified Issuing Card object to delivered.
9
+ def deliver_card(card, params = {}, opts = {})
10
+ request(
11
+ method: :post,
12
+ path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/deliver", { card: CGI.escape(card) }),
13
+ params: params,
14
+ opts: opts,
15
+ base_address: :api
16
+ )
17
+ end
18
+
19
+ # Updates the shipping status of the specified Issuing Card object to failure.
20
+ def fail_card(card, params = {}, opts = {})
21
+ request(
22
+ method: :post,
23
+ path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/fail", { card: CGI.escape(card) }),
24
+ params: params,
25
+ opts: opts,
26
+ base_address: :api
27
+ )
28
+ end
29
+
30
+ # Updates the shipping status of the specified Issuing Card object to returned.
31
+ def return_card(card, params = {}, opts = {})
32
+ request(
33
+ method: :post,
34
+ path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/return", { card: CGI.escape(card) }),
35
+ params: params,
36
+ opts: opts,
37
+ base_address: :api
38
+ )
39
+ end
40
+
41
+ # Updates the shipping status of the specified Issuing Card object to shipped.
42
+ def ship_card(card, params = {}, opts = {})
43
+ request(
44
+ method: :post,
45
+ path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/ship", { card: CGI.escape(card) }),
46
+ params: params,
47
+ opts: opts,
48
+ base_address: :api
49
+ )
50
+ end
51
+
52
+ # Updates the shipping status of the specified Issuing Card object to submitted. This method is only available with Stripe Version ‘2024-09-30.acacia' or above.
53
+ def submit_card(card, params = {}, opts = {})
54
+ request(
55
+ method: :post,
56
+ path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/submit", { card: CGI.escape(card) }),
57
+ params: params,
58
+ opts: opts,
59
+ base_address: :api
60
+ )
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end