sms_center 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sms_center.rb +2 -2
- data/lib/sms_center/infobip.rb +2 -1
- data/lib/sms_center/nexmo.rb +3 -0
- data/lib/sms_center/telerivet.rb +2 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7937daee7e4fbb94d6e21d017a704ef230209867075d9669986988dfb81703f
|
4
|
+
data.tar.gz: 472c26f4f4a279248e732f59973f3337f66763e8da1a667c7b2e8f90cca5f319
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54e783f51469480cc21276682390d8bd22edb6c38dfcb5dac34fddd0498187d8b590a9f4fd474c757b27f35a7639c9047dde8b6f6a399086e00b189c51962a69
|
7
|
+
data.tar.gz: 3759499944f9f100de7f67f52b6be3b8a8942bf83c8ed07e6f88872cdf5804e37b7744e6ffdf37f3c07b8533a0033d01d47c7178f64c9cabf0f830e7ca810fb6
|
data/lib/sms_center.rb
CHANGED
@@ -41,8 +41,8 @@ class SmsCenter
|
|
41
41
|
country = options[:country]
|
42
42
|
platform = options[:platform]
|
43
43
|
|
44
|
-
f_platform = country ? platform_by_country[country.downcase.to_sym] : platform_by_country[:default]
|
45
|
-
f_platform = platform.downcase.capitalize if platform
|
44
|
+
f_platform = country.present? ? platform_by_country[country.downcase.to_sym] : platform_by_country[:default]
|
45
|
+
f_platform = platform.downcase.capitalize if platform.present?
|
46
46
|
|
47
47
|
from_number = SmsCenter.root_number_by_platform[f_platform.to_sym]
|
48
48
|
@request = SmsCenter.const_get(f_platform, false).new(content, to_number, from_number, @@keys)
|
data/lib/sms_center/infobip.rb
CHANGED
@@ -4,7 +4,8 @@ class SmsCenter::Infobip
|
|
4
4
|
api_key = keys[:INFOBIP_API_KEY]
|
5
5
|
@api_url = 'https://5mzkg.api.infobip.com/sms/2/text/single'
|
6
6
|
@headers = {
|
7
|
-
'Authorization' => "App #{api_key}"
|
7
|
+
'Authorization' => "App #{api_key}",
|
8
|
+
'Content-Type' => 'application/json'
|
8
9
|
}
|
9
10
|
@body = {
|
10
11
|
"to": to_number,
|
data/lib/sms_center/nexmo.rb
CHANGED
@@ -3,6 +3,9 @@ class SmsCenter::Nexmo
|
|
3
3
|
def initialize(content, to_number, from_number, keys)
|
4
4
|
base64key = Base64.strict_encode64("#{keys[:NEXMO_API_KEY]}:#{keys[:NEXMO_API_SECRET]}")
|
5
5
|
@api_url = 'https://rest.nexmo.com/sms/json'
|
6
|
+
@headers = {
|
7
|
+
'Content-Type' => 'application/json'
|
8
|
+
}
|
6
9
|
@body = {
|
7
10
|
api_key: keys[:NEXMO_API_KEY],
|
8
11
|
api_secret: keys[:NEXMO_API_SECRET],
|
data/lib/sms_center/telerivet.rb
CHANGED
@@ -4,7 +4,8 @@ class SmsCenter::Telerivet
|
|
4
4
|
base64key = Base64.strict_encode64("#{keys[:TELERIVET_API_KEY]}:")
|
5
5
|
@api_url = "https://api.telerivet.com/v1/projects/#{keys[:TELERIVET_PROJECT_ID]}/messages/send"
|
6
6
|
@headers = {
|
7
|
-
'Authorization' => "Basic #{base64key}"
|
7
|
+
'Authorization' => "Basic #{base64key}",
|
8
|
+
'Content-Type' => 'application/json'
|
8
9
|
}
|
9
10
|
@body = {
|
10
11
|
"content": content,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sms_center
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Deleveree
|
@@ -11,19 +11,19 @@ cert_chain: []
|
|
11
11
|
date: 2020-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rest-client
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.0
|
27
27
|
description: A simple tool to using SMS third party
|
28
28
|
email:
|
29
29
|
executables: []
|