Sha256: baa303a0212db0c4d08106a32cab3fd88e9f26c71ade38b1f610bb80ad09f208

Contents?: true

Size: 802 Bytes

Versions: 15

Compression:

Stored size: 802 Bytes

Contents

# Uncomment this if you reference any of your controllers in activate
require_dependency 'application'

class PaymentGatewayExtension < Spree::Extension
  version "1.0"
  description "Provides basic payment gateway functionality.  User specifies an ActiveMerchant compatible gateway 
  to use in the aplication."

  def activate  
    # Set the global "gateway mode" for active merchant (depending on what environment we're in)
    ActiveMerchant::Billing::Base.gateway_mode = :test unless ENV['RAILS_ENV'] == "production"
    # Mixin the payment_gateway method into the base controller so it can be accessed by the checkout process, etc.
    Creditcard.class_eval do
      # add gateway methods to the creditcard so we can authorize, capture, etc.
      include Spree::PaymentGateway
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
spree-enriquez-0.9.4 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.9.4 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.9.3 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.9.2 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.9.1 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.9.0 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.8.4 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.8.5 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.6.0 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.7.1 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.7.0 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.8.0 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.8.1 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.8.2 vendor/extensions/payment_gateway/payment_gateway_extension.rb
spree-0.8.3 vendor/extensions/payment_gateway/payment_gateway_extension.rb