Sha256: 55cdbf9e80cc974dca06190899fa4b412e9f6dde2df8ce7b370a6bc2dff4fe08

Contents?: true

Size: 1.16 KB

Versions: 9

Compression:

Stored size: 1.16 KB

Contents

# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
  module Tax
    # A Tax Calculation allows you to calculate the tax to collect from your customer.
    #
    # Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom)
    class Calculation < APIResource
      extend Stripe::APIOperations::Create

      OBJECT_NAME = "tax.calculation"

      # Retrieves the line items of a persisted tax calculation as a collection.
      def list_line_items(params = {}, opts = {})
        request_stripe_object(
          method: :get,
          path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(self["id"]) }),
          params: params,
          opts: opts
        )
      end

      # Retrieves the line items of a persisted tax calculation as a collection.
      def self.list_line_items(calculation, params = {}, opts = {})
        request_stripe_object(
          method: :get,
          path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(calculation) }),
          params: params,
          opts: opts
        )
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
stripe-10.7.1 lib/stripe/resources/tax/calculation.rb
stripe-10.8.0.pre.beta.1 lib/stripe/resources/tax/calculation.rb
stripe-10.7.0 lib/stripe/resources/tax/calculation.rb
stripe-10.7.0.pre.beta.3 lib/stripe/resources/tax/calculation.rb
stripe-10.7.0.pre.beta.2 lib/stripe/resources/tax/calculation.rb
stripe-10.7.0.pre.beta.1 lib/stripe/resources/tax/calculation.rb
stripe-10.6.0 lib/stripe/resources/tax/calculation.rb
stripe-10.6.0.pre.beta.1 lib/stripe/resources/tax/calculation.rb
stripe-10.5.0 lib/stripe/resources/tax/calculation.rb