plivo 4.61.1 → 4.61.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0200b603736dd9a97b9ae182f4cbb91a707ebb7d
4
- data.tar.gz: 20557f63e0102cced16783b2922729d6c30b43fb
3
+ metadata.gz: b1b7367bb7de50c9f64164935aaa3d97a86a8404
4
+ data.tar.gz: f2ee7b4d4a9944773e034b2cc72687eb45d952a5
5
5
  SHA512:
6
- metadata.gz: f4b500cd9846eb4cf8f5c14f3f375517dd7fd3104d0cdbbb44896402dc4af5875456a22428910a57d8d604c0619cc13feb2b2619b638e836d2594637d5f31e0d
7
- data.tar.gz: 3fcb82f91c6eed1d784c02cf7c9c207f7e83a3a1b8ee25301e155d309ee30b6d28483102b60573a092328aed604f16de057c58a32dcd7939e00d729dc8609d94
6
+ metadata.gz: ba805f6f9ee93306c5bfbf3c44a2261e41ff5119a0e8a71ada2ba062767d95cc7d54378a280ad55f6829c714d44db0cef30ba29c109ef3e31a1337fa8e6ffe21
7
+ data.tar.gz: 51bad1b27eb0b38e56fb90402ac44885e52bf3d31e554bcfb5588eb12a00c68ca4a214fddebd56d71bd55ea9f6924d6beffca2a02b06fb84b77d3c67cd9f40cf
data/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
1
  # Change Log
2
+ ## [4.61.3](https://github.com/plivo/plivo-ruby/tree/v4.61.3) (2025-02-18)
3
+ **Feature - Throw GeoPermissionsError Exception on synchronous geo permissions error**
4
+
5
+ ## [4.61.2](https://github.com/plivo/plivo-ruby/tree/v4.61.2)(2024-10-23)
6
+ **Feature - FraudCheck param in Create, Get and List Session**
7
+ - Support for the `fraud_check` parameter in sms verify session request
8
+ - Added support for `fraud_check` paramter in GET and LIST veriyf session
9
+
2
10
  ## [4.61.1](https://github.com/plivo/plivo-ruby/tree/v4.61.1) (2024-10-10)
3
11
  **Feature - Dtmf param in Create, Get and List Session**
4
12
  - Support for the `dtmf` parameter in voice verify session request
data/Makefile CHANGED
@@ -5,7 +5,11 @@ build:
5
5
 
6
6
  start:
7
7
  docker-compose up --build --remove-orphans --detach
8
- docker attach $(shell docker-compose ps -q rubySDK)
8
+ # Wait for the container to be running before attaching
9
+ @while [ -z "$$(docker-compose ps -q rubySDK)" ]; do \
10
+ sleep 1; \
11
+ done
12
+ docker attach $$(docker-compose ps -q rubySDK)
9
13
 
10
14
  test:
11
15
  @[ "${CONTAINER}" ] && \
data/README.md CHANGED
@@ -9,7 +9,7 @@ The Plivo Ruby SDK makes it simpler to integrate communications into your Ruby a
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'plivo', '>= 4.61.1'
12
+ gem 'plivo', '>= 4.61.3'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -13,6 +13,7 @@ module Plivo
13
13
  # Base stuff
14
14
  attr_reader :headers, :auth_credentials
15
15
  @@voice_retry_count = 0
16
+ GEO_PERMISSION_ENDPOINTS = ['/Message/', '/Session/', '/Call/'].freeze
16
17
  def initialize(auth_id = nil, auth_token = nil, proxy_options = nil, timeout=5)
17
18
  configure_credentials(auth_id, auth_token)
18
19
  configure_proxies(proxy_options)
@@ -26,7 +27,7 @@ module Plivo
26
27
  end
27
28
 
28
29
  def process_response(method, response)
29
- handle_response_exceptions(response)
30
+ handle_response_exceptions(response, method)
30
31
  if method == 'DELETE'
31
32
  if !([200, 204].include? response[:status])
32
33
  raise Exceptions::PlivoRESTError, "Resource at #{response[:url]} "\
@@ -341,7 +342,7 @@ module Plivo
341
342
  response
342
343
  end
343
344
 
344
- def handle_response_exceptions(response)
345
+ def handle_response_exceptions(response, method)
345
346
  exception_mapping = {
346
347
  400 => [
347
348
  Exceptions::ValidationError,
@@ -373,6 +374,13 @@ module Plivo
373
374
  ]
374
375
  }
375
376
 
377
+ if response[:status] == 403 && method == 'POST' && GEO_PERMISSION_ENDPOINTS.any? { |endpoint| response[:url].to_s.end_with?(endpoint) }
378
+ exception_mapping[403] = [
379
+ Exceptions::GeoPermissionsError,
380
+ 'Geo-permission to the destination country is not enabled'
381
+ ]
382
+ end
383
+
376
384
  response_json = response[:body]
377
385
  return unless exception_mapping.key?(response[:status])
378
386
 
@@ -46,5 +46,9 @@ module Plivo
46
46
  ##
47
47
  # This will be raised when there is an authentication error
48
48
  ResourceNotFoundError = Class.new(PlivoRESTError)
49
+
50
+ ##
51
+ # This will be raised when the destination country is not enabled for sms/voice
52
+ GeoPermissionsError = Class.new(PlivoRESTError)
49
53
  end
50
54
  end
@@ -42,7 +42,7 @@ module Plivo
42
42
  perform_get(session_uuid)
43
43
  end
44
44
 
45
- def create(app_uuid = nil, recipient = nil,channel = nil, url = nil, method = nil, locale=nil, brand_name=nil, app_hash=nil, code_length=nil, dtmf=nil)
45
+ def create(app_uuid = nil, recipient = nil,channel = nil, url = nil, method = nil, locale=nil, brand_name=nil, app_hash=nil, code_length=nil, dtmf=nil, fraud_check=nil)
46
46
  valid_param?(:app_uuid, app_uuid, [String, Symbol], false)
47
47
  valid_param?(:recipient, recipient, [Integer, String, Symbol], true)
48
48
  valid_param?(:channel, channel, [String, Symbol], false)
@@ -53,6 +53,7 @@ module Plivo
53
53
  valid_param?(:app_hash, app_hash, [String, Symbol], false)
54
54
  valid_param?(:code_length, code_length,[Integer,Symbol], false)
55
55
  valid_param?(:dtmf, dtmf,[Integer,Symbol], false)
56
+ valid_param?(:fraud_check, fraud_check, [String, Symbol], false)
56
57
 
57
58
  params = {
58
59
  app_uuid: app_uuid,
@@ -64,7 +65,8 @@ module Plivo
64
65
  brand_name: brand_name,
65
66
  app_hash: app_hash,
66
67
  code_length: code_length,
67
- dtmf:dtmf
68
+ dtmf:dtmf,
69
+ fraud_check:fraud_check
68
70
  }
69
71
  perform_create(params)
70
72
  end
data/lib/plivo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plivo
2
- VERSION = "4.61.1".freeze
2
+ VERSION = "4.61.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plivo
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.61.1
4
+ version: 4.61.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Plivo SDKs Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-10 00:00:00.000000000 Z
11
+ date: 2025-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday