africastalking-ruby 2.1.7 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -2
- data/README.md +2 -0
- data/lib/AfricasTalking/Airtime.rb +12 -4
- data/lib/AfricasTalking/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc0b95d13726d3cd8857b22f6747a4daba8891932a55432b50fb01e2aad8a6dd
|
4
|
+
data.tar.gz: 4256f674404dd05b4879019e7d4439b819cb87c1a040a50b387a871269d16b79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33363d9665e5d79586c31ec649f40913babbc549541a775f2c68bf55ce5d7bcbc2df2e4857ad39489eb2adc6740826cc197d785f3d909598d04c9264b6e2d0a8
|
7
|
+
data.tar.gz: da4e794f0b904002fefecc3983d8334c314058c869c7bb7888961d702e14e4bf011780acd5f8a1fc306f278f66d6a24c06aa27f9519771cd5d97ebd70c0409b3
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
africastalking-ruby (2.1.
|
4
|
+
africastalking-ruby (2.1.8)
|
5
5
|
httparty (= 0.16.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -114,7 +114,7 @@ DEPENDENCIES
|
|
114
114
|
pry (~> 0)
|
115
115
|
rake (~> 10.0)
|
116
116
|
rspec (~> 3.0)
|
117
|
-
rspec-rails (~> 3.7.2)
|
117
|
+
rspec-rails (~> 3.7, >= 3.7.2)
|
118
118
|
rubocop (~> 0.54.0)
|
119
119
|
|
120
120
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -68,6 +68,8 @@ airtime.send options
|
|
68
68
|
- `currency`:3-digit ISO format currency code . `REQUIRED`
|
69
69
|
- `amount`: Amount sent `>= 10 && <= 10K` with currency e.g `KES 100` `REQUIRED`
|
70
70
|
|
71
|
+
- `maxNumRetry`: This allows you to specify the maximum number of retries in case of failed airtime deliveries due to various reasons such as telco unavailability. The default retry period is 8 hours and retries occur every 60seconds. For example, setting `maxNumRetry=4` means the transaction will be retried every 60seconds for the next 4 hours.`OPTIONAL`.
|
72
|
+
|
71
73
|
### Sms
|
72
74
|
|
73
75
|
```ruby
|
@@ -12,15 +12,23 @@ class Airtime
|
|
12
12
|
def send options
|
13
13
|
url = getAirtimeUrl() + "/send"
|
14
14
|
|
15
|
-
recipients = options.each{|item|
|
15
|
+
recipients = options['recipients'].each{|item|
|
16
16
|
validateParamsPresence? item, %w(phoneNumber currencyCode amount)
|
17
17
|
item['amount'].to_s.prepend(item['currencyCode'].to_s + " ")
|
18
18
|
item.delete('currencyCode')
|
19
19
|
}
|
20
20
|
post_body = {
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
'username' => @username,
|
22
|
+
'recipients' => recipients.to_json,
|
23
|
+
}
|
24
|
+
|
25
|
+
if options['maxNumRetry'] && options['maxNumRetry'] > 0
|
26
|
+
post_body['maxNumRetry'] = options['maxNumRetry'].to_i
|
27
|
+
|
28
|
+
else
|
29
|
+
puts "Please make sure #{options['maxNumRetry']} is a number and greater than zero!"
|
30
|
+
end
|
31
|
+
|
24
32
|
response = sendNormalRequest(url, post_body)
|
25
33
|
if (@response_code == HTTP_CREATED)
|
26
34
|
responses = JSON.parse(response, :quirky_mode =>true)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: africastalking-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Mwirigi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
|
-
rubygems_version: 3.
|
162
|
+
rubygems_version: 3.4.8
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: Simple gem that helps you build integrations with AfricasTalking
|