tenios-api 0.3.0 → 0.4.0

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
  SHA256:
3
- metadata.gz: bc0773c7de20d5e23769de57237ed37a076bb3b12aa5e518fa7b9ec19824ce6a
4
- data.tar.gz: 69b602fd8a08022768c272b263e827072945062f59a4debd2512203690da7ce5
3
+ metadata.gz: 9b0911331d2acc593d17afe8263e9955e9b0e7ce82d632b09c5d9586a23eff13
4
+ data.tar.gz: 7d2d7ca7ec66d8b21a0ffda096a293a1e1305b7e6824300515741ba5f032d1eb
5
5
  SHA512:
6
- metadata.gz: '091d288e62b6e46e2976ee139da9876b4b0142dc0e976f9f774a91dd85864558931dad609cdbb5dd6b47ee7397b98d11b72d9f2dbd457e8d4ae3af47474c459e'
7
- data.tar.gz: 49ff97e262d6f1f78cc4c2157a1df8598ac7f5c993e0d8e6e869ccb1f8a218127c867f3b78904b323e187b1bb6767bd97e2c33991dbd657e77fd4c8104b38e0c
6
+ metadata.gz: 02334eb4c0304b31227505016987ac23a42f2ac66610c8799d26dfe6ec7abb4231310c700447b85294ab22afba07473802561ab9e06aeeb5357cea7ecebe818f
7
+ data.tar.gz: 9dc6a38fd7dea49f3686ba45dc3ca09946bfdf1ec9f8353b9158b57dd8b1706604705ad0abfedc4468927f8397f041c096dbb7a991734783291c4765c9564b3a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tenios-api (0.3.0)
4
+ tenios-api (0.4.0)
5
5
  faraday
6
6
  faraday_middleware
7
7
 
@@ -14,24 +14,29 @@ module Tenios
14
14
  ].freeze
15
15
 
16
16
  def order(verification_id:, number_type: GEOGRAPHICAL, **options)
17
- payload = build_payload(verification_id: verification_id, number_type: number_type, **options)
17
+ payload = order_payload(verification_id: verification_id, number_type: number_type, **options)
18
18
  client.http_client.post('/number/order', payload).body
19
19
  end
20
20
 
21
+ def cancel(phone_number:)
22
+ payload = { access_key: client.access_key, phone_number: phone_number }
23
+ client.http_client.post('/number/cancel', payload).body
24
+ end
25
+
21
26
  private
22
27
 
23
- OPTIONS = %i[
28
+ ORDER_OPTIONS = %i[
24
29
  link_to_number
25
30
  number_type
26
31
  push_secret
27
32
  push_url
28
33
  verification_id
29
34
  ].freeze
30
- private_constant :OPTIONS
35
+ private_constant :ORDER_OPTIONS
31
36
 
32
- def build_payload(**options)
37
+ def order_payload(**options)
33
38
  options
34
- .slice(*OPTIONS)
39
+ .slice(*ORDER_OPTIONS)
35
40
  .merge(access_key: client.access_key)
36
41
  end
37
42
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tenios
4
4
  module API
5
- VERSION = '0.3.0'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tenios-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - carwow Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-21 00:00:00.000000000 Z
11
+ date: 2020-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday