Sha256: c6592d7b902c86b63495719186cb34e51f52d4f31ff02acb44c70b2141acffd4

Contents?: true

Size: 1.37 KB

Versions: 22

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

module Stripe
  class Invoice < APIResource
    extend Stripe::APIOperations::List
    include Stripe::APIOperations::Save
    include Stripe::APIOperations::Delete
    extend Stripe::APIOperations::Create

    OBJECT_NAME = "invoice".freeze

    def finalize_invoice(params = {}, opts = {})
      url = resource_url + "/finalize"
      resp, opts = request(:post, url, params, opts)
      initialize_from(resp.data, opts)
    end

    def mark_uncollectible(params = {}, opts = {})
      url = resource_url + "/mark_uncollectible"
      resp, opts = request(:post, url, params, opts)
      initialize_from(resp.data, opts)
    end

    def pay(params = {}, opts = {})
      url = resource_url + "/pay"
      resp, opts = request(:post, url, params, opts)
      initialize_from(resp.data, opts)
    end

    def send_invoice(params = {}, opts = {})
      url = resource_url + "/send"
      resp, opts = request(:post, url, params, opts)
      initialize_from(resp.data, opts)
    end

    def self.upcoming(params, opts = {})
      url = resource_url + "/upcoming"
      resp, opts = request(:get, url, params, opts)
      Util.convert_to_stripe_object(resp.data, opts)
    end

    def void_invoice(params = {}, opts = {})
      url = resource_url + "/void"
      resp, opts = request(:post, url, params, opts)
      initialize_from(resp.data, opts)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
stripe-4.11.0 lib/stripe/invoice.rb
stripe-4.10.0 lib/stripe/invoice.rb
stripe-4.9.1 lib/stripe/invoice.rb
stripe-4.9.0 lib/stripe/invoice.rb
stripe-4.8.1 lib/stripe/invoice.rb
stripe-4.8.0 lib/stripe/invoice.rb
stripe-4.7.1 lib/stripe/invoice.rb
stripe-4.7.0 lib/stripe/invoice.rb
stripe-4.6.0 lib/stripe/invoice.rb
stripe-4.5.0 lib/stripe/invoice.rb
stripe-4.4.1 lib/stripe/invoice.rb
stripe-4.4.0 lib/stripe/invoice.rb
stripe-4.3.0 lib/stripe/invoice.rb
stripe-4.2.0 lib/stripe/invoice.rb
stripe-4.1.0 lib/stripe/invoice.rb
stripe-4.0.3 lib/stripe/invoice.rb
stripe-4.0.2 lib/stripe/invoice.rb
stripe-4.0.1 lib/stripe/invoice.rb
stripe-4.0.0 lib/stripe/invoice.rb
stripe-3.31.1 lib/stripe/invoice.rb