ruby-saferpay 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -355,17 +355,22 @@ private
355
355
  # Sanity check on params
356
356
  raise ArgumentError, "Bad parameters. Configuration path: \"#{conf_path}\", username: \"#{username}\", password: \"#{password}\", accountid: \"#{accountid}\"" if (username.nil? || password.nil? || accountid.nil?)
357
357
 
358
- account_directory = "#{conf_path}conf_for_#{accountid}"
358
+ account_directory = "#{conf_path}conf_for_#{accountid}/"
359
359
  #logger.debug "#{self.class}.setup_account Will configure account in: \"#{account_directory}\""
360
360
 
361
361
  # Is really a new account?
362
362
  if File.directory? conf_path
363
363
  if File.directory? account_directory
364
- if File.exist?( account_directory + 'config.xml' ) && File.directory?( account_directory + 'keys' )
365
- raise ConfigError, "Account already exist."
364
+ if File.exist?( account_directory + 'config.xml' )
365
+ if File.directory?( account_directory + 'keys' )
366
+ logger.info "#{self.class}#setup_account Account already exist"
367
+ return false
368
+ # raise ConfigError, "Account already exist."
369
+ else
370
+ raise ConfigError, "Account config seems to be corrupt: missing 'keys' directory, but '#{account_directory}' exist"
371
+ end
366
372
  else
367
- #FileUtils.remove_dir account_directory
368
- raise ConfigError, "Account seems to be corrupt (missing 'config.xml' and 'keys' directory)."
373
+ raise ConfigError, "Account config seems to be corrupt: missing 'config.xml', but '#{account_directory}' exist"
369
374
  end
370
375
  end
371
376
  else
@@ -398,7 +403,7 @@ private
398
403
  # TODO: write tests
399
404
  def self.account_configured?( conf_path, accountid )
400
405
  raise ArgumentError, "Saferpay.check_config Bad parameters. Configuration path: \"#{conf_path}\", accountid: \"#{accountid}\"" if (accountid.nil? || conf_path.nil?)
401
- account_directory = "#{conf_path}conf_for_#{accountid}"
406
+ account_directory = "#{conf_path}conf_for_#{accountid}/"
402
407
 
403
408
  if File.directory? conf_path
404
409
  if File.directory? account_directory
@@ -2,7 +2,7 @@ module RubySaferpay #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 7
5
+ TINY = 8
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: ruby-saferpay
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.7
6
+ version: 0.0.8
7
7
  date: 2007-08-21 00:00:00 +02:00
8
8
  summary: Ruby interface to the saferpay e-commerce payment provider
9
9
  require_paths: