Sha256: 8dbbe7d5f61d69e822a723c23fa98251780d684513e6373706502873f93ae94b

Contents?: true

Size: 1.65 KB

Versions: 3

Compression:

Stored size: 1.65 KB

Contents

module ChargeBee
  class Transaction < Model

    class LinkedInvoice < Model
      attr_accessor :invoice_id, :applied_amount, :applied_at, :invoice_date, :invoice_total, :invoice_status
    end

    class LinkedCreditNote < Model
      attr_accessor :cn_id, :applied_amount, :applied_at, :cn_reason_code, :cn_date, :cn_total, :cn_status, :cn_reference_invoice_id
    end

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

  attr_accessor :id, :customer_id, :subscription_id, :payment_method, :reference_number, :gateway,
  :type, :date, :amount, :id_at_gateway, :status, :error_code, :error_text, :voided_at, :amount_unused,
  :masked_card_number, :reference_transaction_id, :refunded_txn_id, :reversal_transaction_id,
  :linked_invoices, :linked_credit_notes, :linked_refunds, :currency_code

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

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

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

  def self.transactions_for_subscription(id, params={}, env=nil, headers={})
    Request.send('get', uri_path("subscriptions",id.to_s,"transactions"), params, env, headers)
  end

  def self.payments_for_invoice(id, params={}, env=nil, headers={})
    Request.send('get', uri_path("invoices",id.to_s,"payments"), params, env, headers)
  end

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

  end # ~Transaction
end # ~ChargeBee

Version data entries

3 entries across 3 versions & 1 rubygems

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