killbill-zendesk 3.0.0 → 3.0.1

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: a5436d425490c3a49831d6842227abd8deb2fd68
4
- data.tar.gz: 6889d279c81ca94f16f0969c9b395cd21118dd28
3
+ metadata.gz: 72e3a4cde1b8ada5fbed0fa0fe5d9f04abec66b6
4
+ data.tar.gz: 89569d511290f9e5c2ac3a50b675395427977d50
5
5
  SHA512:
6
- metadata.gz: a412ea9f63ed1e2c3e8df010e72d5cd707e3cf7a534b07e23227959280e93ea6e6c09a65c246a7058ae03f0caf2e22489c648bed924ae54ce9826ac4a944154b
7
- data.tar.gz: e136ad8ef166354a187ae0fe5e6ff2d53c3144d0aed76f99b236e24add6b51c81b2e8213addff5e016ff3c1fd4ec5b5bcc9ecfabd6b3462866b3d625dd0fe50d
6
+ metadata.gz: d01964c7ae2c33ae3cf2f27e9f376f5141a51609762c8aa7ebf4359af5e7c18b9ca5371667158150c3478f9bdd59b26fa2c9c49e6c3f76e44377779fb924ca65
7
+ data.tar.gz: fafb0c2f2b3de06be29c44f0e94a52c44a254de4054d33fb0fa2118d7ef2b3d513966fd43eef452d8795e836fb955ed20aed4c56d6feaf3a8e7f667ed333eed8
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-zendesk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-29 00:00:00.000000000 Z
11
+ date: 2017-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -218,32 +218,11 @@ executables: []
218
218
  extensions: []
219
219
  extra_rdoc_files: []
220
220
  files:
221
- - ".gitignore"
222
- - ".travis.yml"
223
- - Gemfile
224
- - Gemfile.lock
225
- - Jarfile
226
- - Jarfile.lock
227
- - NEWS
228
- - README.md
229
- - Rakefile
230
- - VERSION
231
- - config.ru
232
- - db/ddl.sql
233
- - db/schema.rb
234
- - killbill-zendesk.gemspec
235
- - killbill.properties
236
221
  - lib/zendesk.rb
237
222
  - lib/zendesk/config/application.rb
238
223
  - lib/zendesk/user_updater.rb
239
224
  - lib/zendesk/user_updater_initializer.rb
240
225
  - lib/zendesk/zendesk_user.rb
241
- - pom.xml
242
- - release.sh
243
- - spec/spec_helper.rb
244
- - spec/zendesk/remote/integration_spec.rb
245
- - spec/zendesk/user_updater_spec.rb
246
- - zendesk.yml
247
226
  homepage: http://killbill.io
248
227
  licenses:
249
228
  - Apache License (2.0)
data/.gitignore DELETED
@@ -1,33 +0,0 @@
1
- *.gem
2
- *.rbc
3
- *.swp
4
- .bundle
5
- .config
6
- coverage
7
- InstalledFiles
8
- lib/bundler/man
9
- pkg
10
- rdoc
11
- spec/reports
12
- test/tmp
13
- test/version_tmp
14
- tmp
15
-
16
- # YARD artifacts
17
- .yardoc
18
- _yardoc
19
- doc/
20
-
21
- .jbundler
22
-
23
- .DS_Store
24
-
25
- # Build directory
26
- killbill-zendesk/
27
-
28
- target
29
- pom.xml.asc
30
-
31
- .idea/
32
-
33
- test.db
@@ -1,41 +0,0 @@
1
- language: ruby
2
-
3
- sudo: false
4
- cache: bundler
5
-
6
- before_script:
7
- - bundle exec jbundle install
8
-
9
- script: 'bundle exec rake test:spec'
10
-
11
- notifications:
12
- email:
13
- - kill-bill-commits@googlegroups.com
14
-
15
- env:
16
- global:
17
- - JRUBY_OPTS='-J-Xmx1024M'
18
-
19
- rvm:
20
- - jruby-1.7.20
21
- - jruby-20mode # latest 1.7.x
22
- - jruby-head
23
-
24
- gemfile:
25
- - Gemfile
26
- - Gemfile.head
27
-
28
- jdk:
29
- - openjdk7
30
- - oraclejdk7
31
- - oraclejdk8
32
-
33
- matrix:
34
- allow_failures:
35
- - rvm: jruby-head
36
- - jdk: oraclejdk8
37
- - gemfile: Gemfile.head
38
- fast_finish: true
39
-
40
- after_success:
41
- - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && echo "<settings><servers><server><id>sonatype-nexus-snapshots</id><username>\${env.OSSRH_USER}</username><password>\${env.OSSRH_PASS}</password></server></servers></settings>" > ~/settings.xml && MVN="mvn --settings $HOME/settings.xml" NO_RELEASE=1 travis_retry travis_wait bash release.sh | egrep -v "Download|Install|Upload" ; rm -f ~/settings.xml'
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
@@ -1,130 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- killbill-zendesk (3.0.0)
5
- activerecord (~> 4.1.0)
6
- activerecord-bogacs (~> 0.3)
7
- activerecord-jdbc-adapter (~> 1.3, < 1.5)
8
- jruby-openssl (~> 0.9.7)
9
- killbill (~> 8.0)
10
- mime-types (< 3)
11
- protected_attributes (~> 1.1.3)
12
- sinatra (~> 1.3.4)
13
- zendesk_api (~> 0.3.10)
14
-
15
- GEM
16
- remote: https://rubygems.org/
17
- specs:
18
- activemodel (4.1.16)
19
- activesupport (= 4.1.16)
20
- builder (~> 3.1)
21
- activerecord (4.1.16)
22
- activemodel (= 4.1.16)
23
- activesupport (= 4.1.16)
24
- arel (~> 5.0.0)
25
- activerecord-bogacs (0.5.0)
26
- activerecord-jdbc-adapter (1.3.21)
27
- activerecord (>= 2.2)
28
- activesupport (4.1.16)
29
- i18n (~> 0.6, >= 0.6.9)
30
- json (~> 1.7, >= 1.7.7)
31
- minitest (~> 5.1)
32
- thread_safe (~> 0.1)
33
- tzinfo (~> 1.1)
34
- arel (5.0.1.20140414130214)
35
- axiom-types (0.1.1)
36
- descendants_tracker (~> 0.0.4)
37
- ice_nine (~> 0.11.0)
38
- thread_safe (~> 0.3, >= 0.3.1)
39
- builder (3.2.2)
40
- coercible (1.0.0)
41
- descendants_tracker (~> 0.0.1)
42
- descendants_tracker (0.0.4)
43
- thread_safe (~> 0.3, >= 0.3.1)
44
- diff-lcs (1.1.3)
45
- equalizer (0.0.11)
46
- ethon (0.9.1)
47
- ffi (>= 1.3.0)
48
- faraday (0.9.2)
49
- multipart-post (>= 1.2, < 3)
50
- faraday_middleware (0.10.0)
51
- faraday (>= 0.7.4, < 0.10)
52
- ffi (1.9.14-java)
53
- hashie (3.4.6)
54
- i18n (0.7.0)
55
- ice_nine (0.11.1)
56
- inflection (1.0.0)
57
- jar-dependencies (0.3.1)
58
- jbundler (0.9.2)
59
- bundler (~> 1.5)
60
- jar-dependencies (~> 0.2)
61
- maven-tools (~> 1.0.10)
62
- ruby-maven (~> 3.3, >= 3.3.3)
63
- jdbc-mariadb (1.2.3)
64
- jdbc-sqlite3 (3.8.11.2)
65
- jruby-openssl (0.9.18-java)
66
- json (1.8.3-java)
67
- killbill (8.3.1)
68
- rack (>= 1.5.2)
69
- sinatra (~> 1.3.4)
70
- typhoeus (~> 0.6.9)
71
- tzinfo (~> 1.2.0)
72
- maven-tools (1.0.13)
73
- virtus (~> 1.0)
74
- mime-types (2.99.2)
75
- minitest (5.9.1)
76
- multipart-post (2.0.0)
77
- protected_attributes (1.1.3)
78
- activemodel (>= 4.0.1, < 5.0)
79
- rack (1.6.5)
80
- rack-protection (1.5.3)
81
- rack
82
- rake (10.4.2)
83
- rspec (2.12.0)
84
- rspec-core (~> 2.12.0)
85
- rspec-expectations (~> 2.12.0)
86
- rspec-mocks (~> 2.12.0)
87
- rspec-core (2.12.2)
88
- rspec-expectations (2.12.1)
89
- diff-lcs (~> 1.1.3)
90
- rspec-mocks (2.12.2)
91
- ruby-maven (3.3.8)
92
- ruby-maven-libs (~> 3.3.1)
93
- ruby-maven-libs (3.3.3)
94
- sinatra (1.3.6)
95
- rack (~> 1.4)
96
- rack-protection (~> 1.3)
97
- tilt (~> 1.3, >= 1.3.3)
98
- thread_safe (0.3.5-java)
99
- tilt (1.4.1)
100
- typhoeus (0.6.9)
101
- ethon (>= 0.7.1)
102
- tzinfo (1.2.2)
103
- thread_safe (~> 0.1)
104
- virtus (1.0.5)
105
- axiom-types (~> 0.1)
106
- coercible (~> 1.0)
107
- descendants_tracker (~> 0.0, >= 0.0.3)
108
- equalizer (~> 0.0, >= 0.0.9)
109
- zendesk_api (0.3.14)
110
- faraday (>= 0.8.0)
111
- faraday_middleware (>= 0.8.7)
112
- hashie (>= 1.2)
113
- inflection
114
- json
115
- mime-types
116
- multipart-post
117
-
118
- PLATFORMS
119
- java
120
-
121
- DEPENDENCIES
122
- jbundler (~> 0.9.2)
123
- jdbc-mariadb (~> 1.1)
124
- jdbc-sqlite3 (~> 3.7)
125
- killbill-zendesk!
126
- rake (>= 10.0.0)
127
- rspec (~> 2.12.0)
128
-
129
- BUNDLED WITH
130
- 1.11.2
data/Jarfile DELETED
@@ -1,12 +0,0 @@
1
- jar 'org.kill-bill.billing:killbill-api', '0.50'
2
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-currency', '0.23'
3
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-invoice', '0.23'
4
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-notification', '0.23'
5
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-payment', '0.23'
6
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-control', '0.23'
7
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-catalog', '0.23'
8
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-entitlement', '0.23'
9
- jar 'org.kill-bill.billing:killbill-util:tests', '0.18.0'
10
- jar 'org.kill-bill.billing:killbill-util', '0.18.0'
11
- jar 'org.mockito:mockito-all', '1.10.19'
12
- jar 'javax.servlet:javax.servlet-api', '3.1.0'
@@ -1,66 +0,0 @@
1
- ---
2
- :runtime:
3
- - io.dropwizard.metrics:metrics-core:jar:3.1.1
4
- - joda-time:joda-time:jar:2.3
5
- - org.weakref:jmxutils:jar:1.18
6
- - commons-beanutils:commons-beanutils:jar:1.8.3
7
- - com.google.inject:guice:jar:3.0
8
- - org.osgi:org.osgi.core:jar:5.0.0
9
- - com.fasterxml.jackson.core:jackson-databind:jar:2.4.5
10
- - org.kill-bill.billing.plugin:killbill-plugin-api-currency:jar:0.23
11
- - org.kill-bill.billing:killbill-platform-api:jar:0.36.1
12
- - com.samskivert:jmustache:jar:1.5
13
- - org.kill-bill.commons:killbill-clock:jar:0.20
14
- - org.kill-bill.billing:killbill-util:jar:0.18.0
15
- - com.fasterxml.jackson.dataformat:jackson-dataformat-csv:jar:2.4.5
16
- - org.bouncycastle:bcprov-jdk15on:jar:1.55
17
- - org.bouncycastle:bcpkix-jdk15on:jar:1.55
18
- - org.kill-bill.billing.plugin:killbill-plugin-api-entitlement:jar:0.23
19
- - org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4:jar:1.16
20
- - com.h2database:h2:jar:1.4.186
21
- - com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.4.5
22
- - javax.activation:activation:jar:1.1
23
- - org.javassist:javassist:jar:3.19.0-GA
24
- - org.skife.config:config-magic:jar:0.14
25
- - org.apache.commons:commons-email:jar:1.2
26
- - org.mockito:mockito-all:jar:1.10.19
27
- - antlr:antlr:jar:2.7.7
28
- - aopalliance:aopalliance:jar:1.0
29
- - com.zaxxer:HikariCP-java6:jar:2.3.7
30
- - org.slf4j:slf4j-api:jar:1.7.21
31
- - com.fasterxml.jackson.core:jackson-annotations:jar:2.4.3
32
- - org.antlr:stringtemplate:jar:3.2.1
33
- - org.slf4j:jcl-over-slf4j:jar:1.7.21
34
- - javax.mail:mail:jar:1.4.1
35
- - io.dropwizard.metrics:metrics-ehcache:jar:3.1.1
36
- - org.jdbi:jdbi:jar:2.62
37
- - com.fasterxml.jackson.core:jackson-core:jar:2.4.5
38
- - org.apache.felix:org.apache.felix.framework:jar:4.4.1
39
- - org.joda:joda-money:jar:0.9
40
- - org.kill-bill.billing.plugin:killbill-plugin-api-payment:jar:0.23
41
- - org.apache.shiro:shiro-core:jar:1.2.3
42
- - org.kill-bill.billing:killbill-internal-api:jar:0.18.0
43
- - org.kill-bill.billing:killbill-util:jar:tests:0.18.0
44
- - org.kill-bill.billing.plugin:killbill-plugin-api-control:jar:0.23
45
- - org.kill-bill.commons:killbill-jdbi:jar:0.20
46
- - com.google.guava:guava:jar:r09
47
- - org.kill-bill.commons:killbill-queue:jar:0.20
48
- - org.osgi:org.osgi.compendium:jar:5.0.0
49
- - org.kill-bill.commons:killbill-xmlloader:jar:0.20
50
- - javax.servlet:javax.servlet-api:jar:3.1.0
51
- - org.kill-bill.billing:killbill-platform-osgi:jar:0.36.1
52
- - org.kill-bill.billing:killbill-platform-base:jar:0.36.1
53
- - org.apache.shiro:shiro-ehcache:jar:1.2.3
54
- - javax.inject:javax.inject:jar:1
55
- - org.kill-bill.billing.plugin:killbill-plugin-api-invoice:jar:0.23
56
- - org.kill-bill.billing:killbill-api:jar:0.50
57
- - org.kill-bill.billing:killbill-platform-osgi-api:jar:0.36.1
58
- - com.google.inject.extensions:guice-multibindings:jar:3.0
59
- - net.sf.ehcache:ehcache:jar:2.9.1
60
- - org.kill-bill.commons:killbill-locker:jar:0.20
61
- - org.kill-bill.commons:killbill-embeddeddb-common:jar:0.20
62
- - org.apache.shiro:shiro-guice:jar:1.2.3
63
- - org.kill-bill.commons:killbill-concurrent:jar:0.20
64
- - org.kill-bill.billing.plugin:killbill-plugin-api-catalog:jar:0.23
65
- - org.kill-bill.billing.plugin:killbill-plugin-api-notification:jar:0.23
66
- - com.google.code.findbugs:annotations:jar:3.0.0
data/NEWS DELETED
@@ -1,52 +0,0 @@
1
- 3.0.0
2
- Initial release for Kill Bill 0.18.x
3
-
4
- 2.0.0
5
- Initial release for Kill Bill 0.16.x
6
-
7
- 1.3.0
8
- Update to latest killbill
9
- Change groupId to org.kill-bill.billing.plugin.ruby
10
-
11
- 1.2.4
12
- Add jruby-openssl dependency
13
-
14
- 1.2.3
15
- Fix packaging
16
-
17
- 1.2.2
18
- Update to killbill 2.0.0
19
-
20
- 1.2.1
21
- Update to killbill 1.9.0
22
-
23
- 1.2.0
24
- Update to killbill 1.8.3
25
-
26
- 1.1.0
27
- Update to killbill 1.7.1
28
-
29
- 1.0.1
30
- Fixes #1
31
-
32
- 1.0.0
33
- Update to killbill 1.6.0 (new entitlement APIs)
34
-
35
- 0.5.0
36
- Update to killbill 1.4.0
37
-
38
- 0.4.0
39
- Update to killbill 1.3.0
40
-
41
- 0.3.0
42
- Update to killbill 1.2.0
43
-
44
- 0.2.0
45
- Save local mapping if the user already exists in Zendesk
46
- Update to killbill 1.1.2
47
-
48
- 0.1.1
49
- Fix activerecord connections leak
50
-
51
- 0.1.0
52
- Initial version
data/README.md DELETED
@@ -1,97 +0,0 @@
1
- killbill-zendesk-plugin
2
- =======================
3
-
4
- Plugin to mirror Kill Bill data into Zendesk.
5
-
6
- Release builds are available on [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.kill-bill.billing.plugin.ruby%22%20AND%20a%3A%22zendesk-plugin%22) with coordinates `org.kill-bill.billing.plugin.ruby:zendesk-plugin`.
7
-
8
- Kill Bill compatibility
9
- -----------------------
10
-
11
- | Plugin version | Kill Bill version |
12
- | -------------: | ----------------: |
13
- | 2.x.y | 0.16.z |
14
- | 3.x.y | 0.18.z |
15
-
16
- User data mapping
17
- -----------------
18
-
19
- <table>
20
- <tr>
21
- <th>Zendesk attribute</th><th>Value</th>
22
- </tr>
23
- <tr>
24
- <td>name</td><td><em>Kill Bill account name</em></td>
25
- </tr>
26
- <tr>
27
- <td>external_id</td><td><em>Kill Bill account external key</em> if specified, <em>Kill Bill account id</em> otherwise</td>
28
- </tr>
29
- <tr>
30
- <td>locale</td><td><em>Kill Bill account locale</em></td>
31
- </tr>
32
- <tr>
33
- <td>time_zone</td><td><em>Kill Bill account timezone</em></td>
34
- </tr>
35
- <tr>
36
- <td>email</td><td><em>Kill Bill account email</em></td>
37
- </tr>
38
- <tr>
39
- <td>phone</td><td><em>Kill Bill account phone</em></td>
40
- </tr>
41
- <tr>
42
- <td>details</td><td><em>Kill Bill account address1</em>, <em>Kill Bill account address2</em>, <em>Kill Bill account city</em>, <em>Kill Bill account state or province</em>, <em>Kill Bill account postal code</em>, <em>Kill Bill account country</em></td>
43
- </tr>
44
- </table>
45
-
46
-
47
- Usage
48
- -----
49
-
50
- The plugin will automcatically listen to all account events (creation or update), and create or update the associated user in Zendesk.
51
-
52
- If you need to trigger a refresh manually, the plugin exposes the following endpoint:
53
-
54
- ```
55
- curl -v \
56
- -d'webrick=stupid' \
57
- -XPUT \
58
- "http://$HOST:8080/plugins/killbill-zendesk/users/<kb account id or kb external key>"
59
- ```
60
-
61
- Given a Kill Bill account id or Zendesk user id, you can retrieve the Kill Bill - Zendesk mapping via:
62
-
63
- ```
64
- curl -v \
65
- "http://$HOST:8080/plugins/killbill-zendesk/users/<kb account id or kb external key>"
66
- ```
67
-
68
- Requirements
69
- ------------
70
-
71
- The plugin needs a database to keep a local mapping between Kill Bill account ids and Zendesk user ids (this is to work around indexing delays in Zendesk). The latest version of the schema can be found [here](https://raw.github.com/killbill/killbill-zendesk-plugin/master/db/ddl.sql).
72
-
73
-
74
- Configuration
75
- -------------
76
-
77
- The plugin expects a `zendesk.yml` configuration file containing the following:
78
-
79
- ```
80
- curl -v \
81
- -X POST \
82
- -u admin:password \
83
- -H 'X-Killbill-ApiKey: bob' \
84
- -H 'X-Killbill-ApiSecret: lazar' \
85
- -H 'X-Killbill-CreatedBy: admin' \
86
- -H 'Content-Type: text/plain' \
87
- -d ':zendesk:
88
- :subdomain: 'mysubdomain'
89
- :username: 'email@domain.com'
90
- :password: 'password'
91
- # Alternatively, to use Token Authentication or OAuth
92
- #token: 'kX53RIXZKUFhZxSYhRxe7QGFocTkDmmERDxpcddF' 
93
- #access_token: 'kX53RIXZKUFhZxSYhRxe7QGFocTkDmmERDxpcddF'
94
- # Optional
95
- # :retry: true' \
96
- http://127.0.0.1:8080/1.0/kb/tenants/uploadPluginConfig/killbill-zendesk
97
- ```
data/Rakefile DELETED
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env rake
2
-
3
- # Install tasks to build and release the plugin
4
- require 'bundler/setup'
5
- Bundler::GemHelper.install_tasks
6
-
7
- # Install test tasks
8
- require 'rspec/core/rake_task'
9
- namespace :test do
10
- desc 'Run RSpec tests'
11
- RSpec::Core::RakeTask.new do |task|
12
- task.name = 'spec'
13
- task.pattern = './spec/*/*_spec.rb'
14
- end
15
-
16
- namespace :remote do
17
- desc 'Run RSpec remote tests'
18
- RSpec::Core::RakeTask.new do |task|
19
- task.name = 'spec'
20
- task.pattern = './spec/*/remote/*_spec.rb'
21
- end
22
- end
23
- end
24
-
25
- # Install tasks to package the plugin for Killbill
26
- require 'killbill/rake_task'
27
- Killbill::PluginHelper.install_tasks
28
-
29
- # Run tests by default
30
- task :default => 'test:spec'
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 3.0.0
data/config.ru DELETED
@@ -1,4 +0,0 @@
1
- require 'zendesk'
2
- require 'zendesk/config/application'
3
-
4
- run Sinatra::Application
data/db/ddl.sql DELETED
@@ -1,10 +0,0 @@
1
- CREATE TABLE `zendesk_users` (
2
- `id` int(11) NOT NULL AUTO_INCREMENT,
3
- `kb_account_id` varchar(255) NOT NULL,
4
- `zd_user_id` int(11) NOT NULL,
5
- `created_at` datetime NOT NULL,
6
- `updated_at` datetime NOT NULL,
7
- PRIMARY KEY (`id`),
8
- UNIQUE KEY `index_zendesk_users_on_kb_account_id` (`kb_account_id`),
9
- UNIQUE KEY `index_zendesk_users_on_zd_user_id` (`zd_user_id`)
10
- ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
@@ -1,13 +0,0 @@
1
- require 'active_record'
2
-
3
- ActiveRecord::Schema.define(:version => 20130606153635) do
4
- create_table 'zendesk_users', :force => true do |t|
5
- t.string 'kb_account_id', :null => false
6
- t.integer 'zd_user_id', :null => false
7
- t.datetime 'created_at', :null => false
8
- t.datetime 'updated_at', :null => false
9
- end
10
-
11
- add_index(:zendesk_users, :kb_account_id, :unique => true)
12
- add_index(:zendesk_users, :zd_user_id, :unique => true)
13
- end
@@ -1,47 +0,0 @@
1
- version = File.read(File.expand_path('../VERSION', __FILE__)).strip
2
-
3
- Gem::Specification.new do |s|
4
- s.name = 'killbill-zendesk'
5
- s.version = version
6
- s.summary = 'Plugin to mirror Kill Bill data into Zendesk'
7
- s.description = 'Kill Bill notification plugin for Zendesk.'
8
-
9
- s.required_ruby_version = '>= 1.9.3'
10
-
11
- s.license = 'Apache License (2.0)'
12
-
13
- s.author = 'Kill Bill core team'
14
- s.email = 'killbilling-users@googlegroups.com'
15
- s.homepage = 'http://killbill.io'
16
-
17
- s.files = `git ls-files`.split("\n")
18
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- s.bindir = 'bin'
20
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
- s.require_paths = ["lib"]
22
-
23
- s.rdoc_options << '--exclude' << '.'
24
-
25
- s.add_dependency 'killbill', '~> 8.0'
26
-
27
- s.add_dependency 'sinatra', '~> 1.3.4'
28
- s.add_dependency 'zendesk_api', '~> 0.3.10'
29
- s.add_dependency 'mime-types', '< 3'
30
- s.add_dependency 'protected_attributes', '~> 1.1.3'
31
- s.add_dependency 'activerecord', '~> 4.1.0'
32
- if defined?(JRUBY_VERSION)
33
- s.add_dependency 'activerecord-bogacs', '~> 0.3'
34
- s.add_dependency 'activerecord-jdbc-adapter', '~> 1.3', '< 1.5'
35
- s.add_dependency 'jruby-openssl', '~> 0.9.7'
36
- end
37
-
38
- s.add_development_dependency 'jbundler', '~> 0.9.2'
39
- s.add_development_dependency 'rake', '>= 10.0.0'
40
- s.add_development_dependency 'rspec', '~> 2.12.0'
41
- if defined?(JRUBY_VERSION)
42
- s.add_development_dependency 'jdbc-sqlite3', '~> 3.7'
43
- s.add_development_dependency 'jdbc-mariadb', '~> 1.1'
44
- else
45
- s.add_development_dependency 'sqlite3', '~> 1.3.7'
46
- end
47
- end
@@ -1,3 +0,0 @@
1
- mainClass=Killbill::Zendesk::ZendeskPlugin
2
- require=zendesk
3
- pluginType=NOTIFICATION
data/pom.xml DELETED
@@ -1,44 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
- ~ Copyright 2010-2013 Ning, Inc.
4
- ~
5
- ~ Ning licenses this file to you under the Apache License, version 2.0
6
- ~ (the "License"); you may not use this file except in compliance with the
7
- ~ License. You may obtain a copy of the License at:
8
- ~
9
- ~ http://www.apache.org/licenses/LICENSE-2.0
10
- ~
11
- ~ Unless required by applicable law or agreed to in writing, software
12
- ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- ~ License for the specific language governing permissions and limitations
15
- ~ under the License.
16
- -->
17
-
18
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19
- <parent>
20
- <groupId>org.sonatype.oss</groupId>
21
- <artifactId>oss-parent</artifactId>
22
- <version>5</version>
23
- </parent>
24
- <modelVersion>4.0.0</modelVersion>
25
- <groupId>org.kill-bill.billing.plugin.ruby</groupId>
26
- <artifactId>zendesk-plugin</artifactId>
27
- <packaging>pom</packaging>
28
- <version>3.0.0</version>
29
- <name>zendesk-plugin</name>
30
- <url>http://github.com/killbill/killbill-zendesk-plugin</url>
31
- <description>Plugin to mirror Kill Bill data into Zendesk</description>
32
- <licenses>
33
- <license>
34
- <name>Apache License 2.0</name>
35
- <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
36
- <distribution>repo</distribution>
37
- </license>
38
- </licenses>
39
- <scm>
40
- <connection>scm:git:git://github.com/killbill/killbill-zendesk-plugin.git</connection>
41
- <url>https://github.com/killbill/killbill-zendesk-plugin/</url>
42
- <developerConnection>scm:git:git@github.com:killbill/killbill-zendesk-plugin.git</developerConnection>
43
- </scm>
44
- </project>
data/release.sh DELETED
@@ -1,41 +0,0 @@
1
- set -e
2
-
3
- if [ "GNU" != "$(tar --help | grep GNU | head -1 | awk '{print $1}')" ]; then
4
- echo "Unable to release: make sure to use GNU tar"
5
- exit 1
6
- fi
7
-
8
- if $(ruby -e'require "java"'); then
9
- # Good
10
- echo "Detected JRuby"
11
- else
12
- echo "Unable to release: make sure to use JRuby"
13
- exit 1
14
- fi
15
-
16
- VERSION=`grep -E '<version>([0-9]+\.[0-9]+\.[0-9]+)</version>' pom.xml | sed 's/[\t \n]*<version>\(.*\)<\/version>[\t \n]*/\1/'`
17
- if [ "$VERSION" != "$(cat $PWD/VERSION)" ]; then
18
- echo "Unable to release: make sure the versions in pom.xml and VERSION match"
19
- exit 1
20
- fi
21
-
22
- echo "Cleaning up"
23
- rake killbill:clean ; rake build
24
-
25
- echo "Pushing the gem to Rubygems"
26
- rake release
27
-
28
- echo "Building artifact"
29
- rake killbill:package
30
-
31
- ARTIFACT="$PWD/pkg/killbill-zendesk-$VERSION.tar.gz"
32
- echo "Pushing $ARTIFACT to Maven Central"
33
- mvn gpg:sign-and-deploy-file \
34
- -DgroupId=org.kill-bill.billing.plugin.ruby \
35
- -DartifactId=zendesk-plugin \
36
- -Dversion=$VERSION \
37
- -Dpackaging=tar.gz \
38
- -DrepositoryId=ossrh-releases \
39
- -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ \
40
- -Dfile=$ARTIFACT \
41
- -DpomFile=pom.xml
@@ -1,36 +0,0 @@
1
- require 'bundler'
2
- require 'zendesk'
3
-
4
- require 'logger'
5
- require 'ostruct'
6
-
7
- require 'rspec'
8
-
9
- RSpec.configure do |config|
10
- config.color_enabled = true
11
- config.tty = true
12
- config.formatter = 'documentation'
13
- end
14
-
15
- require 'active_record'
16
- ActiveRecord::Base.establish_connection(
17
- :adapter => 'sqlite3',
18
- :database => 'test.db'
19
- )
20
- # Create the schema
21
- require File.expand_path(File.dirname(__FILE__) + '../../db/schema.rb')
22
-
23
- begin
24
- require 'securerandom'
25
- SecureRandom.uuid
26
- rescue LoadError, NoMethodError
27
- # See http://jira.codehaus.org/browse/JRUBY-6176
28
- module SecureRandom
29
- def self.uuid
30
- ary = self.random_bytes(16).unpack("NnnnnN")
31
- ary[2] = (ary[2] & 0x0fff) | 0x4000
32
- ary[3] = (ary[3] & 0x3fff) | 0x8000
33
- "%08x-%04x-%04x-%04x-%04x%08x" % ary
34
- end unless respond_to?(:uuid)
35
- end
36
- end
@@ -1,87 +0,0 @@
1
- require 'spec_helper'
2
-
3
- class FakeJavaUserAccountApi
4
- attr_accessor :accounts
5
-
6
- def initialize
7
- @accounts = []
8
- end
9
-
10
- def get_account_by_id(id, context)
11
- @accounts.find { |account| account.id == id.to_s }
12
- end
13
-
14
- def get_account_by_key(external_key, context)
15
- @accounts.find { |account| account.external_key == external_key.to_s }
16
- end
17
- end
18
-
19
- describe Killbill::Zendesk::ZendeskPlugin do
20
- before(:each) do
21
- @plugin = Killbill::Zendesk::ZendeskPlugin.new
22
- @plugin.conf_dir = File.expand_path(File.dirname(__FILE__) + '../../../../')
23
-
24
- logger = Logger.new(STDOUT)
25
- logger.level = Logger::DEBUG
26
- @plugin.logger = logger
27
-
28
- @account_api = FakeJavaUserAccountApi.new
29
- svcs = {:account_user_api => @account_api}
30
- @plugin.kb_apis = Killbill::Plugin::KillbillApi.new('zendesk', svcs)
31
-
32
- @plugin.start_plugin
33
- end
34
-
35
- after(:each) do
36
- @plugin.stop_plugin
37
- end
38
-
39
- it 'should be able to create and update a user' do
40
- external_key, kb_account_id = create_kb_account
41
-
42
- # Verify the initial state of our table
43
- Killbill::Zendesk::ZendeskUser.count.should == 0
44
-
45
- # Verify the account doesn't exist yet
46
- @plugin.updater.find_by_external_id(external_key).should be_nil
47
-
48
- # Send a creation event
49
- @plugin.on_event OpenStruct.new(:event_type => :ACCOUNT_CREATION, :account_id => kb_account_id)
50
-
51
- # We should now verify the account exists, but we can't, due to indexing lag :/
52
- #@plugin.updater.find_by_external_id(external_key).email.should == email
53
- # Instead, we use our table
54
- Killbill::Zendesk::ZendeskUser.count.should == 1
55
-
56
- # Send an update event
57
- @plugin.on_event OpenStruct.new(:event_type => :ACCOUNT_CHANGE, :account_id => kb_account_id)
58
-
59
- # Verify we didn't create dups
60
- #@plugin.updater.find_all_by_external_id(external_key).count.should == 1
61
- Killbill::Zendesk::ZendeskUser.count.should == 1
62
-
63
- # Create a new user
64
- external_key, kb_account_id = create_kb_account
65
- @plugin.on_event OpenStruct.new(:event_type => :ACCOUNT_CREATION, :account_id => kb_account_id)
66
-
67
- Killbill::Zendesk::ZendeskUser.count.should == 2
68
- end
69
-
70
- private
71
-
72
- def create_kb_account
73
- external_key = Time.now.to_i.to_s + '-test'
74
- kb_account_id = SecureRandom.uuid
75
- email = external_key + '@tester.com'
76
-
77
- account = Killbill::Plugin::Model::Account.new
78
- account.id = kb_account_id
79
- account.external_key = external_key
80
- account.email = email
81
- account.name = 'Integration spec'
82
-
83
- @account_api.accounts << account
84
-
85
- return external_key, kb_account_id
86
- end
87
- end
@@ -1,57 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Killbill::Zendesk::UserUpdater do
4
- it 'should build the details line' do
5
- updater = Killbill::Zendesk::UserUpdater.new(nil, nil, nil)
6
-
7
- account = build_account(nil, nil, nil, nil, nil, nil)
8
- updater.build_details_field(account).should == ''
9
-
10
- account = build_account('493 Slro road', nil, nil, nil, nil, nil)
11
- updater.build_details_field(account).should == '493 Slro road'
12
-
13
- account = build_account('493 Slro road', nil, 'Fola', nil, nil, nil)
14
- updater.build_details_field(account).should == '493 Slro road, Fola'
15
-
16
- account = build_account('493 Slro road', nil, 'Fola', 'FG', nil, nil)
17
- updater.build_details_field(account).should == '493 Slro road, Fola, FG'
18
-
19
- account = build_account('493 Slro road', nil, 'Fola', 'FG', 140, nil)
20
- updater.build_details_field(account).should == '493 Slro road, Fola, FG, 140'
21
-
22
- account = build_account('493 Slro road', 'apt 33', 'Fola', 'FG', 140, nil)
23
- updater.build_details_field(account).should == '493 Slro road, apt 33, Fola, FG, 140'
24
-
25
- account = build_account('493 Slro road', 'apt 33', 'Fola', 'FG', 140, 'Floq')
26
- updater.build_details_field(account).should == '493 Slro road, apt 33, Fola, FG, 140, Floq'
27
- end
28
-
29
- it 'should save the mappings locally' do
30
- updater = Killbill::Zendesk::UserUpdater.new(nil, nil, nil)
31
- kb_account = OpenStruct.new(:id => '11-22-33-44-55')
32
- zd_user = OpenStruct.new(:id => 9402871)
33
-
34
- Killbill::Zendesk::ZendeskUser.all.size.should == 0
35
-
36
- updater.save_kb_zd_mapping kb_account, zd_user
37
- Killbill::Zendesk::ZendeskUser.all.size.should == 1
38
- Killbill::Zendesk::ZendeskUser.find_by_kb_account_id(kb_account.id).zd_user_id.should == zd_user.id
39
-
40
- updater.save_kb_zd_mapping kb_account, zd_user
41
- Killbill::Zendesk::ZendeskUser.all.size.should == 1
42
- Killbill::Zendesk::ZendeskUser.find_by_kb_account_id(kb_account.id).zd_user_id.should == zd_user.id
43
- end
44
-
45
- private
46
-
47
- def build_account(address1, address2, city, state_or_province, postal_code, country)
48
- account = Killbill::Plugin::Model::Account.new
49
- account.address1 = address1
50
- account.address2 = address2
51
- account.city = city
52
- account.state_or_province = state_or_province
53
- account.postal_code = postal_code
54
- account.country = country
55
- account
56
- end
57
- end
@@ -1,29 +0,0 @@
1
- :zendesk:
2
- :subdomain: <%= ENV['SUBDOMAIN'] %>
3
- :username: <%= ENV['USERNAME'] %>
4
- :password: <%= ENV['PASSWORD'] %>
5
-
6
- :database:
7
- # SQLite (development)
8
- :adapter: sqlite3
9
- :database: test.db
10
- # For MySQL
11
- # :adapter: mysql
12
- # :username: 'killbill'
13
- # :password: 'killbill'
14
- # :database: 'killbill' # or set the URL :
15
- # #:url: jdbc:mysql://127.0.0.1:3306/killbill
16
- # :driver: org.mariadb.jdbc.Driver # as in KB
17
- # :pool: 30 # AR's default is max 5 connections
18
- # In Kill Bill
19
- # :adapter: mysql
20
- # :jndi: 'killbill/osgi/jdbc'
21
- # :pool: false # false-pool (JNDI pool's max)
22
- # # uncomment if pool does not support JDBC4 :
23
- # #:connection_alive_sql: 'select 1'
24
- # # MySQL adapter #configure_connection defaults :
25
- # # @@SESSION.sql_auto_is_null = 0,
26
- # # @@SESSION.wait_timeout = 2147483,
27
- # # @@SESSION.sql_mode = 'STRICT_ALL_TABLES'
28
- # # ... can be disabled (on AR-JDBC 1.4) using :
29
- # :configure_connection: false