Sha256: 36da30be81bad66c9daf7e4cbc041356ff36b1656c1d8a7f2c4b9fc6028d826d

Contents?: true

Size: 836 Bytes

Versions: 2

Compression:

Stored size: 836 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_tenant_id, response, extra_params = {})
        super(api_call,
              kb_account_id,
              kb_payment_id,
              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.3 generators/active_merchant/templates/lib/models/response.rb
killbill-3.1.2 generators/active_merchant/templates/lib/models/response.rb