killbill-stripe 0.2.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,23 +7,15 @@ describe Killbill::Stripe::PaymentPlugin do
7
7
  include ::Killbill::Plugin::ActiveMerchant::RSpec
8
8
 
9
9
  before(:each) do
10
- @plugin = Killbill::Stripe::PaymentPlugin.new
10
+ ::Killbill::Stripe::StripePaymentMethod.delete_all
11
+ ::Killbill::Stripe::StripeResponse.delete_all
12
+ ::Killbill::Stripe::StripeTransaction.delete_all
11
13
 
12
- @account_api = ::Killbill::Plugin::ActiveMerchant::RSpec::FakeJavaUserAccountApi.new
13
- @payment_api = ::Killbill::Plugin::ActiveMerchant::RSpec::FakeJavaPaymentApi.new
14
- @tenant_api = ::Killbill::Plugin::ActiveMerchant::RSpec::FakeJavaTenantUserApi.new({})
15
- svcs = {:account_user_api => @account_api, :payment_api => @payment_api, :tenant_user_api => @tenant_api}
16
- @plugin.kb_apis = Killbill::Plugin::KillbillApi.new('stripe', svcs)
17
-
18
- @call_context = Killbill::Plugin::Model::CallContext.new
19
- @call_context.tenant_id = '00000011-0022-0033-0044-000000000055'
20
- @call_context = @call_context.to_ruby(@call_context)
21
-
22
- @plugin.logger = Logger.new(STDOUT)
23
- @plugin.logger.level = Logger::INFO
24
- @plugin.conf_dir = File.expand_path(File.dirname(__FILE__) + '../../../../')
14
+ @plugin = build_plugin(::Killbill::Stripe::PaymentPlugin, 'stripe')
25
15
  @plugin.start_plugin
26
16
 
17
+ @call_context = build_call_context
18
+
27
19
  @properties = []
28
20
  @pm = create_payment_method(::Killbill::Stripe::StripePaymentMethod, nil, @call_context.tenant_id, @properties)
29
21
  @amount = BigDecimal.new('100')
@@ -31,7 +23,7 @@ describe Killbill::Stripe::PaymentPlugin do
31
23
 
32
24
  kb_payment_id = SecureRandom.uuid
33
25
  1.upto(6) do
34
- @kb_payment = @payment_api.add_payment(kb_payment_id)
26
+ @kb_payment = @plugin.kb_apis.proxied_services[:payment_api].add_payment(kb_payment_id)
35
27
  end
36
28
  end
37
29
 
@@ -80,7 +72,7 @@ describe Killbill::Stripe::PaymentPlugin do
80
72
  properties = build_pm_properties
81
73
 
82
74
  # We created the payment methods, hence the rows
83
- max_response_id = Killbill::Stripe::StripeResponse.all.last.id
75
+ nb_responses = Killbill::Stripe::StripeResponse.count
84
76
  Killbill::Stripe::StripeTransaction.all.size.should == 0
85
77
 
86
78
  payment_response = @plugin.purchase_payment(@pm.kb_account_id, @kb_payment.id, @kb_payment.transactions[0].id, @pm.kb_payment_method_id, @amount, @currency, properties, @call_context)
@@ -89,9 +81,9 @@ describe Killbill::Stripe::PaymentPlugin do
89
81
  payment_response.transaction_type.should == :PURCHASE
90
82
 
91
83
  responses = Killbill::Stripe::StripeResponse.all
92
- responses.size.should == max_response_id + 1
93
- responses[max_response_id].api_call.should == 'purchase'
94
- responses[max_response_id].message.should == 'Transaction approved'
84
+ responses.size.should == nb_responses + 1
85
+ responses[nb_responses].api_call.should == 'purchase'
86
+ responses[nb_responses].message.should == 'Transaction approved'
95
87
  transactions = Killbill::Stripe::StripeTransaction.all
96
88
  transactions.size.should == 1
97
89
  transactions[0].api_call.should == 'purchase'
data/stripe.yml CHANGED
@@ -1,21 +1,29 @@
1
1
  :stripe:
2
- :api_secret_key: ''
3
- :api_publishable_key: ''
4
- :log_file: '/var/tmp/stripe.log'
2
+ :api_secret_key: <%= ENV['API_SECRET_KEY'] %>
3
+ :api_publishable_key: <%= ENV['API_PUBLISHABLE_KEY'] %>
5
4
  :test: true
6
5
 
7
6
  :database:
7
+ # SQLite (development)
8
8
  :adapter: sqlite3
9
9
  :database: test.db
10
10
  # For MySQL
11
- # :adapter: 'jdbcmysql'
11
+ # :adapter: mysql
12
12
  # :username: 'killbill'
13
13
  # :password: 'killbill'
14
- # :driver: 'com.mysql.jdbc.Driver'
15
- # :url: 'jdbc:mysql://127.0.0.1:3306/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
16
18
  # In Kill Bill
17
- # :adapter: 'jdbcmysql'
19
+ # :adapter: mysql
18
20
  # :jndi: 'killbill/osgi/jdbc'
19
- # :driver: 'com.mysql.jdbc.Driver'
20
- # :connection_alive_sql: 'select 1'
21
- # :pool: 250
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
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 1.0.0
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: 2015-03-12 00:00:00.000000000 Z
11
+ date: 2015-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: killbill
@@ -16,100 +16,100 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.4
19
+ version: 4.0.0
20
20
  requirement: !ruby/object:Gem::Requirement
21
21
  requirements:
22
22
  - - ~>
23
23
  - !ruby/object:Gem::Version
24
- version: 3.2.4
24
+ version: 4.0.0
25
25
  prerelease: false
26
26
  type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
- name: thread_safe
28
+ name: sinatra
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.4
33
+ version: 1.3.4
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
36
36
  - - ~>
37
37
  - !ruby/object:Gem::Version
38
- version: 0.3.4
38
+ version: 1.3.4
39
39
  prerelease: false
40
40
  type: :runtime
41
41
  - !ruby/object:Gem::Dependency
42
- name: activemerchant
42
+ name: thread_safe
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 1.44.1
47
+ version: 0.3.4
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - ~>
51
51
  - !ruby/object:Gem::Version
52
- version: 1.44.1
52
+ version: 0.3.4
53
53
  prerelease: false
54
54
  type: :runtime
55
55
  - !ruby/object:Gem::Dependency
56
- name: offsite_payments
56
+ name: activerecord
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.1
61
+ version: 4.1.0
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - ~>
65
65
  - !ruby/object:Gem::Version
66
- version: 2.0.1
66
+ version: 4.1.0
67
67
  prerelease: false
68
68
  type: :runtime
69
69
  - !ruby/object:Gem::Dependency
70
- name: activerecord
70
+ name: activerecord-bogacs
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: 4.1.0
75
+ version: '0.3'
76
76
  requirement: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ~>
79
79
  - !ruby/object:Gem::Version
80
- version: 4.1.0
80
+ version: '0.3'
81
81
  prerelease: false
82
82
  type: :runtime
83
83
  - !ruby/object:Gem::Dependency
84
- name: actionpack
84
+ name: activerecord-jdbc-adapter
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: 4.1.0
89
+ version: '1.3'
90
90
  requirement: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - ~>
93
93
  - !ruby/object:Gem::Version
94
- version: 4.1.0
94
+ version: '1.3'
95
95
  prerelease: false
96
96
  type: :runtime
97
97
  - !ruby/object:Gem::Dependency
98
- name: actionview
98
+ name: jruby-openssl
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: 4.1.0
103
+ version: 0.9.6
104
104
  requirement: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - ~>
107
107
  - !ruby/object:Gem::Version
108
- version: 4.1.0
108
+ version: 0.9.6
109
109
  prerelease: false
110
110
  type: :runtime
111
111
  - !ruby/object:Gem::Dependency
112
- name: activesupport
112
+ name: actionpack
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ~>
@@ -123,73 +123,73 @@ dependencies:
123
123
  prerelease: false
124
124
  type: :runtime
125
125
  - !ruby/object:Gem::Dependency
126
- name: money
126
+ name: actionview
127
127
  version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ~>
130
130
  - !ruby/object:Gem::Version
131
- version: 6.1.1
131
+ version: 4.1.0
132
132
  requirement: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - ~>
135
135
  - !ruby/object:Gem::Version
136
- version: 6.1.1
136
+ version: 4.1.0
137
137
  prerelease: false
138
138
  type: :runtime
139
139
  - !ruby/object:Gem::Dependency
140
- name: monetize
140
+ name: activemerchant
141
141
  version_requirements: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ~>
144
144
  - !ruby/object:Gem::Version
145
- version: 0.3.0
145
+ version: 1.48.0
146
146
  requirement: !ruby/object:Gem::Requirement
147
147
  requirements:
148
148
  - - ~>
149
149
  - !ruby/object:Gem::Version
150
- version: 0.3.0
150
+ version: 1.48.0
151
151
  prerelease: false
152
152
  type: :runtime
153
153
  - !ruby/object:Gem::Dependency
154
- name: sinatra
154
+ name: offsite_payments
155
155
  version_requirements: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ~>
158
158
  - !ruby/object:Gem::Version
159
- version: 1.3.4
159
+ version: 2.1.0
160
160
  requirement: !ruby/object:Gem::Requirement
161
161
  requirements:
162
162
  - - ~>
163
163
  - !ruby/object:Gem::Version
164
- version: 1.3.4
164
+ version: 2.1.0
165
165
  prerelease: false
166
166
  type: :runtime
167
167
  - !ruby/object:Gem::Dependency
168
- name: activerecord-jdbcmysql-adapter
168
+ name: monetize
169
169
  version_requirements: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ~>
172
172
  - !ruby/object:Gem::Version
173
- version: 1.3.7
173
+ version: 1.1.0
174
174
  requirement: !ruby/object:Gem::Requirement
175
175
  requirements:
176
176
  - - ~>
177
177
  - !ruby/object:Gem::Version
178
- version: 1.3.7
178
+ version: 1.1.0
179
179
  prerelease: false
180
180
  type: :runtime
181
181
  - !ruby/object:Gem::Dependency
182
- name: jruby-openssl
182
+ name: money
183
183
  version_requirements: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ~>
186
186
  - !ruby/object:Gem::Version
187
- version: 0.9.4
187
+ version: 6.5.1
188
188
  requirement: !ruby/object:Gem::Requirement
189
189
  requirements:
190
190
  - - ~>
191
191
  - !ruby/object:Gem::Version
192
- version: 0.9.4
192
+ version: 6.5.1
193
193
  prerelease: false
194
194
  type: :runtime
195
195
  - !ruby/object:Gem::Dependency
@@ -198,12 +198,12 @@ dependencies:
198
198
  requirements:
199
199
  - - ~>
200
200
  - !ruby/object:Gem::Version
201
- version: 0.4.1
201
+ version: 0.4.3
202
202
  requirement: !ruby/object:Gem::Requirement
203
203
  requirements:
204
204
  - - ~>
205
205
  - !ruby/object:Gem::Version
206
- version: 0.4.1
206
+ version: 0.4.3
207
207
  prerelease: false
208
208
  type: :development
209
209
  - !ruby/object:Gem::Dependency
@@ -235,17 +235,31 @@ dependencies:
235
235
  prerelease: false
236
236
  type: :development
237
237
  - !ruby/object:Gem::Dependency
238
- name: activerecord-jdbcsqlite3-adapter
238
+ name: jdbc-sqlite3
239
+ version_requirements: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ~>
242
+ - !ruby/object:Gem::Version
243
+ version: '3.7'
244
+ requirement: !ruby/object:Gem::Requirement
245
+ requirements:
246
+ - - ~>
247
+ - !ruby/object:Gem::Version
248
+ version: '3.7'
249
+ prerelease: false
250
+ type: :development
251
+ - !ruby/object:Gem::Dependency
252
+ name: jdbc-mariadb
239
253
  version_requirements: !ruby/object:Gem::Requirement
240
254
  requirements:
241
255
  - - ~>
242
256
  - !ruby/object:Gem::Version
243
- version: 1.3.7
257
+ version: '1.1'
244
258
  requirement: !ruby/object:Gem::Requirement
245
259
  requirements:
246
260
  - - ~>
247
261
  - !ruby/object:Gem::Version
248
- version: 1.3.7
262
+ version: '1.1'
249
263
  prerelease: false
250
264
  type: :development
251
265
  description: Kill Bill payment plugin for Stripe.
@@ -257,6 +271,7 @@ files:
257
271
  - .gitignore
258
272
  - .travis.yml
259
273
  - Gemfile
274
+ - Gemfile.head
260
275
  - Gemfile.lock
261
276
  - Jarfile
262
277
  - Jarfile.lock
@@ -284,7 +299,7 @@ files:
284
299
  - spec/stripe/base_plugin_spec.rb
285
300
  - spec/stripe/remote/integration_spec.rb
286
301
  - stripe.yml
287
- homepage: http://kill-bill.org
302
+ homepage: http://killbill.io
288
303
  licenses:
289
304
  - Apache License (2.0)
290
305
  metadata: {}
@@ -306,11 +321,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
306
321
  version: '0'
307
322
  requirements: []
308
323
  rubyforge_project:
309
- rubygems_version: 2.2.2
324
+ rubygems_version: 2.1.9
310
325
  signing_key:
311
326
  specification_version: 4
312
327
  summary: Plugin to use Stripe as a gateway.
313
- test_files:
314
- - spec/spec_helper.rb
315
- - spec/stripe/base_plugin_spec.rb
316
- - spec/stripe/remote/integration_spec.rb
328
+ test_files: []