Class: Assist::Configuration
- Inherits:
-
Object
- Object
- Assist::Configuration
- Defined in:
- lib/assist/configuration.rb
Constant Summary collapse
- ENDPOINTS =
{production: "https://paysecure.ru", test: "https://test.paysecure.ru"}.freeze
- REQUIRED_OPTIONS =
[:merchant_id, :login, :password, :mode].freeze
- ALLOWED_OPTIONS =
[:return_url, :success_url, :fail_url, :payment_methods, :secret_word].freeze
Instance Method Summary collapse
Instance Method Details
#[](opt_name) ⇒ Object
15 16 17 |
# File 'lib/assist/configuration.rb', line 15 def [](opt_name) public_send(opt_name) end |
#checkvalue? ⇒ Boolean
31 32 33 |
# File 'lib/assist/configuration.rb', line 31 def checkvalue? !secret_word.to_s.strip.empty? end |
#endpoint ⇒ Object
27 28 29 |
# File 'lib/assist/configuration.rb', line 27 def endpoint ENDPOINTS[test_mode? ? :test : :production] end |
#validate! ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/assist/configuration.rb', line 19 def validate! = REQUIRED_OPTIONS.select { |opt| self[opt].nil? } return if .empty? raise Exception::ConfigurationError, "Missing configuration options: #{missing_options.join(', ')}" end |