Sha256: a2163632fe1d18f6400d28f8f2e39326bd29375e69daf2fdf6e9aa14f6a53964

Contents?: true

Size: 811 Bytes

Versions: 16

Compression:

Stored size: 811 Bytes

Contents

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 = {})
      params[:subscription_items] = Util.array_to_hash(params[:subscription_items]) if params[:subscription_items]
      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

16 entries across 16 versions & 1 rubygems

Version Path
stripe-3.14.0 lib/stripe/invoice.rb
stripe-3.13.1 lib/stripe/invoice.rb
stripe-3.13.0 lib/stripe/invoice.rb
stripe-3.12.1 lib/stripe/invoice.rb
stripe-3.12.0 lib/stripe/invoice.rb
stripe-3.11.0 lib/stripe/invoice.rb
stripe-3.10.0 lib/stripe/invoice.rb
stripe-3.9.2 lib/stripe/invoice.rb
stripe-3.9.1 lib/stripe/invoice.rb
stripe-3.9.0 lib/stripe/invoice.rb
stripe-3.8.2 lib/stripe/invoice.rb
stripe-3.8.1 lib/stripe/invoice.rb
stripe-3.8.0 lib/stripe/invoice.rb
stripe-3.7.0 lib/stripe/invoice.rb
stripe-3.6.0 lib/stripe/invoice.rb
stripe-3.5.3 lib/stripe/invoice.rb