Sha256: 08b9510c28b62c50de6f6094c3e67d6b37cafef474975c0127b5df4b5f57a9ce
Contents?: true
Size: 660 Bytes
Versions: 34
Compression:
Stored size: 660 Bytes
Contents
# frozen_string_literal: true module Spree class BillingIntegration < PaymentMethod validates :name, presence: true preference :server, :string, default: 'test' preference :test_mode, :boolean, default: true def gateway integration_options = options ActiveMerchant::Billing::Base.integration_mode = integration_options[:server].to_sym integration_options[:test] = true if integration_options[:test_mode] @gateway ||= gateway_class.new(integration_options) end def options options_hash = {} preferences.each { |key, value| options_hash[key.to_sym] = value } options_hash end end end
Version data entries
34 entries across 34 versions & 2 rubygems