killbill 8.3.4 → 8.3.5

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: 6d643e71a3a12df8fab7f10f55095ab7b4a65ee4
4
- data.tar.gz: 390ad4daadaecb7f8a72a709cab811eda25b04e5
3
+ metadata.gz: 0feadd53142c721c9c1d4f1104e5f1fccf96a28c
4
+ data.tar.gz: b0dae2773e4858d1f5a05486dbd1bf3cbb6c8983
5
5
  SHA512:
6
- metadata.gz: 129c63889f636f2a527127aec4ef3adfa83d2afa0796f7fb9cb40cd5fa8f2e0c2025394e97efc0dcbd21549dc774af38f910bdaf629009a538f49606a5961a3d
7
- data.tar.gz: 42e7fc83720a204d7bffd7e6911a3f06811cd8a69d3125203cde0c20ecba678c8c6ee5623b807475c281a38ada69b224b4f54314a29b6d56b1314d3f63bd637e
6
+ metadata.gz: f0ddb8614065fe850c6861b64b34df56a4bdc71e5573ea7a8daaf7338a18e39c5b1e5a9aa5901270b98c88d0d85b62b8f8566878ba8a4e8e4acfb3bd7f44e5e0
7
+ data.tar.gz: cc7eb2a3777464e2fc47a7226ef7435786d230960099a9469c2ff39f0fe6241a0dbbad269d3268a806f070075b1fef5ec50b7edb597adb97c9a00a980cc881ed
@@ -0,0 +1,138 @@
1
+ defaults: &defaults
2
+ working_directory: ~/repo
3
+ environment:
4
+ JRUBY_OPTS: -J-Xmx1024M
5
+
6
+ version: 2
7
+ jobs:
8
+ build-jruby-1.7.26:
9
+ <<: *defaults
10
+ docker:
11
+ - image: killbill/kbbuild:0.5.0
12
+ steps:
13
+ - checkout
14
+ - restore_cache:
15
+ key: v4-dependencies-jruby-1.7.26-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
16
+ - run:
17
+ name: Install gem dependencies
18
+ command: |
19
+ bundle install --jobs=4 --retry=3 --path=vendor/bundle
20
+ bundle exec jbundle install
21
+ - save_cache:
22
+ paths:
23
+ - ~/.m2
24
+ - .bundle
25
+ - .jbundler
26
+ - vendor/bundle
27
+ key: v4-dependencies-jruby-1.7.26-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
28
+
29
+ test-mysql-jruby-1.7.26:
30
+ <<: *defaults
31
+ docker:
32
+ - image: killbill/kbbuild:0.5.0
33
+ - image: killbill/mariadb:0.19
34
+ environment:
35
+ - MYSQL_ROOT_PASSWORD=root
36
+ steps:
37
+ - checkout
38
+ - restore_cache:
39
+ key: v4-dependencies-jruby-1.7.26-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
40
+ - run:
41
+ name: Setup DDL
42
+ command: |
43
+ set +e
44
+ count=0
45
+ until mysqladmin ping -h 127.0.0.1 -u root --password=root --silent; do
46
+ if [[ "$count" == "25" ]]; then
47
+ exit 1
48
+ fi
49
+ (( count++ ))
50
+ printf '.'
51
+ sleep 5
52
+ done
53
+ set -e
54
+ mysql -h 127.0.0.1 -u root --password=root -e 'create database killbill_test;'
55
+ - run:
56
+ name: Run tests
57
+ command: |
58
+ mkdir /tmp/test-results
59
+ AR_ADAPTER='mariadb' AR_USERNAME='root' AR_PASSWORD='' AR_DATABASE='killbill_test' bundle exec rake test:spec | tee /tmp/test-results/test.txt 2>&1
60
+ AR_ADAPTER='mariadb' AR_USERNAME='root' AR_PASSWORD='' AR_DATABASE='killbill_test' bundle exec rake test:remote:spec | tee /tmp/test-results/remote-test.txt 2>&1
61
+ - store_test_results:
62
+ path: /tmp/test-results
63
+ - store_artifacts:
64
+ path: /tmp/test-results
65
+ destination: test-results
66
+
67
+ test-postgresql-jruby-1.7.26:
68
+ <<: *defaults
69
+ docker:
70
+ - image: killbill/kbbuild:0.5.0
71
+ - image: killbill/postgresql:0.19
72
+ environment:
73
+ - POSTGRES_PASSWORD=postgres
74
+ steps:
75
+ - checkout
76
+ - restore_cache:
77
+ key: v4-dependencies-jruby-1.7.26-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
78
+ - run:
79
+ name: Setup DDL
80
+ command: |
81
+ set +e
82
+ count=0
83
+ until $(psql -h 127.0.0.1 -U postgres -p 5432 -l > /dev/null); do
84
+ if [[ "$count" == "25" ]]; then
85
+ exit 1
86
+ fi
87
+ (( count++ ))
88
+ printf '.'
89
+ sleep 5
90
+ done
91
+ set -e
92
+ psql -h 127.0.0.1 -U postgres -p 5432 -c 'create database killbill_test;'
93
+ - run:
94
+ name: Run tests
95
+ command: |
96
+ mkdir /tmp/test-results
97
+ AR_ADAPTER='postgresql' AR_USERNAME='postgres' AR_DATABASE='killbill_test' bundle exec rake test:spec | tee /tmp/test-results/test.txt 2>&1
98
+ AR_ADAPTER='postgresql' AR_USERNAME='postgres' AR_DATABASE='killbill_test' bundle exec rake test:remote:spec | tee /tmp/test-results/remote-test.txt 2>&1
99
+ - store_test_results:
100
+ path: /tmp/test-results
101
+ - store_artifacts:
102
+ path: /tmp/test-results
103
+ destination: test-results
104
+
105
+ test-h2-jruby-1.7.26:
106
+ <<: *defaults
107
+ docker:
108
+ - image: killbill/kbbuild:0.5.0
109
+ steps:
110
+ - checkout
111
+ - restore_cache:
112
+ key: v4-dependencies-jruby-1.7.26-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
113
+ - run:
114
+ name: Run tests
115
+ command: |
116
+ mkdir /tmp/test-results
117
+ AR_ADAPTER='sqlite3' AR_DATABASE='test.db' bundle exec rake test:spec | tee /tmp/test-results/test.txt 2>&1
118
+ AR_ADAPTER='sqlite3' AR_DATABASE='test.db' bundle exec rake test:remote:spec | tee /tmp/test-results/remote-test.txt 2>&1
119
+ - store_test_results:
120
+ path: /tmp/test-results
121
+ - store_artifacts:
122
+ path: /tmp/test-results
123
+ destination: test-results
124
+
125
+ workflows:
126
+ version: 2
127
+ build-and-test:
128
+ jobs:
129
+ - build-jruby-1.7.26
130
+ #- test-mysql-jruby-1.7.26:
131
+ # requires:
132
+ # - build-jruby-1.7.26
133
+ - test-postgresql-jruby-1.7.26:
134
+ requires:
135
+ - build-jruby-1.7.26
136
+ - test-h2-jruby-1.7.26:
137
+ requires:
138
+ - build-jruby-1.7.26
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- killbill (8.3.4)
4
+ killbill (8.3.5)
5
5
  rack (>= 1.5.2)
6
6
  sinatra (~> 1.3.4)
7
7
  typhoeus (~> 0.6.9)
data/NEWS CHANGED
@@ -1,3 +1,6 @@
1
+ 8.3.5
2
+ ActiveMerchant: add utility function to avoid persisting sensitive data (GDPR)
3
+
1
4
  8.3.4
2
5
  ActiveMerchant: pass in extra_params to gateway api calls
3
6
 
@@ -22,6 +22,7 @@ module Killbill
22
22
  # But regardless, for performance reasons, we want to set these timestamps ourselves
23
23
  # See ActiveRecord::Timestamp
24
24
  current_time = Time.now.utc
25
+ remove_sensitive_data_and_compact(extra_params)
25
26
  model.new({
26
27
  :api_call => api_call,
27
28
  :kb_account_id => kb_account_id,
@@ -43,7 +44,7 @@ module Killbill
43
44
  :success => response.success?,
44
45
  :created_at => current_time,
45
46
  :updated_at => current_time
46
- }.merge!(extra_params.compact)) # Don't override with nil values
47
+ }.merge!(extra_params))
47
48
  end
48
49
 
49
50
  def self.create_response_and_transaction(identifier, transaction_model, api_call, kb_account_id, kb_payment_id, kb_payment_transaction_id, transaction_type, payment_processor_account_id, kb_tenant_id, gw_response, amount_in_cents, currency, extra_params = {}, model = Response)
@@ -159,9 +160,9 @@ module Killbill
159
160
  def self.search_where_clause(t, search_key)
160
161
  # Exact matches only
161
162
  where_clause = t[:kb_payment_id].eq(search_key)
162
- .or(t[:kb_payment_transaction_id].eq(search_key))
163
- .or(t[:message].eq(search_key))
164
- .or(t[:authorization].eq(search_key))
163
+ .or(t[:kb_payment_transaction_id].eq(search_key))
164
+ .or(t[:message].eq(search_key))
165
+ .or(t[:authorization].eq(search_key))
165
166
 
166
167
  # Only search successful payments and refunds
167
168
  where_clause = where_clause.and(t[:success].eq(true))
@@ -207,6 +208,16 @@ module Killbill
207
208
  pagination
208
209
  end
209
210
 
211
+ def self.remove_sensitive_data_and_compact(extra_params)
212
+ extra_params.compact!
213
+ extra_params.delete_if { |k, _| sensitive_fields.include?(k) }
214
+ end
215
+
216
+ # Override in your plugin if needed
217
+ def self.sensitive_fields
218
+ []
219
+ end
220
+
210
221
  # Override in your plugin if needed
211
222
  def txn_id
212
223
  authorization
@@ -289,4 +300,4 @@ module Killbill
289
300
  end
290
301
  end
291
302
  end
292
- end
303
+ end
@@ -1,3 +1,3 @@
1
1
  module Killbill
2
- VERSION = '8.3.4'
2
+ VERSION = '8.3.5'
3
3
  end
@@ -135,6 +135,13 @@ describe Killbill::Plugin::ActiveMerchant::ActiveRecord::Response do
135
135
  ::Killbill::Test::TestResponse.from_kb_payment_id(::Killbill::Test::TestTransaction, kb_payment_id3, kb_tenant_id).size == 0
136
136
  end
137
137
 
138
+ it 'should filter out sensitive parameter if specified' do
139
+ extra_params = {:email => "test.test", :payer_id => "test"}
140
+ ::Killbill::Test::TestResponse.send(:remove_sensitive_data_and_compact, extra_params)
141
+ extra_params[:email].should be_nil
142
+ extra_params[:payer_id].should == "test"
143
+ end
144
+
138
145
  it 'should generate the right SQL query' do
139
146
  # Check count query (search query numeric)
140
147
  expected_query = "SELECT COUNT(DISTINCT #{q('test_responses')}.#{q('id')}) FROM #{q('test_responses')} WHERE (((#{q('test_responses')}.#{q('kb_payment_id')} = '1234' OR #{q('test_responses')}.#{q('kb_payment_transaction_id')} = '1234') OR #{q('test_responses')}.#{q('message')} = '1234') OR #{q('test_responses')}.#{q('authorization')} = '1234') AND #{q('test_responses')}.#{q('success')} = #{qtrue} AND #{q('test_responses')}.#{q('kb_tenant_id')} = '11-22-33'"
@@ -6,6 +6,10 @@ module Killbill #:nodoc:
6
6
 
7
7
  has_one :test_transaction
8
8
 
9
+ def self.sensitive_fields
10
+ [:email]
11
+ end
12
+
9
13
  end
10
14
  end
11
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.3.4
4
+ version: 8.3.5
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: 2018-03-26 00:00:00.000000000 Z
11
+ date: 2018-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -317,8 +317,8 @@ executables:
317
317
  extensions: []
318
318
  extra_rdoc_files: []
319
319
  files:
320
+ - ".circleci/config.yml"
320
321
  - ".gitignore"
321
- - ".travis.yml"
322
322
  - Gemfile
323
323
  - Gemfile.head
324
324
  - Gemfile.lock
data/.travis.yml DELETED
@@ -1,51 +0,0 @@
1
- language: ruby
2
-
3
- sudo: false
4
- cache:
5
- bundler: true
6
- directories:
7
- - $HOME/.m2
8
-
9
- services:
10
- - mysql
11
- - postgresql
12
-
13
- before_script:
14
- - bundle exec jbundle install
15
- - mysql -uroot -e 'create database killbill_test;'
16
- - psql -c 'create database killbill_test;' -U postgres
17
-
18
- notifications:
19
- email:
20
- - kill-bill-commits@googlegroups.com
21
-
22
- env:
23
- global:
24
- - JRUBY_OPTS='-J-Xmx1024M'
25
- matrix:
26
- # Need MySQL 5.6 - see https://github.com/travis-ci/travis-ci/issues/1986
27
- #- AR_ADAPTER='mariadb' AR_USERNAME='root' AR_PASSWORD='' AR_DATABASE='killbill_test'
28
- - AR_ADAPTER='postgresql' AR_USERNAME='postgres' AR_DATABASE='killbill_test'
29
- - AR_ADAPTER='sqlite3' AR_DATABASE='test.db'
30
-
31
- rvm:
32
- - jruby-1.7.20
33
- - jruby-20mode # latest 1.7.x
34
- - jruby-head
35
-
36
- gemfile:
37
- - Gemfile
38
- - Gemfile.head
39
-
40
- jdk:
41
- - openjdk7
42
- - oraclejdk7
43
- - oraclejdk8
44
-
45
- matrix:
46
- allow_failures:
47
- - rvm: jruby-head
48
- - rvm: jruby-20mode # Gemfile.lock bug with --deployment?
49
- - jdk: oraclejdk8
50
- - gemfile: Gemfile.head
51
- fast_finish: true