Sha256: 420eaea3d1ead1a473d8017f7a589a04cbbdcc2bbb5d41e3e51cd395908827e5

Contents?: true

Size: 852 Bytes

Versions: 9

Compression:

Stored size: 852 Bytes

Contents

module Recurly
  class Charge < Base
    self.element_name = "charge"
    self.prefix = "/accounts/:account_code/"

    def self.known_attributes
      [
        "account_code",
        "quantity",
        "unit_amount_in_cents",
        "amount_in_cents", # quantity * unit_amount_in_cents
        "start_date",
        "end_date",
        "description",
        "created_at"
      ]
    end

    def self.list(account_code, status = :all)
      params = {:account_code => account_code}

      if status != :all
        params[:show] = status.to_s
      end

      find(:all, :params => params)
    end

    def self.lookup(account_code, id)
      find(id, :params => { :account_code => account_code })
    end

    # def destroy
    #   reload
    #   return false if respond_to?(:invoice_id) and invoice_id.present?
    #   super
    # end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
recurly-0.4.16 lib/recurly/charge.rb
recurly-0.4.15 lib/recurly/charge.rb
recurly-0.4.14 lib/recurly/charge.rb
recurly-0.4.13 lib/recurly/charge.rb
recurly-0.4.11 lib/recurly/charge.rb
recurly-0.4.10 lib/recurly/charge.rb
recurly-0.4.8 lib/recurly/charge.rb
recurly-0.4.7 lib/recurly/charge.rb
recurly-0.4.6 lib/recurly/charge.rb