spree_gateway 3.7.2 → 3.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +31 -38
  3. data/Appraisals +4 -10
  4. data/app/models/spree/check.rb +41 -0
  5. data/app/models/spree/checkout_controller_decorator.rb +19 -0
  6. data/app/models/spree/gateway/stripe_ach_gateway.rb +60 -0
  7. data/app/models/spree/gateway/stripe_elements_gateway.rb +50 -0
  8. data/app/models/spree/gateway/stripe_gateway.rb +1 -0
  9. data/app/models/spree/order_decorator.rb +28 -0
  10. data/app/models/spree/payment_decorator.rb +34 -0
  11. data/app/views/spree/checkout/_payment_confirm.html.erb +34 -0
  12. data/config/initializers/spree_permitted_attributes.rb +5 -0
  13. data/config/locales/en.yml +23 -0
  14. data/config/routes.rb +12 -0
  15. data/db/migrate/20200317135551_add_spree_check_payment_source.rb +22 -0
  16. data/db/migrate/20200422114908_add_intent_key_to_payment.rb +5 -0
  17. data/gemfiles/{spree_3_2.gemfile → spree_4_1.gemfile} +1 -1
  18. data/gemfiles/{spree_3_5.gemfile → spree_4_2.gemfile} +1 -1
  19. data/lib/active_merchant/billing/stripe_gateway_decorator.rb +13 -0
  20. data/lib/controllers/spree/api/v2/storefront/intents_controller.rb +27 -0
  21. data/lib/spree_gateway.rb +1 -0
  22. data/lib/spree_gateway/engine.rb +1 -0
  23. data/lib/spree_gateway/version.rb +1 -1
  24. data/lib/views/backend/spree/admin/payments/source_forms/_stripe_ach.html.erb +86 -0
  25. data/lib/views/backend/spree/admin/payments/source_forms/_stripe_apple_pay.html.erb +0 -0
  26. data/lib/views/backend/spree/admin/payments/source_forms/_stripe_elements.html.erb +79 -0
  27. data/lib/views/backend/spree/admin/payments/source_views/_stripe_ach.html.erb +21 -0
  28. data/lib/views/backend/spree/admin/payments/source_views/_stripe_apple_pay.html.erb +1 -0
  29. data/lib/views/backend/spree/admin/payments/source_views/_stripe_elements.html.erb +1 -0
  30. data/lib/views/frontend/spree/checkout/payment/_stripe_ach.html.erb +81 -0
  31. data/lib/views/frontend/spree/checkout/payment/_stripe_ach_verify.html.erb +16 -0
  32. data/lib/views/frontend/spree/checkout/payment/_stripe_apple_pay.html.erb +10 -1
  33. data/lib/views/frontend/spree/checkout/payment/_stripe_elements.html.erb +2 -1
  34. data/spec/factories/check_factory.rb +10 -0
  35. data/spec/features/admin/stripe_elements_payment_spec.rb +109 -0
  36. data/spec/features/stripe_checkout_spec.rb +3 -0
  37. data/spec/features/stripe_elements_3ds_checkout_spec.rb +105 -0
  38. data/spec/models/gateway/stripe_ach_gateway_spec.rb +186 -0
  39. data/spec/models/gateway/stripe_gateway_spec.rb +1 -0
  40. data/spec/spec_helper.rb +7 -64
  41. data/spec/support/within_stripe_3ds_popup.rb +10 -0
  42. data/spree_gateway.gemspec +4 -22
  43. metadata +43 -269
  44. data/gemfiles/spree_3_7.gemfile +0 -9
  45. data/gemfiles/spree_4_0.gemfile +0 -8
@@ -0,0 +1,10 @@
1
+ def within_stripe_3ds_popup
2
+ using_wait_time(10) do
3
+ within_frame 0 do
4
+ within_frame 0 do
5
+ expect(page).to have_text('3D Secure 2 Test Page', normalize_ws: true)
6
+ yield
7
+ end
8
+ end
9
+ end
10
+ end
@@ -21,30 +21,12 @@ Gem::Specification.new do |s|
21
21
  s.require_path = 'lib'
22
22
  s.requirements << 'none'
23
23
 
24
- spree_version = '>= 3.1.0', '< 5.0'
24
+ spree_version = '>= 3.7.0', '< 5.0'
25
25
  s.add_dependency 'spree_core', spree_version
26
26
  s.add_dependency 'spree_extension'
27
+ s.add_dependency 'deface'
27
28
 
28
- s.add_development_dependency 'appraisal'
29
- s.add_development_dependency 'bootstrap-sass'
30
- s.add_development_dependency 'braintree'
31
- s.add_development_dependency 'capybara'
32
- s.add_development_dependency 'capybara-screenshot'
33
- s.add_development_dependency 'coffee-rails'
34
- s.add_development_dependency 'database_cleaner'
35
- s.add_development_dependency 'factory_bot', '~> 4.7'
36
- s.add_development_dependency 'ffaker'
37
- s.add_development_dependency 'guard-rspec'
38
- s.add_development_dependency 'launchy'
39
- s.add_development_dependency 'mysql2'
40
- s.add_development_dependency 'pg'
41
- s.add_development_dependency 'pry'
42
- s.add_development_dependency 'puma'
29
+ s.add_development_dependency 'braintree', '~>2.78'
43
30
  s.add_development_dependency 'rspec-activemodel-mocks'
44
- s.add_development_dependency 'rspec-rails'
45
- s.add_development_dependency 'sass-rails'
46
- s.add_development_dependency 'selenium-webdriver'
47
- s.add_development_dependency 'webdrivers'
48
- s.add_development_dependency 'simplecov'
49
- s.add_development_dependency 'sqlite3'
31
+ s.add_development_dependency 'spree_dev_tools'
50
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.2
4
+ version: 3.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spree Commerce
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-24 00:00:00.000000000 Z
11
+ date: 2020-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.0
19
+ version: 3.7.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 3.1.0
29
+ version: 3.7.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5.0'
@@ -45,27 +45,13 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
- name: appraisal
48
+ name: deface
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: '0'
61
- - !ruby/object:Gem::Dependency
62
- name: bootstrap-sass
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: '0'
68
- type: :development
54
+ type: :runtime
69
55
  prerelease: false
70
56
  version_requirements: !ruby/object:Gem::Requirement
71
57
  requirements:
@@ -74,186 +60,18 @@ dependencies:
74
60
  version: '0'
75
61
  - !ruby/object:Gem::Dependency
76
62
  name: braintree
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: '0'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: '0'
89
- - !ruby/object:Gem::Dependency
90
- name: capybara
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ">="
94
- - !ruby/object:Gem::Version
95
- version: '0'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: '0'
103
- - !ruby/object:Gem::Dependency
104
- name: capybara-screenshot
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- version: '0'
117
- - !ruby/object:Gem::Dependency
118
- name: coffee-rails
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - ">="
122
- - !ruby/object:Gem::Version
123
- version: '0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- version: '0'
131
- - !ruby/object:Gem::Dependency
132
- name: database_cleaner
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - ">="
136
- - !ruby/object:Gem::Version
137
- version: '0'
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - ">="
143
- - !ruby/object:Gem::Version
144
- version: '0'
145
- - !ruby/object:Gem::Dependency
146
- name: factory_bot
147
63
  requirement: !ruby/object:Gem::Requirement
148
64
  requirements:
149
65
  - - "~>"
150
66
  - !ruby/object:Gem::Version
151
- version: '4.7'
67
+ version: '2.78'
152
68
  type: :development
153
69
  prerelease: false
154
70
  version_requirements: !ruby/object:Gem::Requirement
155
71
  requirements:
156
72
  - - "~>"
157
73
  - !ruby/object:Gem::Version
158
- version: '4.7'
159
- - !ruby/object:Gem::Dependency
160
- name: ffaker
161
- requirement: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- version: '0'
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- version: '0'
173
- - !ruby/object:Gem::Dependency
174
- name: guard-rspec
175
- requirement: !ruby/object:Gem::Requirement
176
- requirements:
177
- - - ">="
178
- - !ruby/object:Gem::Version
179
- version: '0'
180
- type: :development
181
- prerelease: false
182
- version_requirements: !ruby/object:Gem::Requirement
183
- requirements:
184
- - - ">="
185
- - !ruby/object:Gem::Version
186
- version: '0'
187
- - !ruby/object:Gem::Dependency
188
- name: launchy
189
- requirement: !ruby/object:Gem::Requirement
190
- requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- version: '0'
194
- type: :development
195
- prerelease: false
196
- version_requirements: !ruby/object:Gem::Requirement
197
- requirements:
198
- - - ">="
199
- - !ruby/object:Gem::Version
200
- version: '0'
201
- - !ruby/object:Gem::Dependency
202
- name: mysql2
203
- requirement: !ruby/object:Gem::Requirement
204
- requirements:
205
- - - ">="
206
- - !ruby/object:Gem::Version
207
- version: '0'
208
- type: :development
209
- prerelease: false
210
- version_requirements: !ruby/object:Gem::Requirement
211
- requirements:
212
- - - ">="
213
- - !ruby/object:Gem::Version
214
- version: '0'
215
- - !ruby/object:Gem::Dependency
216
- name: pg
217
- requirement: !ruby/object:Gem::Requirement
218
- requirements:
219
- - - ">="
220
- - !ruby/object:Gem::Version
221
- version: '0'
222
- type: :development
223
- prerelease: false
224
- version_requirements: !ruby/object:Gem::Requirement
225
- requirements:
226
- - - ">="
227
- - !ruby/object:Gem::Version
228
- version: '0'
229
- - !ruby/object:Gem::Dependency
230
- name: pry
231
- requirement: !ruby/object:Gem::Requirement
232
- requirements:
233
- - - ">="
234
- - !ruby/object:Gem::Version
235
- version: '0'
236
- type: :development
237
- prerelease: false
238
- version_requirements: !ruby/object:Gem::Requirement
239
- requirements:
240
- - - ">="
241
- - !ruby/object:Gem::Version
242
- version: '0'
243
- - !ruby/object:Gem::Dependency
244
- name: puma
245
- requirement: !ruby/object:Gem::Requirement
246
- requirements:
247
- - - ">="
248
- - !ruby/object:Gem::Version
249
- version: '0'
250
- type: :development
251
- prerelease: false
252
- version_requirements: !ruby/object:Gem::Requirement
253
- requirements:
254
- - - ">="
255
- - !ruby/object:Gem::Version
256
- version: '0'
74
+ version: '2.78'
257
75
  - !ruby/object:Gem::Dependency
258
76
  name: rspec-activemodel-mocks
259
77
  requirement: !ruby/object:Gem::Requirement
@@ -269,77 +87,7 @@ dependencies:
269
87
  - !ruby/object:Gem::Version
270
88
  version: '0'
271
89
  - !ruby/object:Gem::Dependency
272
- name: rspec-rails
273
- requirement: !ruby/object:Gem::Requirement
274
- requirements:
275
- - - ">="
276
- - !ruby/object:Gem::Version
277
- version: '0'
278
- type: :development
279
- prerelease: false
280
- version_requirements: !ruby/object:Gem::Requirement
281
- requirements:
282
- - - ">="
283
- - !ruby/object:Gem::Version
284
- version: '0'
285
- - !ruby/object:Gem::Dependency
286
- name: sass-rails
287
- requirement: !ruby/object:Gem::Requirement
288
- requirements:
289
- - - ">="
290
- - !ruby/object:Gem::Version
291
- version: '0'
292
- type: :development
293
- prerelease: false
294
- version_requirements: !ruby/object:Gem::Requirement
295
- requirements:
296
- - - ">="
297
- - !ruby/object:Gem::Version
298
- version: '0'
299
- - !ruby/object:Gem::Dependency
300
- name: selenium-webdriver
301
- requirement: !ruby/object:Gem::Requirement
302
- requirements:
303
- - - ">="
304
- - !ruby/object:Gem::Version
305
- version: '0'
306
- type: :development
307
- prerelease: false
308
- version_requirements: !ruby/object:Gem::Requirement
309
- requirements:
310
- - - ">="
311
- - !ruby/object:Gem::Version
312
- version: '0'
313
- - !ruby/object:Gem::Dependency
314
- name: webdrivers
315
- requirement: !ruby/object:Gem::Requirement
316
- requirements:
317
- - - ">="
318
- - !ruby/object:Gem::Version
319
- version: '0'
320
- type: :development
321
- prerelease: false
322
- version_requirements: !ruby/object:Gem::Requirement
323
- requirements:
324
- - - ">="
325
- - !ruby/object:Gem::Version
326
- version: '0'
327
- - !ruby/object:Gem::Dependency
328
- name: simplecov
329
- requirement: !ruby/object:Gem::Requirement
330
- requirements:
331
- - - ">="
332
- - !ruby/object:Gem::Version
333
- version: '0'
334
- type: :development
335
- prerelease: false
336
- version_requirements: !ruby/object:Gem::Requirement
337
- requirements:
338
- - - ">="
339
- - !ruby/object:Gem::Version
340
- version: '0'
341
- - !ruby/object:Gem::Dependency
342
- name: sqlite3
90
+ name: spree_dev_tools
343
91
  requirement: !ruby/object:Gem::Requirement
344
92
  requirements:
345
93
  - - ">="
@@ -370,6 +118,8 @@ files:
370
118
  - app/models/spree/apple_pay_order_decorator.rb
371
119
  - app/models/spree/apple_pay_payment_decorator.rb
372
120
  - app/models/spree/billing_integration.rb
121
+ - app/models/spree/check.rb
122
+ - app/models/spree/checkout_controller_decorator.rb
373
123
  - app/models/spree/gateway/authorize_net.rb
374
124
  - app/models/spree/gateway/authorize_net_cim.rb
375
125
  - app/models/spree/gateway/balanced_gateway.rb
@@ -394,12 +144,17 @@ files:
394
144
  - app/models/spree/gateway/sage_pay.rb
395
145
  - app/models/spree/gateway/secure_pay_au.rb
396
146
  - app/models/spree/gateway/spreedly_core_gateway.rb
147
+ - app/models/spree/gateway/stripe_ach_gateway.rb
397
148
  - app/models/spree/gateway/stripe_apple_pay_gateway.rb
398
149
  - app/models/spree/gateway/stripe_elements_gateway.rb
399
150
  - app/models/spree/gateway/stripe_gateway.rb
400
151
  - app/models/spree/gateway/usa_epay_transaction.rb
401
152
  - app/models/spree/gateway/worldpay.rb
153
+ - app/models/spree/order_decorator.rb
154
+ - app/models/spree/payment_decorator.rb
155
+ - app/views/spree/checkout/_payment_confirm.html.erb
402
156
  - config/initializers/inflections.rb
157
+ - config/initializers/spree_permitted_attributes.rb
403
158
  - config/locales/bg.yml
404
159
  - config/locales/de.yml
405
160
  - config/locales/en.yml
@@ -410,12 +165,13 @@ files:
410
165
  - db/migrate/20130415222802_update_balanced_payment_method_type.rb
411
166
  - db/migrate/20131008221012_update_paypal_payment_method_type.rb
412
167
  - db/migrate/20131112133401_migrate_stripe_preferences.rb
413
- - gemfiles/spree_3_2.gemfile
414
- - gemfiles/spree_3_5.gemfile
415
- - gemfiles/spree_3_7.gemfile
416
- - gemfiles/spree_4_0.gemfile
168
+ - db/migrate/20200317135551_add_spree_check_payment_source.rb
169
+ - db/migrate/20200422114908_add_intent_key_to_payment.rb
170
+ - gemfiles/spree_4_1.gemfile
171
+ - gemfiles/spree_4_2.gemfile
417
172
  - gemfiles/spree_master.gemfile
418
173
  - lib/active_merchant/billing/stripe_gateway_decorator.rb
174
+ - lib/controllers/spree/api/v2/storefront/intents_controller.rb
419
175
  - lib/controllers/spree/apple_pay_domain_verification_controller.rb
420
176
  - lib/generators/spree_gateway/install/install_generator.rb
421
177
  - lib/spree_gateway.rb
@@ -425,13 +181,24 @@ files:
425
181
  - lib/views/backend/spree/admin/log_entries/_stripe.html.erb
426
182
  - lib/views/backend/spree/admin/payments/source_forms/_quickcheckout.html.erb
427
183
  - lib/views/backend/spree/admin/payments/source_forms/_stripe.html.erb
184
+ - lib/views/backend/spree/admin/payments/source_forms/_stripe_ach.html.erb
185
+ - lib/views/backend/spree/admin/payments/source_forms/_stripe_apple_pay.html.erb
186
+ - lib/views/backend/spree/admin/payments/source_forms/_stripe_elements.html.erb
428
187
  - lib/views/backend/spree/admin/payments/source_views/_stripe.html.erb
188
+ - lib/views/backend/spree/admin/payments/source_views/_stripe_ach.html.erb
189
+ - lib/views/backend/spree/admin/payments/source_views/_stripe_apple_pay.html.erb
190
+ - lib/views/backend/spree/admin/payments/source_views/_stripe_elements.html.erb
429
191
  - lib/views/frontend/spree/checkout/payment/_stripe.html.erb
192
+ - lib/views/frontend/spree/checkout/payment/_stripe_ach.html.erb
193
+ - lib/views/frontend/spree/checkout/payment/_stripe_ach_verify.html.erb
430
194
  - lib/views/frontend/spree/checkout/payment/_stripe_additional_info.html.erb
431
195
  - lib/views/frontend/spree/checkout/payment/_stripe_apple_pay.html.erb
432
196
  - lib/views/frontend/spree/checkout/payment/_stripe_elements.html.erb
433
197
  - script/rails
198
+ - spec/factories/check_factory.rb
199
+ - spec/features/admin/stripe_elements_payment_spec.rb
434
200
  - spec/features/stripe_checkout_spec.rb
201
+ - spec/features/stripe_elements_3ds_checkout_spec.rb
435
202
  - spec/models/gateway/authorize_net_cim_spec.rb
436
203
  - spec/models/gateway/authorize_net_spec.rb
437
204
  - spec/models/gateway/balanced_gateway_spec.rb
@@ -454,6 +221,7 @@ files:
454
221
  - spec/models/gateway/quickpay_spec.rb
455
222
  - spec/models/gateway/sage_pay_spec.rb
456
223
  - spec/models/gateway/secure_pay_au_spec.rb
224
+ - spec/models/gateway/stripe_ach_gateway_spec.rb
457
225
  - spec/models/gateway/stripe_gateway_spec.rb
458
226
  - spec/models/gateway/usa_epay_transaction_spec.rb
459
227
  - spec/models/gateway/worldpay_spec.rb
@@ -461,12 +229,13 @@ files:
461
229
  - spec/requests/apple_pay_domain_verification.rb
462
230
  - spec/spec_helper.rb
463
231
  - spec/support/wait_for_stripe.rb
232
+ - spec/support/within_stripe_3ds_popup.rb
464
233
  - spree_gateway.gemspec
465
234
  homepage: https://spreecommerce.org
466
235
  licenses:
467
236
  - BSD-3-Clause
468
237
  metadata: {}
469
- post_install_message:
238
+ post_install_message:
470
239
  rdoc_options: []
471
240
  require_paths:
472
241
  - lib
@@ -482,12 +251,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
482
251
  version: '0'
483
252
  requirements:
484
253
  - none
485
- rubygems_version: 3.0.2
486
- signing_key:
254
+ rubygems_version: 3.1.2
255
+ signing_key:
487
256
  specification_version: 4
488
257
  summary: Additional Payment Gateways for Spree Commerce
489
258
  test_files:
259
+ - spec/factories/check_factory.rb
260
+ - spec/features/admin/stripe_elements_payment_spec.rb
490
261
  - spec/features/stripe_checkout_spec.rb
262
+ - spec/features/stripe_elements_3ds_checkout_spec.rb
491
263
  - spec/models/gateway/authorize_net_cim_spec.rb
492
264
  - spec/models/gateway/authorize_net_spec.rb
493
265
  - spec/models/gateway/balanced_gateway_spec.rb
@@ -510,6 +282,7 @@ test_files:
510
282
  - spec/models/gateway/quickpay_spec.rb
511
283
  - spec/models/gateway/sage_pay_spec.rb
512
284
  - spec/models/gateway/secure_pay_au_spec.rb
285
+ - spec/models/gateway/stripe_ach_gateway_spec.rb
513
286
  - spec/models/gateway/stripe_gateway_spec.rb
514
287
  - spec/models/gateway/usa_epay_transaction_spec.rb
515
288
  - spec/models/gateway/worldpay_spec.rb
@@ -517,3 +290,4 @@ test_files:
517
290
  - spec/requests/apple_pay_domain_verification.rb
518
291
  - spec/spec_helper.rb
519
292
  - spec/support/wait_for_stripe.rb
293
+ - spec/support/within_stripe_3ds_popup.rb