stripe 18.2.0.pre.alpha.1 → 18.2.0.pre.alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_requestor.rb +1 -1
  3. data/lib/stripe/object_types.rb +1 -0
  4. data/lib/stripe/params/checkout/session_create_params.rb +4 -1
  5. data/lib/stripe/params/checkout/session_update_params.rb +4 -1
  6. data/lib/stripe/params/invoice_add_lines_params.rb +4 -1
  7. data/lib/stripe/params/invoice_create_preview_params.rb +2 -2
  8. data/lib/stripe/params/invoice_line_item_update_params.rb +4 -1
  9. data/lib/stripe/params/invoice_update_lines_params.rb +4 -1
  10. data/lib/stripe/params/payment_link_create_params.rb +4 -1
  11. data/lib/stripe/params/plan_create_params.rb +16 -1
  12. data/lib/stripe/params/price_create_params.rb +16 -1
  13. data/lib/stripe/params/product_create_params.rb +4 -1
  14. data/lib/stripe/params/product_update_params.rb +4 -1
  15. data/lib/stripe/params/quote_create_params.rb +3 -3
  16. data/lib/stripe/params/quote_update_params.rb +3 -3
  17. data/lib/stripe/params/shared_payment/{granted_token_update_params.rb → granted_token_revoke_params.rb} +1 -1
  18. data/lib/stripe/params/subscription_pause_params.rb +33 -0
  19. data/lib/stripe/params/subscription_schedule_amend_params.rb +1 -1
  20. data/lib/stripe/params/subscription_schedule_create_params.rb +2 -2
  21. data/lib/stripe/params/subscription_schedule_update_params.rb +2 -2
  22. data/lib/stripe/params/tax/calculation_create_params.rb +5 -1
  23. data/lib/stripe/params/tax/location_create_params.rb +54 -0
  24. data/lib/stripe/params/tax/location_list_params.rb +27 -0
  25. data/lib/stripe/params/tax/location_retrieve_params.rb +15 -0
  26. data/lib/stripe/params/test_helpers/shared_payment/{granted_token_update_params.rb → granted_token_revoke_params.rb} +1 -1
  27. data/lib/stripe/params.rb +6 -2
  28. data/lib/stripe/resources/invoice.rb +2 -0
  29. data/lib/stripe/resources/plan.rb +2 -0
  30. data/lib/stripe/resources/price.rb +2 -0
  31. data/lib/stripe/resources/quote.rb +2 -2
  32. data/lib/stripe/resources/quote_line.rb +1 -1
  33. data/lib/stripe/resources/quote_preview_invoice.rb +2 -0
  34. data/lib/stripe/resources/shared_payment/granted_token.rb +2 -2
  35. data/lib/stripe/resources/subscription.rb +20 -0
  36. data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
  37. data/lib/stripe/resources/tax/location.rb +72 -0
  38. data/lib/stripe/resources/tax/registration.rb +128 -0
  39. data/lib/stripe/resources/tax_code.rb +15 -1
  40. data/lib/stripe/resources.rb +1 -0
  41. data/lib/stripe/services/subscription_service.rb +11 -0
  42. data/lib/stripe/services/tax/location_service.rb +45 -0
  43. data/lib/stripe/services/tax_service.rb +2 -1
  44. data/lib/stripe/services/test_helpers/shared_payment/granted_token_service.rb +1 -1
  45. data/lib/stripe/services.rb +1 -0
  46. data/lib/stripe/util.rb +9 -3
  47. data/lib/stripe/version.rb +1 -1
  48. data/rbi/stripe.rbi +604 -67
  49. metadata +10 -4
@@ -732,7 +732,7 @@ module Stripe
732
732
  attr_reader :from_subscription
733
733
  # Set of [key-value pairs](https://docs.stripe.com/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
734
734
  attr_reader :metadata
735
- # Configures how the quote handles billing for line transitions. Possible values are `line_start` (default) or `billing_period_start`. `line_start` bills based on the current state of the line, ignoring changes scheduled for future lines. `billing_period_start` bills predictively for upcoming line transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.
735
+ # Configures how the subscription schedule handles billing for phase transitions when the quote is accepted.
736
736
  attr_reader :phase_effective_at
737
737
  # If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
738
738
  attr_reader :prebilling
@@ -991,7 +991,7 @@ module Stripe
991
991
  attr_reader :description
992
992
  # Behavior of the subscription schedule and underlying subscription when it ends.
993
993
  attr_reader :end_behavior
994
- # Configures how the quote handles billing for line transitions. Possible values are `line_start` (default) or `billing_period_start`. `line_start` bills based on the current state of the line, ignoring changes scheduled for future lines. `billing_period_start` bills predictively for upcoming line transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.
994
+ # Configures how the subscription schedule handles billing for phase transitions when the quote is accepted.
995
995
  attr_reader :phase_effective_at
996
996
  # Determines how to handle [prorations](https://docs.stripe.com/subscriptions/billing-cycle#prorations) when the quote is accepted.
997
997
  attr_reader :proration_behavior
@@ -489,7 +489,7 @@ module Stripe
489
489
  attr_reader :billing_cycle_anchor
490
490
  # A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
491
491
  attr_reader :cancel_subscription_schedule
492
- # Configures how the subscription schedule handles billing for phase transitions. Possible values are `phase_start` (default) or `billing_period_start`. `phase_start` bills based on the current state of the subscription, ignoring changes scheduled in future phases. `billing_period_start` bills predictively for upcoming phase transitions within the current billing cycle, including pricing changes and service period adjustments that will occur before the next invoice.
492
+ # Configures how the subscription schedule handles billing for phase transitions.
493
493
  attr_reader :effective_at
494
494
  # Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
495
495
  attr_reader :ends_at
@@ -367,6 +367,8 @@ module Stripe
367
367
  class ScheduleDetails < ::Stripe::StripeObject
368
368
  # The schedule that generated this invoice
369
369
  attr_reader :schedule
370
+ # The subscription associated with this schedule
371
+ attr_reader :subscription
370
372
 
371
373
  def self.inner_class_types
372
374
  @inner_class_types = {}
@@ -94,7 +94,7 @@ module Stripe
94
94
  end
95
95
 
96
96
  # Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
97
- def self.update(shared_payment_granted_token, params = {}, opts = {})
97
+ def self.revoke(shared_payment_granted_token, params = {}, opts = {})
98
98
  request_stripe_object(
99
99
  method: :post,
100
100
  path: format("/v1/test_helpers/shared_payment/granted_tokens/%<shared_payment_granted_token>s/revoke", { shared_payment_granted_token: CGI.escape(shared_payment_granted_token) }),
@@ -104,7 +104,7 @@ module Stripe
104
104
  end
105
105
 
106
106
  # Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
107
- def update(params = {}, opts = {})
107
+ def revoke(params = {}, opts = {})
108
108
  @resource.request_stripe_object(
109
109
  method: :post,
110
110
  path: format("/v1/test_helpers/shared_payment/granted_tokens/%<shared_payment_granted_token>s/revoke", { shared_payment_granted_token: CGI.escape(@resource["id"]) }),
@@ -936,6 +936,26 @@ module Stripe
936
936
  )
937
937
  end
938
938
 
939
+ # Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
940
+ def pause(params = {}, opts = {})
941
+ request_stripe_object(
942
+ method: :post,
943
+ path: format("/v1/subscriptions/%<subscription>s/pause", { subscription: CGI.escape(self["id"]) }),
944
+ params: params,
945
+ opts: opts
946
+ )
947
+ end
948
+
949
+ # Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
950
+ def self.pause(subscription, params = {}, opts = {})
951
+ request_stripe_object(
952
+ method: :post,
953
+ path: format("/v1/subscriptions/%<subscription>s/pause", { subscription: CGI.escape(subscription) }),
954
+ params: params,
955
+ opts: opts
956
+ )
957
+ end
958
+
939
959
  # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
940
960
  def resume(params = {}, opts = {})
941
961
  request_stripe_object(
@@ -90,6 +90,8 @@ module Stripe
90
90
  attr_reader :tax_breakdown
91
91
  # The [tax code](https://docs.stripe.com/tax/tax-categories) ID used for this resource.
92
92
  attr_reader :tax_code
93
+ # A tax location for a line item that acts as a performance location. This indicates that the line item might be taxed at the place where it is being performed at. This is helpful for events or other services being performed at non-customer addresses like venues or offices. This can be left empty for tax codes that do not require a tax location. For tax codes where the location requirement is "optional", this would override the customer address in most use cases.
94
+ attr_reader :performance_location
93
95
 
94
96
  def self.inner_class_types
95
97
  @inner_class_types = { tax_breakdown: TaxBreakdown }
@@ -0,0 +1,72 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Tax
6
+ # Tax locations represent venues for services, tickets, or other product types.
7
+ class Location < APIResource
8
+ extend Stripe::APIOperations::Create
9
+ extend Stripe::APIOperations::List
10
+
11
+ OBJECT_NAME = "tax.location"
12
+ def self.object_name
13
+ "tax.location"
14
+ end
15
+
16
+ class Address < ::Stripe::StripeObject
17
+ # City, district, suburb, town, or village.
18
+ attr_reader :city
19
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
20
+ attr_reader :country
21
+ # Address line 1, such as the street, PO Box, or company name.
22
+ attr_reader :line1
23
+ # Address line 2, such as the apartment, suite, unit, or building.
24
+ attr_reader :line2
25
+ # ZIP or postal code.
26
+ attr_reader :postal_code
27
+ # State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
28
+ attr_reader :state
29
+
30
+ def self.inner_class_types
31
+ @inner_class_types = {}
32
+ end
33
+
34
+ def self.field_remappings
35
+ @field_remappings = {}
36
+ end
37
+ end
38
+ # Attribute for field address
39
+ attr_reader :address
40
+ # A descriptive text providing additional context about the tax location. This can include information about the venue, types of events held, services available, or any relevant details for better identification (e.g., "A spacious auditorium suitable for large concerts and events.").
41
+ attr_reader :description
42
+ # Unique identifier for the object.
43
+ attr_reader :id
44
+ # String representing the object's type. Objects of the same type share the same value.
45
+ attr_reader :object
46
+ # The type of tax location to be defined. Currently the only option is `performance`.
47
+ attr_reader :type
48
+
49
+ # Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location.
50
+ def self.create(params = {}, opts = {})
51
+ request_stripe_object(method: :post, path: "/v1/tax/locations", params: params, opts: opts)
52
+ end
53
+
54
+ # Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types.
55
+ #
56
+ # The response includes detailed information for each tax location, such as its address, name, description, and current operational status.
57
+ #
58
+ # You can paginate through the list by using the limit parameter to control the number of results returned in each request.
59
+ def self.list(params = {}, opts = {})
60
+ request_stripe_object(method: :get, path: "/v1/tax/locations", params: params, opts: opts)
61
+ end
62
+
63
+ def self.inner_class_types
64
+ @inner_class_types = { address: Address }
65
+ end
66
+
67
+ def self.field_remappings
68
+ @field_remappings = {}
69
+ end
70
+ end
71
+ end
72
+ end
@@ -1733,6 +1733,71 @@ module Stripe
1733
1733
  end
1734
1734
 
1735
1735
  class Us < ::Stripe::StripeObject
1736
+ class AdmissionsTax < ::Stripe::StripeObject
1737
+ # A [jurisdiction code](https://docs.stripe.com/tax/registering?type=admissions_tax#registration-types) representing the local jurisdiction.
1738
+ attr_reader :jurisdiction
1739
+
1740
+ def self.inner_class_types
1741
+ @inner_class_types = {}
1742
+ end
1743
+
1744
+ def self.field_remappings
1745
+ @field_remappings = {}
1746
+ end
1747
+ end
1748
+
1749
+ class AttendanceTax < ::Stripe::StripeObject
1750
+ # A [jurisdiction code](https://docs.stripe.com/tax/registering?type=attendance_tax#registration-types) representing the local jurisdiction.
1751
+ attr_reader :jurisdiction
1752
+
1753
+ def self.inner_class_types
1754
+ @inner_class_types = {}
1755
+ end
1756
+
1757
+ def self.field_remappings
1758
+ @field_remappings = {}
1759
+ end
1760
+ end
1761
+
1762
+ class EntertainmentTax < ::Stripe::StripeObject
1763
+ # A [jurisdiction code](https://docs.stripe.com/tax/registering?type=entertainment_tax#registration-types) representing the local jurisdiction.
1764
+ attr_reader :jurisdiction
1765
+
1766
+ def self.inner_class_types
1767
+ @inner_class_types = {}
1768
+ end
1769
+
1770
+ def self.field_remappings
1771
+ @field_remappings = {}
1772
+ end
1773
+ end
1774
+
1775
+ class GrossReceiptsTax < ::Stripe::StripeObject
1776
+ # A [jurisdiction code](https://docs.stripe.com/tax/registering?type=gross_receipts_tax#registration-types) representing the local jurisdiction.
1777
+ attr_reader :jurisdiction
1778
+
1779
+ def self.inner_class_types
1780
+ @inner_class_types = {}
1781
+ end
1782
+
1783
+ def self.field_remappings
1784
+ @field_remappings = {}
1785
+ end
1786
+ end
1787
+
1788
+ class HospitalityTax < ::Stripe::StripeObject
1789
+ # A [jurisdiction code](https://docs.stripe.com/tax/registering?type=hospitality_tax#registration-types) representing the local jurisdiction.
1790
+ attr_reader :jurisdiction
1791
+
1792
+ def self.inner_class_types
1793
+ @inner_class_types = {}
1794
+ end
1795
+
1796
+ def self.field_remappings
1797
+ @field_remappings = {}
1798
+ end
1799
+ end
1800
+
1736
1801
  class LocalAmusementTax < ::Stripe::StripeObject
1737
1802
  # A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction.
1738
1803
  attr_reader :jurisdiction
@@ -1759,6 +1824,32 @@ module Stripe
1759
1824
  end
1760
1825
  end
1761
1826
 
1827
+ class LuxuryTax < ::Stripe::StripeObject
1828
+ # A [jurisdiction code](https://docs.stripe.com/tax/registering?type=luxury_tax#registration-types) representing the local jurisdiction.
1829
+ attr_reader :jurisdiction
1830
+
1831
+ def self.inner_class_types
1832
+ @inner_class_types = {}
1833
+ end
1834
+
1835
+ def self.field_remappings
1836
+ @field_remappings = {}
1837
+ end
1838
+ end
1839
+
1840
+ class ResortTax < ::Stripe::StripeObject
1841
+ # A [jurisdiction code](https://docs.stripe.com/tax/registering?type=resort_tax#registration-types) representing the local jurisdiction.
1842
+ attr_reader :jurisdiction
1843
+
1844
+ def self.inner_class_types
1845
+ @inner_class_types = {}
1846
+ end
1847
+
1848
+ def self.field_remappings
1849
+ @field_remappings = {}
1850
+ end
1851
+ end
1852
+
1762
1853
  class StateSalesTax < ::Stripe::StripeObject
1763
1854
  class Election < ::Stripe::StripeObject
1764
1855
  # A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction.
@@ -1785,6 +1876,19 @@ module Stripe
1785
1876
  @field_remappings = {}
1786
1877
  end
1787
1878
  end
1879
+
1880
+ class TourismTax < ::Stripe::StripeObject
1881
+ # A [jurisdiction code](https://docs.stripe.com/tax/registering?type=tourism_tax#registration-types) representing the local jurisdiction.
1882
+ attr_reader :jurisdiction
1883
+
1884
+ def self.inner_class_types
1885
+ @inner_class_types = {}
1886
+ end
1887
+
1888
+ def self.field_remappings
1889
+ @field_remappings = {}
1890
+ end
1891
+ end
1788
1892
  # Attribute for field local_amusement_tax
1789
1893
  attr_reader :local_amusement_tax
1790
1894
  # Attribute for field local_lease_tax
@@ -1795,12 +1899,36 @@ module Stripe
1795
1899
  attr_reader :state_sales_tax
1796
1900
  # Type of registration in the US.
1797
1901
  attr_reader :type
1902
+ # Attribute for field admissions_tax
1903
+ attr_reader :admissions_tax
1904
+ # Attribute for field attendance_tax
1905
+ attr_reader :attendance_tax
1906
+ # Attribute for field entertainment_tax
1907
+ attr_reader :entertainment_tax
1908
+ # Attribute for field gross_receipts_tax
1909
+ attr_reader :gross_receipts_tax
1910
+ # Attribute for field hospitality_tax
1911
+ attr_reader :hospitality_tax
1912
+ # Attribute for field luxury_tax
1913
+ attr_reader :luxury_tax
1914
+ # Attribute for field resort_tax
1915
+ attr_reader :resort_tax
1916
+ # Attribute for field tourism_tax
1917
+ attr_reader :tourism_tax
1798
1918
 
1799
1919
  def self.inner_class_types
1800
1920
  @inner_class_types = {
1801
1921
  local_amusement_tax: LocalAmusementTax,
1802
1922
  local_lease_tax: LocalLeaseTax,
1803
1923
  state_sales_tax: StateSalesTax,
1924
+ admissions_tax: AdmissionsTax,
1925
+ attendance_tax: AttendanceTax,
1926
+ entertainment_tax: EntertainmentTax,
1927
+ gross_receipts_tax: GrossReceiptsTax,
1928
+ hospitality_tax: HospitalityTax,
1929
+ luxury_tax: LuxuryTax,
1930
+ resort_tax: ResortTax,
1931
+ tourism_tax: TourismTax,
1804
1932
  }
1805
1933
  end
1806
1934
 
@@ -11,6 +11,18 @@ module Stripe
11
11
  "tax_code"
12
12
  end
13
13
 
14
+ class Requirements < ::Stripe::StripeObject
15
+ # Describes whether a performance location is required for a successful tax calculation with a tax code.
16
+ attr_reader :performance_location
17
+
18
+ def self.inner_class_types
19
+ @inner_class_types = {}
20
+ end
21
+
22
+ def self.field_remappings
23
+ @field_remappings = {}
24
+ end
25
+ end
14
26
  # A detailed description of which types of products the tax code represents.
15
27
  attr_reader :description
16
28
  # Unique identifier for the object.
@@ -19,6 +31,8 @@ module Stripe
19
31
  attr_reader :name
20
32
  # String representing the object's type. Objects of the same type share the same value.
21
33
  attr_reader :object
34
+ # An object that describes more information about the tax location required for this tax code. Some [tax codes](/tax/tax-for-tickets/integration-guide#types-of-products) require a tax location of type `performance` to calculate tax correctly.
35
+ attr_reader :requirements
22
36
 
23
37
  # 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.
24
38
  def self.list(params = {}, opts = {})
@@ -26,7 +40,7 @@ module Stripe
26
40
  end
27
41
 
28
42
  def self.inner_class_types
29
- @inner_class_types = {}
43
+ @inner_class_types = { requirements: Requirements }
30
44
  end
31
45
 
32
46
  def self.field_remappings
@@ -144,6 +144,7 @@ require "stripe/resources/tax/association"
144
144
  require "stripe/resources/tax/calculation"
145
145
  require "stripe/resources/tax/calculation_line_item"
146
146
  require "stripe/resources/tax/form"
147
+ require "stripe/resources/tax/location"
147
148
  require "stripe/resources/tax/registration"
148
149
  require "stripe/resources/tax/settings"
149
150
  require "stripe/resources/tax/transaction"
@@ -79,6 +79,17 @@ module Stripe
79
79
  )
80
80
  end
81
81
 
82
+ # Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
83
+ def pause(subscription, params = {}, opts = {})
84
+ request(
85
+ method: :post,
86
+ path: format("/v1/subscriptions/%<subscription>s/pause", { subscription: CGI.escape(subscription) }),
87
+ params: params,
88
+ opts: opts,
89
+ base_address: :api
90
+ )
91
+ end
92
+
82
93
  # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
83
94
  def resume(subscription, params = {}, opts = {})
84
95
  request(
@@ -0,0 +1,45 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module Tax
6
+ class LocationService < StripeService
7
+ # Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location.
8
+ def create(params = {}, opts = {})
9
+ request(
10
+ method: :post,
11
+ path: "/v1/tax/locations",
12
+ params: params,
13
+ opts: opts,
14
+ base_address: :api
15
+ )
16
+ end
17
+
18
+ # Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types.
19
+ #
20
+ # The response includes detailed information for each tax location, such as its address, name, description, and current operational status.
21
+ #
22
+ # You can paginate through the list by using the limit parameter to control the number of results returned in each request.
23
+ def list(params = {}, opts = {})
24
+ request(
25
+ method: :get,
26
+ path: "/v1/tax/locations",
27
+ params: params,
28
+ opts: opts,
29
+ base_address: :api
30
+ )
31
+ end
32
+
33
+ # Fetch the details of a specific tax location using its unique identifier. Use a tax location to calculate taxes based on the location of the end product, such as a performance, instead of the customer address. For more details, check the [integration guide](https://docs.stripe.com/tax/tax-for-tickets/integration-guide).
34
+ def retrieve(location, params = {}, opts = {})
35
+ request(
36
+ method: :get,
37
+ path: format("/v1/tax/locations/%<location>s", { location: CGI.escape(location) }),
38
+ params: params,
39
+ opts: opts,
40
+ base_address: :api
41
+ )
42
+ end
43
+ end
44
+ end
45
+ end
@@ -3,13 +3,14 @@
3
3
 
4
4
  module Stripe
5
5
  class TaxService < StripeService
6
- attr_reader :associations, :calculations, :forms, :registrations, :settings, :transactions
6
+ attr_reader :associations, :calculations, :forms, :locations, :registrations, :settings, :transactions
7
7
 
8
8
  def initialize(requestor)
9
9
  super
10
10
  @associations = Stripe::Tax::AssociationService.new(@requestor)
11
11
  @calculations = Stripe::Tax::CalculationService.new(@requestor)
12
12
  @forms = Stripe::Tax::FormService.new(@requestor)
13
+ @locations = Stripe::Tax::LocationService.new(@requestor)
13
14
  @registrations = Stripe::Tax::RegistrationService.new(@requestor)
14
15
  @settings = Stripe::Tax::SettingsService.new(@requestor)
15
16
  @transactions = Stripe::Tax::TransactionService.new(@requestor)
@@ -17,7 +17,7 @@ module Stripe
17
17
  end
18
18
 
19
19
  # Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration
20
- def update(shared_payment_granted_token, params = {}, opts = {})
20
+ def revoke(shared_payment_granted_token, params = {}, opts = {})
21
21
  request(
22
22
  method: :post,
23
23
  path: format("/v1/test_helpers/shared_payment/granted_tokens/%<shared_payment_granted_token>s/revoke", { shared_payment_granted_token: CGI.escape(shared_payment_granted_token) }),
@@ -159,6 +159,7 @@ require "stripe/services/tax/association_service"
159
159
  require "stripe/services/tax/calculation_line_item_service"
160
160
  require "stripe/services/tax/calculation_service"
161
161
  require "stripe/services/tax/form_service"
162
+ require "stripe/services/tax/location_service"
162
163
  require "stripe/services/tax/registration_service"
163
164
  require "stripe/services/tax/settings_service"
164
165
  require "stripe/services/tax/transaction_line_item_service"
data/lib/stripe/util.rb CHANGED
@@ -7,16 +7,22 @@ module Stripe
7
7
  LEGAL_FIRST_CHARACTER = /[a-zA-Z_]/.freeze
8
8
  LEGAL_VARIABLE_CHARACTER = /[a-zA-Z0-9_]/.freeze
9
9
 
10
- def self.objects_to_ids(obj)
10
+ def self.objects_to_ids(obj, semantics)
11
11
  case obj
12
12
  when APIResource
13
13
  obj.id
14
14
  when Hash
15
15
  res = {}
16
- obj.each { |k, v| res[k] = objects_to_ids(v) unless v.nil? }
16
+ obj.each do |k, v|
17
+ if !v.nil?
18
+ res[k] = objects_to_ids(v, semantics)
19
+ elsif semantics == :v2
20
+ res[k] = nil
21
+ end
22
+ end
17
23
  res
18
24
  when Array
19
- obj.map { |v| objects_to_ids(v) }
25
+ obj.map { |v| objects_to_ids(v, semantics) }
20
26
  else
21
27
  obj
22
28
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "18.2.0-alpha.1"
4
+ VERSION = "18.2.0-alpha.2"
5
5
  end