Sha256: c054dbed3996ba50d807ad884f365908a5b40bc857b265d86ea57de52f87d3fd

Contents?: true

Size: 1.32 KB

Versions: 5

Compression:

Stored size: 1.32 KB

Contents

# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
  module Tax
    # Tax forms are legal documents which are delivered to one or more tax authorities for information reporting purposes.
    #
    # Related guide: [US tax reporting for Connect platforms](https://stripe.com/docs/connect/tax-reporting)
    class Form < APIResource
      extend Stripe::APIOperations::List

      OBJECT_NAME = "tax.form"

      # Download the PDF for a tax form.
      def pdf(params = {}, opts = {}, &read_body_chunk_block)
        config = opts[:client]&.config || Stripe.config
        opts = { api_base: config.uploads_base }.merge(opts)
        request_stream(
          method: :get,
          path: format("/v1/tax/forms/%<id>s/pdf", { id: CGI.escape(self["id"]) }),
          params: params,
          opts: opts,
          &read_body_chunk_block
        )
      end

      # Download the PDF for a tax form.
      def self.pdf(id, params = {}, opts = {}, &read_body_chunk_block)
        config = opts[:client]&.config || Stripe.config
        opts = { api_base: config.uploads_base }.merge(opts)
        execute_resource_request_stream(
          :get,
          format("/v1/tax/forms/%<id>s/pdf", { id: CGI.escape(id) }),
          params,
          opts,
          &read_body_chunk_block
        )
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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