Sha256: 71a6c28b30ee126157cee953807ed8b5e9e7e7c6689f1efc2c62072a5ccd9f38

Contents?: true

Size: 727 Bytes

Versions: 9

Compression:

Stored size: 727 Bytes

Contents

# frozen_string_literal: true

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

    OBJECT_NAME = "invoice".freeze

    def self.upcoming(params, opts = {})
      resp, opts = request(:get, upcoming_url, params, opts)
      Util.convert_to_stripe_object(resp.data, opts)
    end

    def pay(params = {}, opts = {})
      resp, opts = request(:post, pay_url, params, opts)
      initialize_from(resp.data, opts)
    end

    def self.upcoming_url
      resource_url + "/upcoming"
    end
    private_class_method :upcoming_url

    def pay_url
      resource_url + "/pay"
    end
    private :pay_url
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
stripe-3.29.0 lib/stripe/invoice.rb
stripe-3.28.0 lib/stripe/invoice.rb
stripe-3.27.0 lib/stripe/invoice.rb
stripe-3.26.1 lib/stripe/invoice.rb
stripe-3.26.0 lib/stripe/invoice.rb
stripe-3.25.0 lib/stripe/invoice.rb
stripe-3.24.0 lib/stripe/invoice.rb
stripe-3.23.0 lib/stripe/invoice.rb
stripe-3.22.0 lib/stripe/invoice.rb