lib/loopiator/domains.rb in loopiator-0.2.0 vs lib/loopiator/domains.rb in loopiator-0.3.0
- old
+ new
@@ -5,11 +5,11 @@
response = parse_status_response(call("domainIsFree", encode_domain(domain_name)))
return response.eql?(:ok)
end
- def get_domain(domain_name, customer_number = "")
+ def get_domain(domain_name, customer_number: "")
domain = nil
response = call("getDomain", customer_number, encode_domain(domain_name))
if (response && response.is_a?(Hash))
domain = Loopiator::Models::Domain.new(response)
@@ -29,11 +29,11 @@
def purchase_domain(domain_name, customer_number: "", raise_exception_on_occupied: false)
success = false
ordered = order_domain(domain_name, accept_terms: true, customer_number: customer_number, raise_exception_on_occupied: raise_exception_on_occupied)
if (ordered)
- domain = get_domain(domain_name, customer_number)
+ domain = get_domain(domain_name, customer_number: customer_number)
if (domain && domain.needs_to_be_paid? && !domain.reference_number.nil? && !domain.reference_number.empty?)
success = pay_invoice_using_credits(domain.reference_number, customer_number)
end
end
@@ -41,10 +41,10 @@
return success
end
private
def encode_domain(domain_name)
- SimpleIDN.to_ascii(domain_name)
+ Loopiator::Utilities.encode_domain(domain_name)
end
end
end
\ No newline at end of file