Sha256: b692e2cf92a38ab5375314b9cccae059c785f8201454cd3a9cc8ee14a2210392

Contents?: true

Size: 954 Bytes

Versions: 2

Compression:

Stored size: 954 Bytes

Contents

module Killbill #:nodoc:
  module <%= class_name %> #:nodoc:
    class <%= class_name %>Response < ::Killbill::Plugin::ActiveMerchant::ActiveRecord::Response

      self.table_name = '<%= identifier %>_responses'

      has_one :<%= identifier %>_transaction

      def self.from_response(api_call, kb_account_id, kb_payment_id, kb_payment_transaction_id, transaction_type, kb_tenant_id, response, extra_params = {})
        super(api_call,
              kb_account_id,
              kb_payment_id,
              kb_payment_transaction_id,
              transaction_type,
              kb_tenant_id,
              response,
              {
                  # Pass custom key/values here
                  #:params_id => extract(response, 'id'),
                  #:params_card_id => extract(response, 'card', 'id')
              }.merge!(extra_params),
              ::Killbill::<%= class_name %>::<%= class_name %>Response)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
killbill-3.1.5 generators/active_merchant/templates/lib/models/response.rb
killbill-3.1.4 generators/active_merchant/templates/lib/models/response.rb