Module: Epaybg
- Defined in:
- lib/epaybg.rb,
lib/epaybg/railtie.rb,
lib/epaybg/version.rb,
lib/epaybg/response.rb,
lib/epaybg/transaction.rb,
lib/epaybg/view_helpers.rb
Defined Under Namespace
Modules: ViewHelpers Classes: Railtie, Response, Transaction
Constant Summary collapse
- VERSION =
"0.1.2"
- @@mode =
:production
Class Method Summary collapse
-
.config ⇒ Object
A hash containing the configuration options found in the config/epaybg.yml file.
- .config=(config) ⇒ Object
- .hmac(data) ⇒ Object
-
.mode ⇒ Object
Configuration is loaded based on this property.
- .mode=(mode) ⇒ Object
Class Method Details
.config ⇒ Object
A hash containing the configuration options found in the config/epaybg.yml file.
31 32 33 |
# File 'lib/epaybg.rb', line 31 def config @@config[self.mode.to_s] end |
.config=(config) ⇒ Object
35 36 37 |
# File 'lib/epaybg.rb', line 35 def config=(config) @@config = config end |
.hmac(data) ⇒ Object
10 11 12 |
# File 'lib/epaybg.rb', line 10 def hmac(data) OpenSSL::HMAC.hexdigest('sha1', config["secret"], data) end |
.mode ⇒ Object
Configuration is loaded based on this property. Values are [:production, :test]. Defaults to :production
16 17 18 |
# File 'lib/epaybg.rb', line 16 def mode @@mode end |
.mode=(mode) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/epaybg.rb', line 20 def mode=(mode) valid = [:test, :production] raise ArgumentError, "#{mode} is not a valid mode for Epaybg. Valid modes are #{valid.to_s}." unless valid.include?(mode) @@mode = mode end |