Sha256: 34771d64b6d37c802c75ab606be0028e2579028309eb59de8b2ff5dbad32f591

Contents?: true

Size: 1.48 KB

Versions: 3

Compression:

Stored size: 1.48 KB

Contents

module ChargeBee
  class CreditNote < Model

    class LineItem < Model
      attr_accessor :date_from, :date_to, :unit_amount, :quantity, :is_taxed, :tax_amount, :tax_rate, :amount, :discount_amount, :item_level_discount_amount, :description, :entity_type, :entity_id
    end

    class Discount < Model
      attr_accessor :amount, :description, :entity_type, :entity_id
    end

    class Tax < Model
      attr_accessor :amount, :description
    end

    class LinkedRefund < Model
      attr_accessor :txn_id, :applied_amount, :applied_at, :txn_status, :txn_date, :txn_amount
    end

    class Allocation < Model
      attr_accessor :invoice_id, :allocated_amount, :allocated_at, :invoice_date, :invoice_status
    end

  attr_accessor :id, :customer_id, :subscription_id, :reference_invoice_id, :type, :reason_code,
  :status, :vat_number, :date, :price_type, :total, :amount_allocated, :amount_refunded, :amount_available,
  :refunded_at, :sub_total, :line_items, :discounts, :taxes, :linked_refunds, :allocations

  # OPERATIONS
  #-----------

  def self.retrieve(id, env=nil, headers={})
    Request.send('get', uri_path("credit_notes",id.to_s), {}, env, headers)
  end

  def self.list(params={}, env=nil, headers={})
    Request.send('get', uri_path("credit_notes"), params, env, headers)
  end

  def self.credit_notes_for_customer(id, params={}, env=nil, headers={})
    Request.send('get', uri_path("customers",id.to_s,"credit_notes"), params, env, headers)
  end

  end # ~CreditNote
end # ~ChargeBee

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chargebee-2.0.2 lib/chargebee/models/credit_note.rb
chargebee-2.0.1 lib/chargebee/models/credit_note.rb
chargebee-2.0.0 lib/chargebee/models/credit_note.rb