Class: Stripe::Tax::SettingsService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::Tax::SettingsService
- Defined in:
- lib/stripe/services/tax/settings_service.rb
Instance Method Summary collapse
-
#retrieve(params = {}, opts = {}) ⇒ Object
Retrieves Tax Settings for a merchant.
-
#serialize_batch_update(params = {}, opts = {}) ⇒ Object
Serializes a Settings update request into a batch job JSONL line.
-
#update(params = {}, opts = {}) ⇒ Object
Updates Tax Settings parameters used in tax calculations.
Methods inherited from StripeService
#initialize, #request, #request_stream
Constructor Details
This class inherits a constructor from Stripe::StripeService
Instance Method Details
#retrieve(params = {}, opts = {}) ⇒ Object
Retrieves Tax Settings for a merchant.
8 9 10 11 12 13 14 15 16 |
# File 'lib/stripe/services/tax/settings_service.rb', line 8 def retrieve(params = {}, opts = {}) request( method: :get, path: "/v1/tax/settings", params: params, opts: opts, base_address: :api ) end |
#serialize_batch_update(params = {}, opts = {}) ⇒ Object
Serializes a Settings update request into a batch job JSONL line.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/stripe/services/tax/settings_service.rb', line 19 def serialize_batch_update(params = {}, opts = {}) request_id = SecureRandom.uuid stripe_version = opts[:stripe_version] || Stripe.api_version request_body = { id: request_id, params: params, stripe_version: stripe_version, } request_body[:context] = opts[:stripe_context] if opts[:stripe_context] JSON.generate(request_body) end |
#update(params = {}, opts = {}) ⇒ Object
Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set.
33 34 35 36 37 38 39 40 41 |
# File 'lib/stripe/services/tax/settings_service.rb', line 33 def update(params = {}, opts = {}) request( method: :post, path: "/v1/tax/settings", params: params, opts: opts, base_address: :api ) end |