hey-you-nexmo 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +3 -0
- data/lib/hey_you/channels/nexmo.rb +4 -1
- data/lib/hey_you/config/nexmo.rb +1 -1
- data/lib/hey_you_nexmo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17bb86cae428f8199158a06ed69a271d6baa1ac325408a85af9613b72f9f6cb8
|
4
|
+
data.tar.gz: 6ecb8566a68bf91b2c04d6621402c320747f2a47677b4dee3183ce99e5ca315c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9473741f464bdb31d3551afefc2d1a50a2062c0ec5ffe716b02acb865e5de71d46e405cdae71a2965a63ac88a24876eb7326e667062d98044629b607d4ff83d8
|
7
|
+
data.tar.gz: cffe5a61a1333d9e37aaf3e4ad2ea69508360a6b97db8814d9bad2983175fa811a52c1bf7df2eab8c68170d913b070097f13911ab7ccad8a70a852acd01afcf9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -48,6 +48,9 @@ HeyYou::Config.configure do
|
|
48
48
|
# [Boolean] optional - If you will send unicode texts
|
49
49
|
config.nexmo.is_unicode = true
|
50
50
|
|
51
|
+
# [Block] optional - Response handle (block which accept Nexmo::Response object)
|
52
|
+
config.nexmo.response_hander = proc { |response| CheckActualBalanceJob.perform_async(response) }
|
53
|
+
|
51
54
|
# Check https://developer.nexmo.com/api/sms#delivery-receipt for more info about settings below
|
52
55
|
config.nexmo.ttl = 90000
|
53
56
|
config.nexmo.status_report_req = true
|
@@ -22,7 +22,10 @@ module HeyYou
|
|
22
22
|
|
23
23
|
params = build_params(builder, **options)
|
24
24
|
|
25
|
-
config.nexmo.client.sms.send(params)
|
25
|
+
result = config.nexmo.client.sms.send(params)
|
26
|
+
config.nexmo.response_handler.call(result) if config.nexmo.response_handler
|
27
|
+
|
28
|
+
result
|
26
29
|
rescue ::Nexmo::Error => e
|
27
30
|
fail ResponseError, e
|
28
31
|
end
|
data/lib/hey_you/config/nexmo.rb
CHANGED
@@ -10,7 +10,7 @@ module HeyYou
|
|
10
10
|
ttl: 259200000 # 72 hours
|
11
11
|
}.freeze
|
12
12
|
|
13
|
-
attr_accessor :client, :from, :is_unicode, :ttl, :status_report_req, :callback
|
13
|
+
attr_accessor :client, :from, :is_unicode, :ttl, :status_report_req, :callback, :response_handler
|
14
14
|
|
15
15
|
def initialize
|
16
16
|
@is_unicode = DEFAULTS[:is_unicode]
|