Module: Samurai

Defined in:
lib/samurai.rb,
lib/samurai/rails.rb,
lib/samurai/version.rb,
lib/samurai/active_resource_support.rb

Overview

Core Samurai Module Contains accessors for the important Samurai configuration settings

To configure the Samurai gem:

“‘ruby require ’samurai’ Samurai.options =

:merchant_key => 'a1ebafb6da5238fb8a3ac9f6',
:merchant_password => 'ae1aa640f6b735c4730fbb56',
:processor_token => '69ac9c704329bb067d427bf0'

“‘

Defined Under Namespace

Modules: ActiveResourceSupport, CacheableByToken, Rails Classes: Base, Message, PaymentMethod, Processor, ProcessorResponse, Transaction

Constant Summary collapse

SITE =
'https://api.samurai.feefighters.com/v1/'
DEFAULT_OPTIONS =
{:site => SITE}
VERSION =
"0.4.0".freeze

Class Method Summary collapse

Class Method Details

.merchant_keyObject

::nodoc


26
27
28
# File 'lib/samurai.rb', line 26

def self.merchant_key # ::nodoc::
  @@options[:merchant_key]
end

.merchant_passwordObject

::nodoc


30
31
32
# File 'lib/samurai.rb', line 30

def self.merchant_password # ::nodoc::
  @@options[:merchant_password]
end

.optionsObject



38
39
40
# File 'lib/samurai.rb', line 38

def self.options
  @@options
end

.options=(value) ⇒ Object



42
43
44
45
# File 'lib/samurai.rb', line 42

def self.options=(value)
  @@options = (value || {}).reverse_merge(DEFAULT_OPTIONS)
  Samurai::Base.setup_site!
end

.processor_tokenObject

::nodoc


34
35
36
# File 'lib/samurai.rb', line 34

def self.processor_token # ::nodoc::
  @@options[:processor_token]
end

.siteObject

Gets the provider site that the gem is configured to hit



22
23
24
# File 'lib/samurai.rb', line 22

def self.site # ::nodoc::
  @@options[:site]
end