loopiator 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e49d19aea0aab251622f34c87274a5a965570aa9
4
- data.tar.gz: d991ea57de4b16301620f5c36645e8ae4fb5ebc6
3
+ metadata.gz: 94e8d678e272050cac8d328bee4b66a5d9ca0fe4
4
+ data.tar.gz: b5ae29c7299d90722c283b02fba4ceab193722d8
5
5
  SHA512:
6
- metadata.gz: 23c4b895f34741a7c44e714804c220e19235a5a6812ab62fea6cba7db98538584701bd719715df42896adcff51bea1c8b85e6686ba9dfae98ecb2de26a4cb4c2
7
- data.tar.gz: 60015d7c1c5e81ae09fc792e58e1123468dd0e3ede15d7d7b0044ca48f057ecc4b559e0b9bf53828b4e8cc53733504558e88c9374fbdb2460fb270a7f8daa6b2
6
+ metadata.gz: 869842bcbff26040973acefdfa10b3aa237b5b3d6643bb473da39ddad55db215447d9b4b29bdf0542bc14ce81709aff4a81b819c5cd8455d9f36be0f71042b43
7
+ data.tar.gz: 42205aa66f0f2242ea257243274b53165369c23aa7dc0a4165720a1a13c42041955a94b59ba9475830f14566b73f6bd501f9318e8b9071ca30727f3e142ddad3
data/lib/loopiator.rb CHANGED
@@ -10,7 +10,7 @@ require File.join(File.dirname(__FILE__), 'loopiator/credits')
10
10
  require File.join(File.dirname(__FILE__), 'loopiator/client')
11
11
 
12
12
  module Loopiator
13
- VERSION = "0.3.7"
13
+ VERSION = "0.3.8"
14
14
 
15
15
  class << self
16
16
  attr_writer :configuration
@@ -41,7 +41,9 @@ module Loopiator
41
41
  when :rate_limited then raise Loopiator::RateLimitError
42
42
  when :insufficient_funds then raise Loopiator::InsufficientFundsError
43
43
  when :bad_indata then raise Loopiator::InvalidParameterError
44
- when :unknown_error then raise Loopiator::UnknownError
44
+ # :unknown_error will be returned when calling 'orderDomain' and the domain already exists in a customer account
45
+ # do not raise an error until Loopia has updated their API to add an additional error code specifically targeting this phenomena
46
+ #when :unknown_error then raise Loopiator::UnknownError
45
47
  else
46
48
  return response
47
49
  end
@@ -39,14 +39,13 @@ module Loopiator
39
39
 
40
40
  def purchase_domain(domain_name, customer_number: "", raise_exception_on_occupied: false)
41
41
  success = false
42
- ordered = order_domain(domain_name, accept_terms: true, customer_number: customer_number, raise_exception_on_occupied: raise_exception_on_occupied)
43
-
44
- if ordered
45
- domain = get_domain(domain_name, customer_number: customer_number)
46
-
47
- if (domain && domain.needs_to_be_paid? && !domain.reference_number.nil? && !domain.reference_number.empty?)
48
- success = pay_invoice_using_credits(domain.reference_number, customer_number: customer_number)
49
- end
42
+
43
+ order_domain(domain_name, accept_terms: true, customer_number: customer_number, raise_exception_on_occupied: raise_exception_on_occupied)
44
+
45
+ domain = get_domain(domain_name, customer_number: customer_number)
46
+
47
+ if (domain && domain.needs_to_be_paid? && !domain.reference_number.nil? && !domain.reference_number.empty?)
48
+ success = pay_invoice_using_credits(domain.reference_number, customer_number: customer_number)
50
49
  end
51
50
 
52
51
  return success
data/loopiator.gemspec CHANGED
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'loopiator'
6
- s.version = '0.3.7'
6
+ s.version = '0.3.8'
7
7
 
8
8
  s.homepage = "https://github.com/Agiley/Loopiator"
9
9
  s.email = "sebastian@agiley.se"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loopiator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Johnsson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-07 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simpleidn