Class: Killbill::Litle::LitleResponse

Inherits:
Plugin::ActiveMerchant::ActiveRecord::Response
  • Object
show all
Defined in:
lib/litle/models/response.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_response(api_call, kb_account_id, kb_payment_id, kb_payment_transaction_id, transaction_type, payment_processor_account_id, kb_tenant_id, response, extra_params = {}, model = ::Killbill::Litle::LitleResponse) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/litle/models/response.rb', line 9

def self.from_response(api_call, , kb_payment_id, kb_payment_transaction_id, transaction_type, , kb_tenant_id, response, extra_params = {}, model = ::Killbill::Litle::LitleResponse)
  super(api_call,
        ,
        kb_payment_id,
        kb_payment_transaction_id,
        transaction_type,
        ,
        kb_tenant_id,
        response,
        {
            :params_litle_txn_id  => extract(response, 'litleTxnId'),
            :params_order_id      => extract(response, 'orderId') || extract(response, 'id'),
            :params_litle_token   => extract(response, 'litleToken'),
            :params_auth_code     => extract(response, 'authCode'),
            :params_response      => extract(response, 'response'),
            :params_response_time => extract(response, 'responseTime'),
            :params_message       => extract(response, 'message')
        }.merge!(extra_params),
        model)
end

.search_where_clause(t, search_key) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/litle/models/response.rb', line 30

def self.search_where_clause(t, search_key)
  where_clause = t[:params_litle_txn_id].eq(search_key)

  # Only search successful payments and refunds
  where_clause = where_clause.and(t[:success].eq(true))

  super.or(where_clause)
end

Instance Method Details

#first_reference_idObject



39
40
41
# File 'lib/litle/models/response.rb', line 39

def first_reference_id
  params_litle_txn_id
end