bitrix_webhook 0.1.5 → 0.2.0

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
  SHA1:
3
- metadata.gz: c2588a133d07828dac45dce19ba0a1c3eca9e030
4
- data.tar.gz: 8b2db69d9bd2c07640bc070a80497dcd74241378
3
+ metadata.gz: ede4d3a080078487f9f67f71dcd920ed476ce42e
4
+ data.tar.gz: 54925d9c88180354d220fa899f7d95de81589666
5
5
  SHA512:
6
- metadata.gz: 2a6a9b52a4b5d871ca5398d82ec2e9eb071440a6dc910fe4016d942f29dc32da04dec23f6fc86cb73b613917300998ace54af5b2123d3a8454d10d095d85ae4b
7
- data.tar.gz: 36bff55cf1d31a6e5133c31c1707f61591750100a022458140c35b459b8752e02491b5a7fc579d15f0d8b236cd16ee808d6b8867a2edabe567715b31479a9868
6
+ metadata.gz: 48d96ec12ccf537d2eda00f789f482c3a7e32d04d41e5b63fa277b998c4f1f6a27c52d93e724e4c0e9bd58b091db46027b1ff0c4322803adad0045c5e5472bda
7
+ data.tar.gz: b80e7d8a775f209693e81398dbad67a41c8e2223ac61c263e80cf3ae1e69aa6b9714982ff5078af7f232c8d796e9f9f51dfd57181f965693b34194eb5fc0841f
data/README.md CHANGED
@@ -30,10 +30,24 @@ which will generate default settings files:
30
30
 
31
31
  Then configurate bitrix_webhook.rb file:
32
32
 
33
+ Get webhook at https://your-portal.bitrix24.ru/marketplace/hook
34
+
35
+ You get https://your-portal/rest/your-webhook-id/your-webhook-key/profile/
36
+
37
+ **https://your-portal.bitrix24.ru/rest/2/zdfmoz6nub3uacft/profile/**
38
+
39
+
40
+
41
+ config.bitrix24_url = your-portal.bitrix24.ru
42
+ config.hook = zdfmoz6nub3uacft
43
+ config.hook_id = 2
44
+
45
+
33
46
  ```ruby
34
47
  BitrixWebhook.configuration do |config|
35
48
  config.bitrix24_url = 'URL' # Like this b21-6l64i7.bitrix24.ru
36
49
  config.hook = 'Hook' # Like this ak75dm93k5eq8215
50
+ config.hook_id = 'id' # Like this 1
37
51
  end
38
52
  ```
39
53
 
@@ -8,4 +8,5 @@ module BitrixWebhook
8
8
  extend Configuration
9
9
  define_setting :bitrix24_url
10
10
  define_setting :hook
11
+ define_setting :hook_id
11
12
  end
@@ -7,12 +7,12 @@ module BitrixWebhook
7
7
  lname: '',
8
8
  status_id: 'NEW',
9
9
  opened: 'Y',
10
- assigned_by_id: 1,
10
+ assigned_by_id: BitrixWebhook.hook_id,
11
11
  register_sonet_event: 'Y',
12
12
  }
13
13
 
14
14
  def self.base_url(method)
15
- "https://#{BitrixWebhook.bitrix24_url}/rest/1/#{ BitrixWebhook.hook}/crm.lead.#{method}.json?"
15
+ "https://#{BitrixWebhook.bitrix24_url}/rest/#{BitrixWebhook.hook_id}/#{ BitrixWebhook.hook}/crm.lead.#{method}.json?"
16
16
  end
17
17
 
18
18
  def self.add(options = {})
@@ -12,10 +12,12 @@ module BitrixWebhook; class Config
12
12
  class Configuration
13
13
  attr_accessor :bitrix24_url
14
14
  attr_accessor :hook
15
+ attr_accessor :hook_id
15
16
 
16
17
  def initialize
17
18
  @bitrix24_url= 'bitrix24_url'
18
19
  @hook = 'hook'
20
+ @hook_id = 'id'
19
21
  end
20
22
  end
21
23
  end; end
@@ -1,3 +1,3 @@
1
1
  module BitrixWebhook
2
- VERSION = "0.1.5"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  BitrixWebhook.configuration do |config|
2
2
  config.bitrix24_url = 'URL' # Like this b21-6l64i7.bitrix24.ru
3
3
  config.hook = 'Hook' # Like this ak75dm93k5eq8215
4
+ config.hook_id = 'id' # Like this 1
4
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitrix_webhook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhii Danovskyi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-21 00:00:00.000000000 Z
11
+ date: 2018-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler