Sha256: 6a2e61eab2944ff84eae988db1be3d10db22c90129d672767c542cc47869a4b0

Contents?: true

Size: 600 Bytes

Versions: 2

Compression:

Stored size: 600 Bytes

Contents

module Killbill::Litle
  class LitleTransaction < ActiveRecord::Base
    belongs_to :litle_response
    attr_accessible :amount_in_cents, :api_call, :kb_payment_id, :litle_txn_id

    def self.from_kb_payment_id(kb_payment_id)
      litle_transactions = find_all_by_api_call_and_kb_payment_id(:charge, kb_payment_id)
      raise "Unable to find Litle transaction id for payment #{kb_payment_id}" if litle_transactions.empty?
      raise "Killbill payment mapping to multiple Litle transactions for payment #{kb_payment_id}" if litle_transactions.size > 1
      litle_transactions[0]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
killbill-litle-1.0.2 lib/litle/models/litle_transaction.rb
killbill-litle-1.0.1 lib/litle/models/litle_transaction.rb