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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d722d05cc6899aee30f158a0f27ccb5f0b76622967212a8bde12d0c81954501
4
- data.tar.gz: b16602ad3063feac0786308f60e7f94a3066e4ad0e5052c5c7972e7ab6c46078
3
+ metadata.gz: bc0b95d13726d3cd8857b22f6747a4daba8891932a55432b50fb01e2aad8a6dd
4
+ data.tar.gz: 4256f674404dd05b4879019e7d4439b819cb87c1a040a50b387a871269d16b79
5
5
  SHA512:
6
- metadata.gz: 39219fd71b9e35e731d38899131430596e950eb9c962af9c01f4c6af4cd388580f711d27ffcd42983083f5df9986878e5ef6f688af0ff060a2b60d4d0b551c3d
7
- data.tar.gz: e8580c4b2fb9dd1579f57dd7a97ac075a1b83f57c20563ca76cd8bcaad17d8fdf444286d7951aed5959d0bfe078b49251cebb246b178273a64c5f40e1e5ec708
6
+ metadata.gz: 33363d9665e5d79586c31ec649f40913babbc549541a775f2c68bf55ce5d7bcbc2df2e4857ad39489eb2adc6740826cc197d785f3d909598d04c9264b6e2d0a8
7
+ data.tar.gz: da4e794f0b904002fefecc3983d8334c314058c869c7bb7888961d702e14e4bf011780acd5f8a1fc306f278f66d6a24c06aa27f9519771cd5d97ebd70c0409b3
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ *.gem
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- africastalking-ruby (2.1.5.beta.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
- 'username' => @username,
22
- 'recipients' => recipients.to_json,
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)
@@ -1,3 +1,3 @@
1
1
  module AfricasTalking
2
- VERSION = "2.1.7"
2
+ VERSION = "2.1.8"
3
3
  end
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.7
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: 2021-05-21 00:00:00.000000000 Z
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.0.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