Sha256: fde2c9e1aea9b69d42a374f5a09a0ad9b59c441fddb896e3def58dcfd97e018a

Contents?: true

Size: 946 Bytes

Versions: 1

Compression:

Stored size: 946 Bytes

Contents

module Stripe
  class FileUpload < APIResource
    UPLOADS_API_BASE = "https://uploads.stripe.com"

    def self.url
      "/v1/files"
    end

    def self.request_headers
      {
        :content_type => 'multipart/form-data',
      }
    end

    def self.create(params={}, api_key=nil)
      response, api_key = Stripe.request(
        :post, self.url, api_key, params, self.request_headers, UPLOADS_API_BASE)
      Util.convert_to_stripe_object(response, api_key)
    end

    def self.all(filters={}, opts={})
      api_key, headers = Util.parse_opts(opts)
      response, api_key = Stripe.request(
        :get, self.url, api_key, filters, headers, UPLOADS_API_BASE)
      Util.convert_to_stripe_object(response, api_key)
    end

    def refresh
      response, api_key = Stripe.request(
        :get, url, @api_key, @retrieve_options, self.class.request_headers, UPLOADS_API_BASE)
      refresh_from(response, api_key)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stripe-1.18.0 lib/stripe/file_upload.rb