module Valken::Shipping

Constants

VERSION

Public Class Methods

auto_initialize_gateway() click to toggle source
# File lib/valken/shipping.rb, line 27
def self.auto_initialize_gateway      
  if ups_credentials.present? && !Workarea.config.default_shipping
    if Rails.env.test?
      Workarea.config.gateways.shipping = ActiveShipping::Workarea.new
    else
      Workarea.config.gateways.shipping = ActiveShipping::VALKEN.new ups_credentials
    end
  else
    Workarea.config.gateways.shipping = ActiveShipping::Workarea.new
  end
end
fedex_credentials() click to toggle source
# File lib/valken/shipping.rb, line 14
def self.fedex_credentials
  return {} unless Rails.application.secrets.fedex_carrier.present?
  Rails.application.secrets.fedex_carrier.symbolize_keys
end
fedex_gateway=(gateway) click to toggle source
# File lib/valken/shipping.rb, line 23
def self.fedex_gateway=(gateway)
  Workarea.config.gateways.fedex_carrier = gateway
end
ups_credentials() click to toggle source
# File lib/valken/shipping.rb, line 9
def self.ups_credentials
  return {} unless Rails.application.secrets.ups_carrier.present?
  Rails.application.secrets.ups_carrier.symbolize_keys
end
ups_gateway=(gateway) click to toggle source
# File lib/valken/shipping.rb, line 19
def self.ups_gateway=(gateway)
  Workarea.config.gateways.ups_carrier = gateway
end