class Payrix::Configuration

Attributes

api_key[RW]
exception_enabled[RW]
session_key[RW]
url[R]

Public Class Methods

new() click to toggle source
# File lib/payrix/configuration.rb, line 8
def initialize
  @url = 'https://api.payrix.com'
  @api_key = ''
  @session_key = ''
  @exception_enabled = true
end

Public Instance Methods

exception_enabled=(v) click to toggle source
# File lib/payrix/configuration.rb, line 15
def exception_enabled=(v)
  @exception_enabled = !!v
end
set_test_mode(test) click to toggle source
# File lib/payrix/configuration.rb, line 19
def set_test_mode(test)
  host = URI.parse(url).host

  if test == true
    if !host.start_with?('test-')
      @url = "https://test-#{host}"
    end
  else
    if host.start_with?('test-')
      @url = "https://#{host[5..-1]}"
    end
  end
end