esendex4soap 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/esendex4soap.gemspec +1 -1
- data/lib/esendex4soap.rb +8 -14
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.1
|
data/esendex4soap.gemspec
CHANGED
data/lib/esendex4soap.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
require 'savon'
|
3
3
|
require 'log4r'
|
4
|
-
#require '
|
4
|
+
#require 'pry'
|
5
5
|
require 'api_smith'
|
6
6
|
|
7
7
|
module LanguageTools
|
@@ -54,7 +54,7 @@ module Esendex
|
|
54
54
|
@password = args.shift
|
55
55
|
@account_reference = args.shift
|
56
56
|
# @detectlanguage_api_key, @alchemyapi_api_key = args.shift, args.shift
|
57
|
-
@sent_message_ids, @sent_message_statuses =
|
57
|
+
@sent_message_ids, @sent_message_statuses = Array.new, Hash.new
|
58
58
|
|
59
59
|
@language = LanguageTools::DetectLanguageDotCom.new(args.shift)
|
60
60
|
|
@@ -67,7 +67,7 @@ module Esendex
|
|
67
67
|
|
68
68
|
@log = Logger.new "#{self.class.name}"
|
69
69
|
@log.outputters = Outputter.stdout
|
70
|
-
@log.level =
|
70
|
+
@log.level = ERROR
|
71
71
|
|
72
72
|
@message_kind = String.new
|
73
73
|
|
@@ -114,20 +114,14 @@ module Esendex
|
|
114
114
|
def get_status(*message_id)
|
115
115
|
connect unless @client
|
116
116
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
soap.header["com:MessengerHeader"] = {"com:Username" => @username, "com:Password" => @password, "com:Account" => @account_reference}
|
121
|
-
soap.body = {"com:id" => id.to_s}
|
122
|
-
end
|
123
|
-
@sent_message_statuses[id] = resp.to_hash[:get_message_status_response][:get_message_status_result]
|
124
|
-
end
|
125
|
-
else
|
117
|
+
message_id.flatten!
|
118
|
+
message_id.each do |id|
|
119
|
+
@log.debug "#{id.to_s}"
|
126
120
|
resp = @client.request :com, :get_message_status do |soap|
|
127
121
|
soap.header["com:MessengerHeader"] = {"com:Username" => @username, "com:Password" => @password, "com:Account" => @account_reference}
|
128
|
-
soap.body = {"com:id" =>
|
122
|
+
soap.body = {"com:id" => id.to_s}
|
129
123
|
end
|
130
|
-
resp.to_hash[:get_message_status_response][:get_message_status_result]
|
124
|
+
@sent_message_statuses[id] = resp.to_hash[:get_message_status_response][:get_message_status_result]
|
131
125
|
end
|
132
126
|
end
|
133
127
|
|