killbill-zendesk 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +21 -0
- data/VERSION +1 -1
- data/lib/zendesk.rb +5 -0
- data/lib/zendesk/config/application.rb +5 -0
- data/pom.xml +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -34,6 +34,27 @@ User data mapping
|
|
34
34
|
</table>
|
35
35
|
|
36
36
|
|
37
|
+
Usage
|
38
|
+
-----
|
39
|
+
|
40
|
+
The plugin will automcatically listen to all account events (creation or update), and create or update the associated user in Zendesk.
|
41
|
+
|
42
|
+
If you need to trigger a refresh manually, the plugin exposes the following endpoint:
|
43
|
+
|
44
|
+
```
|
45
|
+
curl -v \
|
46
|
+
-d'webrick=stupid' \
|
47
|
+
-XPUT \
|
48
|
+
"http://$HOST:8080/plugins/killbill-zendesk/users/<kb account id or kb external key>"
|
49
|
+
```
|
50
|
+
|
51
|
+
Given a Kill Bill account id or Zendesk user id, you can retrieve the Kill Bill - Zendesk mapping via:
|
52
|
+
|
53
|
+
```
|
54
|
+
curl -v \
|
55
|
+
"http://$HOST:8080/plugins/killbill-zendesk/users/<kb account id or kb external key>"
|
56
|
+
```
|
57
|
+
|
37
58
|
Requirements
|
38
59
|
------------
|
39
60
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/zendesk.rb
CHANGED
@@ -19,6 +19,11 @@ module Killbill::Zendesk
|
|
19
19
|
@updater = Killbill::Zendesk::UserUpdaterInitializer.instance.initialize!(@conf_dir, @kb_apis, @logger)
|
20
20
|
end
|
21
21
|
|
22
|
+
def after_request
|
23
|
+
# return DB connections to the Pool if required
|
24
|
+
ActiveRecord::Base.connection.close
|
25
|
+
end
|
26
|
+
|
22
27
|
def on_event(event)
|
23
28
|
@updater.update(event.account_id) if [:ACCOUNT_CREATION, :ACCOUNT_CHANGE].include?(event.event_type.enum)
|
24
29
|
end
|
@@ -8,6 +8,11 @@ configure do
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
+
after do
|
12
|
+
# return DB connections to the Pool if required
|
13
|
+
ActiveRecord::Base.connection.close
|
14
|
+
end
|
15
|
+
|
11
16
|
# curl -v -d'webrick=stupid' -XPUT http://127.0.0.1:9292/plugins/killbill-zendesk/users/6939c8c0-cf89-11e2-8b8b-0800200c9a66
|
12
17
|
put '/plugins/killbill-zendesk/users/:id' do
|
13
18
|
zendesk_user_url = Killbill::Zendesk::UserUpdaterInitializer.instance.updater.update(params[:id])
|
data/pom.xml
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
<groupId>com.ning.killbill.ruby</groupId>
|
26
26
|
<artifactId>zendesk-plugin</artifactId>
|
27
27
|
<packaging>pom</packaging>
|
28
|
-
<version>0.1.
|
28
|
+
<version>0.1.1</version>
|
29
29
|
<name>zendesk-plugin</name>
|
30
30
|
<url>http://github.com/killbill/killbill-zendesk-plugin</url>
|
31
31
|
<description>Plugin to mirror Kill Bill data into Zendesk</description>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: killbill-zendesk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: killbill
|