solidus_six_saferpay 0.1.8 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/README.md +3 -0
  4. data/app/assets/javascripts/solidus_six_saferpay/saferpay_payment.js +4 -1
  5. data/app/controllers/spree/solidus_six_saferpay/checkout_controller.rb +65 -41
  6. data/app/controllers/spree/solidus_six_saferpay/transaction/checkout_controller.rb +1 -1
  7. data/app/models/spree/payment_method/saferpay_payment_method.rb +1 -1
  8. data/app/models/spree/payment_method/saferpay_payment_page.rb +2 -2
  9. data/app/models/spree/payment_method/saferpay_transaction.rb +2 -2
  10. data/app/services/spree/solidus_six_saferpay/cancel_authorized_payment.rb +33 -0
  11. data/app/services/spree/solidus_six_saferpay/initialize_payment.rb +0 -1
  12. data/app/services/spree/solidus_six_saferpay/initialize_transaction.rb +0 -1
  13. data/app/services/spree/solidus_six_saferpay/inquire_payment.rb +27 -1
  14. data/app/services/spree/solidus_six_saferpay/order_not_found_handler.rb +28 -0
  15. data/app/services/spree/solidus_six_saferpay/payment_not_found_handler.rb +28 -0
  16. data/app/services/spree/solidus_six_saferpay/payment_processing_success_handler.rb +26 -0
  17. data/app/views/spree/checkout/payment/_saferpay_payment.html.erb +2 -2
  18. data/app/views/spree/solidus_six_saferpay/checkout/{iframe_breakout_redirect.html.erb → iframe_breakout_redirect.erb} +1 -1
  19. data/config/locales/de.yml +3 -0
  20. data/config/locales/en.yml +3 -0
  21. data/config/locales/fr.yml +3 -0
  22. data/config/routes.rb +6 -6
  23. data/lib/solidus_six_saferpay/configuration.rb +0 -2
  24. data/lib/solidus_six_saferpay/gateway.rb +11 -11
  25. data/lib/solidus_six_saferpay/payment_page_gateway.rb +8 -9
  26. data/lib/solidus_six_saferpay/transaction_gateway.rb +8 -9
  27. data/lib/solidus_six_saferpay/version.rb +1 -1
  28. data/solidus_six_saferpay.gemspec +2 -1
  29. data/spec/controllers/spree/solidus_six_saferpay/payment_page/checkout_controller_spec.rb +8 -197
  30. data/spec/controllers/spree/solidus_six_saferpay/transaction/checkout_controller_spec.rb +8 -220
  31. data/spec/services/spree/solidus_six_saferpay/assert_payment_page_spec.rb +2 -128
  32. data/spec/services/spree/solidus_six_saferpay/authorize_transaction_spec.rb +3 -127
  33. data/spec/services/spree/solidus_six_saferpay/cancel_authorized_payment_spec.rb +58 -0
  34. data/spec/services/spree/solidus_six_saferpay/initialize_payment_page_spec.rb +0 -2
  35. data/spec/services/spree/solidus_six_saferpay/initialize_transaction_spec.rb +0 -1
  36. data/spec/services/spree/solidus_six_saferpay/inquire_payment_page_payment_spec.rb +2 -98
  37. data/spec/services/spree/solidus_six_saferpay/inquire_transaction_payment_spec.rb +2 -98
  38. data/spec/services/spree/solidus_six_saferpay/order_not_found_handler_spec.rb +30 -0
  39. data/spec/services/spree/solidus_six_saferpay/payment_not_found_handler_spec.rb +30 -0
  40. data/spec/services/spree/solidus_six_saferpay/payment_processing_success_handler_spec.rb +34 -0
  41. data/spec/services/spree/solidus_six_saferpay/process_payment_page_payment_spec.rb +1 -206
  42. data/spec/services/spree/solidus_six_saferpay/process_transaction_payment_spec.rb +1 -200
  43. data/spec/solidus_six_saferpay/configuration_spec.rb +0 -3
  44. data/spec/solidus_six_saferpay/gateway_spec.rb +1 -14
  45. data/spec/solidus_six_saferpay/payment_page_gateway_spec.rb +16 -14
  46. data/spec/solidus_six_saferpay/transaction_gateway_spec.rb +17 -14
  47. data/spec/support/shared_examples/authorize_payment.rb +132 -0
  48. data/spec/support/shared_examples/checkout_controller.rb +294 -0
  49. data/spec/support/shared_examples/inquire_payment.rb +118 -0
  50. data/spec/support/shared_examples/process_authorized_payment.rb +202 -0
  51. metadata +41 -10
  52. data/app/services/spree/solidus_six_saferpay/inquire_transaction.rb +0 -7
  53. data/spec/controllers/spree/solidus_six_saferpay/checkout_controller_spec.rb +0 -41
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_six_saferpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Kiener
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-21 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '2.2'
53
+ version: 2.8.1
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '2.2'
60
+ version: 2.8.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rails-i18n
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -148,6 +148,20 @@ dependencies:
148
148
  - - "~>"
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0.3'
151
+ - !ruby/object:Gem::Dependency
152
+ name: bundler-audit
153
+ requirement: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ type: :development
159
+ prerelease: false
160
+ version_requirements: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
151
165
  description: Adds Saferpay Payment Page and Transaction payment methods to your Solidus
152
166
  application
153
167
  email:
@@ -162,6 +176,7 @@ files:
162
176
  - ".gitignore"
163
177
  - ".rspec"
164
178
  - ".rubocop.yml"
179
+ - ".ruby-version"
165
180
  - ".travis.yml"
166
181
  - Gemfile
167
182
  - LICENSE
@@ -216,13 +231,16 @@ files:
216
231
  - app/services/spree/solidus_six_saferpay/assert_payment_page.rb
217
232
  - app/services/spree/solidus_six_saferpay/authorize_payment.rb
218
233
  - app/services/spree/solidus_six_saferpay/authorize_transaction.rb
234
+ - app/services/spree/solidus_six_saferpay/cancel_authorized_payment.rb
219
235
  - app/services/spree/solidus_six_saferpay/initialize_payment.rb
220
236
  - app/services/spree/solidus_six_saferpay/initialize_payment_page.rb
221
237
  - app/services/spree/solidus_six_saferpay/initialize_transaction.rb
222
238
  - app/services/spree/solidus_six_saferpay/inquire_payment.rb
223
239
  - app/services/spree/solidus_six_saferpay/inquire_payment_page_payment.rb
224
- - app/services/spree/solidus_six_saferpay/inquire_transaction.rb
225
240
  - app/services/spree/solidus_six_saferpay/inquire_transaction_payment.rb
241
+ - app/services/spree/solidus_six_saferpay/order_not_found_handler.rb
242
+ - app/services/spree/solidus_six_saferpay/payment_not_found_handler.rb
243
+ - app/services/spree/solidus_six_saferpay/payment_processing_success_handler.rb
226
244
  - app/services/spree/solidus_six_saferpay/payment_validator.rb
227
245
  - app/services/spree/solidus_six_saferpay/process_authorized_payment.rb
228
246
  - app/services/spree/solidus_six_saferpay/process_payment_page_payment.rb
@@ -233,7 +251,7 @@ files:
233
251
  - app/views/spree/api/payments/source_views/_saferpay_payment.json.jbuilder
234
252
  - app/views/spree/checkout/payment/_saferpay_payment.html.erb
235
253
  - app/views/spree/six_saferpay_payments/_six_saferpay_payment.html.erb
236
- - app/views/spree/solidus_six_saferpay/checkout/iframe_breakout_redirect.html.erb
254
+ - app/views/spree/solidus_six_saferpay/checkout/iframe_breakout_redirect.erb
237
255
  - bin/console
238
256
  - bin/rails
239
257
  - bin/rake
@@ -257,7 +275,6 @@ files:
257
275
  - lib/solidus_six_saferpay/transaction_gateway.rb
258
276
  - lib/solidus_six_saferpay/version.rb
259
277
  - solidus_six_saferpay.gemspec
260
- - spec/controllers/spree/solidus_six_saferpay/checkout_controller_spec.rb
261
278
  - spec/controllers/spree/solidus_six_saferpay/payment_page/checkout_controller_spec.rb
262
279
  - spec/controllers/spree/solidus_six_saferpay/transaction/checkout_controller_spec.rb
263
280
  - spec/dummy/.ruby-version
@@ -325,12 +342,16 @@ files:
325
342
  - spec/services/spree/solidus_six_saferpay/assert_payment_page_spec.rb
326
343
  - spec/services/spree/solidus_six_saferpay/authorize_payment_spec.rb
327
344
  - spec/services/spree/solidus_six_saferpay/authorize_transaction_spec.rb
345
+ - spec/services/spree/solidus_six_saferpay/cancel_authorized_payment_spec.rb
328
346
  - spec/services/spree/solidus_six_saferpay/initialize_payment_page_spec.rb
329
347
  - spec/services/spree/solidus_six_saferpay/initialize_payment_spec.rb
330
348
  - spec/services/spree/solidus_six_saferpay/initialize_transaction_spec.rb
331
349
  - spec/services/spree/solidus_six_saferpay/inquire_payment_page_payment_spec.rb
332
350
  - spec/services/spree/solidus_six_saferpay/inquire_payment_spec.rb
333
351
  - spec/services/spree/solidus_six_saferpay/inquire_transaction_payment_spec.rb
352
+ - spec/services/spree/solidus_six_saferpay/order_not_found_handler_spec.rb
353
+ - spec/services/spree/solidus_six_saferpay/payment_not_found_handler_spec.rb
354
+ - spec/services/spree/solidus_six_saferpay/payment_processing_success_handler_spec.rb
334
355
  - spec/services/spree/solidus_six_saferpay/payment_validator_spec.rb
335
356
  - spec/services/spree/solidus_six_saferpay/process_authorized_payment_spec.rb
336
357
  - spec/services/spree/solidus_six_saferpay/process_payment_page_payment_spec.rb
@@ -343,6 +364,10 @@ files:
343
364
  - spec/solidus_six_saferpay/transaction_gateway_spec.rb
344
365
  - spec/spec_helper.rb
345
366
  - spec/support/route_access.rb
367
+ - spec/support/shared_examples/authorize_payment.rb
368
+ - spec/support/shared_examples/checkout_controller.rb
369
+ - spec/support/shared_examples/inquire_payment.rb
370
+ - spec/support/shared_examples/process_authorized_payment.rb
346
371
  - spec/support/uses_payment_page_gateway.rb
347
372
  - spec/support/uses_transaction_gateway.rb
348
373
  homepage: https://github.com/fadendaten/solidus_six_saferpay
@@ -366,13 +391,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
366
391
  - !ruby/object:Gem::Version
367
392
  version: '0'
368
393
  requirements: []
369
- rubyforge_project:
370
- rubygems_version: 2.7.6
394
+ rubygems_version: 3.1.4
371
395
  signing_key:
372
396
  specification_version: 4
373
397
  summary: Saferpay Payment Page and Transaction payment methods for Solidus
374
398
  test_files:
375
- - spec/controllers/spree/solidus_six_saferpay/checkout_controller_spec.rb
376
399
  - spec/controllers/spree/solidus_six_saferpay/payment_page/checkout_controller_spec.rb
377
400
  - spec/controllers/spree/solidus_six_saferpay/transaction/checkout_controller_spec.rb
378
401
  - spec/dummy/.ruby-version
@@ -440,12 +463,16 @@ test_files:
440
463
  - spec/services/spree/solidus_six_saferpay/assert_payment_page_spec.rb
441
464
  - spec/services/spree/solidus_six_saferpay/authorize_payment_spec.rb
442
465
  - spec/services/spree/solidus_six_saferpay/authorize_transaction_spec.rb
466
+ - spec/services/spree/solidus_six_saferpay/cancel_authorized_payment_spec.rb
443
467
  - spec/services/spree/solidus_six_saferpay/initialize_payment_page_spec.rb
444
468
  - spec/services/spree/solidus_six_saferpay/initialize_payment_spec.rb
445
469
  - spec/services/spree/solidus_six_saferpay/initialize_transaction_spec.rb
446
470
  - spec/services/spree/solidus_six_saferpay/inquire_payment_page_payment_spec.rb
447
471
  - spec/services/spree/solidus_six_saferpay/inquire_payment_spec.rb
448
472
  - spec/services/spree/solidus_six_saferpay/inquire_transaction_payment_spec.rb
473
+ - spec/services/spree/solidus_six_saferpay/order_not_found_handler_spec.rb
474
+ - spec/services/spree/solidus_six_saferpay/payment_not_found_handler_spec.rb
475
+ - spec/services/spree/solidus_six_saferpay/payment_processing_success_handler_spec.rb
449
476
  - spec/services/spree/solidus_six_saferpay/payment_validator_spec.rb
450
477
  - spec/services/spree/solidus_six_saferpay/process_authorized_payment_spec.rb
451
478
  - spec/services/spree/solidus_six_saferpay/process_payment_page_payment_spec.rb
@@ -458,5 +485,9 @@ test_files:
458
485
  - spec/solidus_six_saferpay/transaction_gateway_spec.rb
459
486
  - spec/spec_helper.rb
460
487
  - spec/support/route_access.rb
488
+ - spec/support/shared_examples/authorize_payment.rb
489
+ - spec/support/shared_examples/checkout_controller.rb
490
+ - spec/support/shared_examples/inquire_payment.rb
491
+ - spec/support/shared_examples/process_authorized_payment.rb
461
492
  - spec/support/uses_payment_page_gateway.rb
462
493
  - spec/support/uses_transaction_gateway.rb
@@ -1,7 +0,0 @@
1
- module Spree
2
- module SolidusSixSaferpay
3
- class InquireTransactionPayment < InquirePayment
4
- include UseTransactionGateway
5
- end
6
- end
7
- end
@@ -1,41 +0,0 @@
1
- require 'rails_helper'
2
-
3
- RSpec.describe Spree::SolidusSixSaferpay::CheckoutController, type: :controller do
4
- routes { Spree::Core::Engine.routes }
5
-
6
- let(:user) { create(:user) }
7
- let(:order) { create(:order) }
8
- let(:payment_method) { create(:saferpay_payment_method_transaction) }
9
- let(:payment) { create(:six_saferpay_payment) }
10
-
11
- let(:subject) { described_class.new }
12
-
13
- before do
14
- allow(controller).to receive_messages try_spree_current_user: user
15
- allow(controller).to receive_messages current_order: order
16
- end
17
-
18
- describe '#initialize_payment' do
19
- it 'is not implemented in this superclass' do
20
- expect { subject.send(:initialize_payment, order, payment_method) }.to raise_error(NotImplementedError)
21
- end
22
- end
23
-
24
- describe '#authorize_payment' do
25
- it 'is not implemented in this superclass' do
26
- expect { subject.send(:authorize_payment, payment) }.to raise_error(NotImplementedError)
27
- end
28
- end
29
-
30
- describe '#process_authorization' do
31
- it 'is not implemented in this superclass' do
32
- expect { subject.send(:process_authorization, payment) }.to raise_error(NotImplementedError)
33
- end
34
- end
35
-
36
- describe '#inquire_payment' do
37
- it 'is not implemented in this superclass' do
38
- expect { subject.send(:inquire_payment, payment) }.to raise_error(NotImplementedError)
39
- end
40
- end
41
- end