imperituroard 0.3.9 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/imperituroard.rb +5 -2
- data/lib/imperituroard/projects/mhub/sk.rb +7 -4
- data/lib/imperituroard/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7eb357022815af9e5557c552c527afd05085598
|
4
|
+
data.tar.gz: 11e918ff4c33d5ccb533cde41ef9dc33aaec0b83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18d971089a904d1cb2fc40d7c702c9cb293f39562119f98dbc3726151fe72ab372fd69c5142d90124e7377d2524061c3047b0d9ba9b2ce58fb4a615ceade659f
|
7
|
+
data.tar.gz: 4d825c9af6d2d884840dd609abe8e47f9948e698f3ff5f691afce088a773fd5a713f6740e966a9cb1febfdb776726e604b67bd1573750d97c773af8707b690bf
|
data/lib/imperituroard.rb
CHANGED
@@ -800,9 +800,9 @@ end
|
|
800
800
|
|
801
801
|
class Mhub_2
|
802
802
|
|
803
|
-
attr_accessor :sk_url, :sk_login, :sk_password, :mhub_connector, :internal_func, :dabrab_connecter
|
803
|
+
attr_accessor :sk_url, :sk_login, :sk_password, :mhub_connector, :internal_func, :dabrab_connecter, :static_callback
|
804
804
|
|
805
|
-
def initialize(sk_url_simple, sk_login, sk_password, telegram_api_url, telegram_chat_id, sk_url_broadcast)
|
805
|
+
def initialize(sk_url_simple, sk_login, sk_password, telegram_api_url, telegram_chat_id, sk_url_broadcast, static_callback)
|
806
806
|
@sk_url = sk_url_simple
|
807
807
|
@sk_login = sk_login
|
808
808
|
@sk_password = sk_password
|
@@ -811,6 +811,7 @@ class Mhub_2
|
|
811
811
|
@internal_func = InternalFunc.new
|
812
812
|
@dabrab_connecter = Dabrab.new
|
813
813
|
@add_functions_connector = AdditionalFunc.new(telegram_api_url, telegram_chat_id)
|
814
|
+
@static_callback = static_callback
|
814
815
|
end
|
815
816
|
|
816
817
|
|
@@ -870,6 +871,8 @@ class Mhub_2
|
|
870
871
|
elsif !null_statement.include?(params["viber"]) && null_statement.include?(params["sms"])
|
871
872
|
hub_resp = mhub_connector.sk_send_viber_list(msisdn2, params["notifyUrl"], params["viber"]["text"])
|
872
873
|
elsif !null_statement.include?(params["viber"]) && !null_statement.include?(params["sms"])
|
874
|
+
p "vibersms"
|
875
|
+
p msisdn2
|
873
876
|
hub_resp = mhub_connector.sk_send_viber_sms_list(msisdn2, params["notifyUrl"], params["sms"]["text"], params["viber"]["text"], "TEST")
|
874
877
|
else
|
875
878
|
output_params = {"code": 502, "result": "Invalid input data st2", "body": {"answer": {}, "sender": {"ip_src": ip_src, "ip_real": ip_real, "ip_vip": ip_vip}}}
|
@@ -282,16 +282,19 @@ class Sksk_1
|
|
282
282
|
end
|
283
283
|
|
284
284
|
|
285
|
-
def sk_send_viber_sms_list(msisdn_list, callback_url,
|
285
|
+
def sk_send_viber_sms_list(msisdn_list, callback_url, sms_text, viber_text, alphaname)
|
286
|
+
p "stat"
|
286
287
|
|
287
|
-
input_params = {:msisdn_list => msisdn_list, :callback_url => callback_url, :
|
288
|
+
input_params = {:msisdn_list => msisdn_list, :callback_url => callback_url, :sms_text => sms_text, :viber_text => viber_text, :alphaname => alphaname}
|
288
289
|
output_params = {}
|
289
290
|
request_message = {}
|
290
291
|
|
291
292
|
begin
|
293
|
+
p "hhhh"
|
292
294
|
uri = URI(sk_url_broadcast)
|
293
295
|
#8 - client id
|
294
296
|
|
297
|
+
|
295
298
|
https = Net::HTTP.new(uri.host, uri.port)
|
296
299
|
https.use_ssl = true
|
297
300
|
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
@@ -311,11 +314,11 @@ class Sksk_1
|
|
311
314
|
"channel_options": {
|
312
315
|
"sms": {
|
313
316
|
"alpha_name": alphaname,
|
314
|
-
"text":
|
317
|
+
"text": sms_text,
|
315
318
|
"ttl": 60
|
316
319
|
},
|
317
320
|
"viber": {
|
318
|
-
"text":
|
321
|
+
"text": viber_text,
|
319
322
|
"ttl": 60
|
320
323
|
}
|
321
324
|
}
|