americommerce-api 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/americommerce/api.rb +7 -6
- data/lib/americommerce/version.rb +1 -1
- metadata +1 -1
data/lib/americommerce/api.rb
CHANGED
@@ -21,7 +21,7 @@ module AmericommerceApi
|
|
21
21
|
|
22
22
|
@store_domain = options[:store_domain] + WSDL_POSTFIX
|
23
23
|
|
24
|
-
|
24
|
+
init_client(@ac_header, @store_domain)
|
25
25
|
end
|
26
26
|
|
27
27
|
def get_orders(options = {})
|
@@ -45,13 +45,13 @@ module AmericommerceApi
|
|
45
45
|
def ping
|
46
46
|
begin
|
47
47
|
wsdl = AUTHENTICATE_WSDL % {store_domain: @store_domain}
|
48
|
-
|
48
|
+
init_client(@ac_header,wsdl)
|
49
49
|
response = request(:authenticate)
|
50
50
|
raise AmericommerceApi::Exceptions::InvalidCredentials unless response == true
|
51
51
|
rescue
|
52
52
|
raise AmericommerceApi::Exceptions::InvalidCredentials
|
53
53
|
ensure
|
54
|
-
|
54
|
+
init_client(@ac_header, @store_domain)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -62,12 +62,13 @@ module AmericommerceApi
|
|
62
62
|
return AmericommerceApi::Response.format(response, call_action)
|
63
63
|
end
|
64
64
|
|
65
|
-
def
|
66
|
-
|
65
|
+
def init_client(ac_header, wsdl)
|
66
|
+
@client = Savon.client({
|
67
67
|
:ssl_verify_mode => :none,
|
68
68
|
:wsdl => wsdl,
|
69
69
|
:soap_header => ac_header,
|
70
|
-
:namespaces => NAMESPACES
|
70
|
+
:namespaces => NAMESPACES,
|
71
|
+
:log_level => :warn
|
71
72
|
})
|
72
73
|
end
|
73
74
|
|