americommerce-api 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/americommerce/api.rb +7 -2
- data/lib/americommerce/version.rb +1 -1
- metadata +1 -1
data/lib/americommerce/api.rb
CHANGED
@@ -59,8 +59,13 @@ module AmericommerceApi
|
|
59
59
|
private
|
60
60
|
|
61
61
|
def request(call_action, request_params={})
|
62
|
-
|
63
|
-
|
62
|
+
begin
|
63
|
+
response = @client.call(call_action, message: request_params)
|
64
|
+
return AmericommerceApi::Response.format(response, call_action)
|
65
|
+
rescue Exception => e
|
66
|
+
#check invalid by message of error because code returned by americommerce is 500 and not 4**
|
67
|
+
raise e.message.include?('Unauthorized Request') ? AmericommerceApi::Exceptions::InvalidCredentials : e
|
68
|
+
end
|
64
69
|
end
|
65
70
|
|
66
71
|
def init_client(ac_header, wsdl)
|