solidus_six_saferpay 0.1.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +35 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/stale.yml +17 -0
  5. data/.gitignore +18 -0
  6. data/.rspec +2 -0
  7. data/.rubocop.yml +2 -0
  8. data/.travis.yml +12 -0
  9. data/Gemfile +33 -0
  10. data/LICENSE +26 -0
  11. data/README.md +36 -20
  12. data/Rakefile +4 -54
  13. data/app/assets/config/solidus_six_saferpay_manifest.js +1 -0
  14. data/app/assets/images/solidus_six_saferpay/.keep +0 -0
  15. data/app/assets/javascripts/solidus_six_saferpay/saferpay_payment.js +4 -1
  16. data/app/assets/javascripts/spree/backend/solidus_six_saferpay.js +2 -0
  17. data/app/assets/javascripts/spree/frontend/solidus_six_saferpay.js +2 -0
  18. data/app/assets/stylesheets/spree/backend/solidus_six_saferpay.css +4 -0
  19. data/app/assets/stylesheets/spree/frontend/solidus_six_saferpay.css +4 -0
  20. data/app/controllers/spree/solidus_six_saferpay/checkout_controller.rb +133 -17
  21. data/app/controllers/spree/solidus_six_saferpay/transaction/checkout_controller.rb +1 -1
  22. data/app/models/spree/payment_method/saferpay_payment_method.rb +1 -1
  23. data/app/models/spree/payment_method/saferpay_payment_page.rb +2 -2
  24. data/app/models/spree/payment_method/saferpay_transaction.rb +2 -2
  25. data/app/services/spree/solidus_six_saferpay/cancel_authorized_payment.rb +33 -0
  26. data/app/services/spree/solidus_six_saferpay/initialize_payment.rb +0 -1
  27. data/app/services/spree/solidus_six_saferpay/initialize_transaction.rb +0 -1
  28. data/app/services/spree/solidus_six_saferpay/inquire_payment.rb +27 -1
  29. data/app/views/spree/checkout/payment/_saferpay_payment.html.erb +2 -2
  30. data/app/views/spree/solidus_six_saferpay/checkout/{iframe_breakout_redirect.html.erb → iframe_breakout_redirect.erb} +1 -1
  31. data/bin/console +17 -0
  32. data/bin/rails +18 -0
  33. data/bin/rake +7 -0
  34. data/bin/setup +8 -0
  35. data/config/initializers/assets.rb +3 -0
  36. data/config/locales/de.yml +4 -1
  37. data/config/locales/en.yml +4 -1
  38. data/config/locales/fr.yml +4 -1
  39. data/config/routes.rb +8 -8
  40. data/lib/generators/solidus_six_saferpay/install/install_generator.rb +15 -3
  41. data/lib/solidus_six_saferpay.rb +6 -3
  42. data/lib/solidus_six_saferpay/configuration.rb +6 -7
  43. data/lib/solidus_six_saferpay/engine.rb +19 -10
  44. data/lib/solidus_six_saferpay/gateway.rb +11 -11
  45. data/lib/solidus_six_saferpay/payment_page_gateway.rb +8 -9
  46. data/lib/solidus_six_saferpay/transaction_gateway.rb +8 -9
  47. data/lib/solidus_six_saferpay/version.rb +3 -1
  48. data/solidus_six_saferpay.gemspec +42 -0
  49. data/spec/controllers/spree/solidus_six_saferpay/payment_page/checkout_controller_spec.rb +16 -0
  50. data/spec/controllers/spree/solidus_six_saferpay/transaction/checkout_controller_spec.rb +16 -0
  51. data/spec/factories/payment_methods.rb +23 -0
  52. data/spec/factories/payments.rb +11 -0
  53. data/spec/factories/spree/six_saferpay_payments.rb +118 -0
  54. data/spec/models/spree/six_saferpay_payment_spec.rb +203 -0
  55. data/spec/rails_helper.rb +73 -0
  56. data/spec/services/spree/solidus_six_saferpay/assert_payment_page_spec.rb +22 -0
  57. data/spec/services/spree/solidus_six_saferpay/authorize_payment_spec.rb +39 -0
  58. data/spec/services/spree/solidus_six_saferpay/authorize_transaction_spec.rb +24 -0
  59. data/spec/services/spree/solidus_six_saferpay/cancel_authorized_payment_spec.rb +58 -0
  60. data/spec/services/spree/solidus_six_saferpay/initialize_payment_page_spec.rb +81 -0
  61. data/spec/services/spree/solidus_six_saferpay/initialize_payment_spec.rb +40 -0
  62. data/spec/services/spree/solidus_six_saferpay/initialize_transaction_spec.rb +84 -0
  63. data/spec/services/spree/solidus_six_saferpay/inquire_payment_page_payment_spec.rb +20 -0
  64. data/spec/services/spree/solidus_six_saferpay/inquire_payment_spec.rb +39 -0
  65. data/spec/services/spree/solidus_six_saferpay/inquire_transaction_payment_spec.rb +21 -0
  66. data/spec/services/spree/solidus_six_saferpay/payment_validator_spec.rb +100 -0
  67. data/spec/services/spree/solidus_six_saferpay/process_authorized_payment_spec.rb +39 -0
  68. data/spec/services/spree/solidus_six_saferpay/process_payment_page_payment_spec.rb +20 -0
  69. data/spec/services/spree/solidus_six_saferpay/process_transaction_payment_spec.rb +20 -0
  70. data/spec/solidus_six_saferpay/configuration_spec.rb +15 -0
  71. data/spec/solidus_six_saferpay/error_handler_spec.rb +65 -0
  72. data/spec/solidus_six_saferpay/gateway_response_spec.rb +70 -0
  73. data/spec/solidus_six_saferpay/gateway_spec.rb +365 -0
  74. data/spec/solidus_six_saferpay/payment_page_gateway_spec.rb +392 -0
  75. data/spec/solidus_six_saferpay/transaction_gateway_spec.rb +390 -0
  76. data/spec/spec_helper.rb +21 -0
  77. data/spec/support/route_access.rb +6 -0
  78. data/spec/support/shared_examples/authorize_payment.rb +132 -0
  79. data/spec/support/shared_examples/checkout_controller.rb +342 -0
  80. data/spec/support/shared_examples/inquire_payment.rb +118 -0
  81. data/spec/support/shared_examples/process_authorized_payment.rb +202 -0
  82. data/spec/support/uses_payment_page_gateway.rb +29 -0
  83. data/spec/support/uses_transaction_gateway.rb +28 -0
  84. metadata +250 -101
  85. data/app/services/spree/solidus_six_saferpay/inquire_transaction.rb +0 -7
@@ -0,0 +1,118 @@
1
+ RSpec.shared_examples 'inquire_payment' do
2
+
3
+ before do
4
+ allow(subject).to receive(:gateway).and_return(double('gateway', inquire: gateway_response))
5
+ end
6
+
7
+ context 'when gateway response is not successful' do
8
+ let(:gateway_success) { false }
9
+ let(:error_behaviour) { "ABORT" }
10
+ let(:error_name) { "VALIDATION_FAILED" }
11
+ let(:error_message) { "Request validation failed" }
12
+ let(:api_response) { nil }
13
+ let(:translated_general_error) { "General Error" }
14
+ let(:translated_user_message) { "User Message" }
15
+
16
+ let(:gateway_response) do
17
+ ::SolidusSixSaferpay::GatewayResponse.new(
18
+ gateway_success,
19
+ "initialize success: #{gateway_success}",
20
+ api_response,
21
+ error_name: error_name,
22
+ )
23
+ end
24
+
25
+ it 'still indicates success' do
26
+ subject.call
27
+
28
+ expect(subject).to be_success
29
+ end
30
+
31
+ it 'adds the error message to the response hash' do
32
+ expect { subject.call }.to change { payment.response_hash }.from({}).to({error: error_name})
33
+ end
34
+
35
+ it 'sets the user message according to the api error code' do
36
+ expect(I18n).to receive(:t).with(:general_error, scope: [:solidus_six_saferpay, :errors]).once.and_return(translated_general_error)
37
+ expect(I18n).to receive(:t).with(error_name, scope: [:six_saferpay, :error_names]).once.and_return(translated_user_message)
38
+
39
+ subject.call
40
+
41
+ expect(subject.user_message).to eq("#{translated_general_error}: #{translated_user_message}")
42
+ end
43
+ end
44
+
45
+ context 'when gateway response is successful' do
46
+ let(:transaction_status) { "AUTHORIZED" }
47
+ let(:transaction_id) { "723n4MAjMdhjSAhAKEUdA8jtl9jb" }
48
+ let(:transaction_date) { "2015-01-30T12:45:22.258+01:00" }
49
+ let(:amount_value) { "100" }
50
+ let(:amount_currency) { "USD" }
51
+ let(:brand_name) { 'PaymentBrand' }
52
+ let(:display_text) { "xxxx xxxx xxxx 1234" }
53
+ let(:six_transaction_reference) { "0:0:3:723n4MAjMdhjSAhAKEUdA8jtl9jb" }
54
+
55
+ let(:payment_means) do
56
+ SixSaferpay::ResponsePaymentMeans.new(
57
+ brand: SixSaferpay::Brand.new(name: brand_name),
58
+ display_text: display_text
59
+ )
60
+ end
61
+
62
+ # https://saferpay.github.io/jsonapi/#Payment_v1_PaymentPage_Assert
63
+ # https://saferpay.github.io/jsonapi/#Payment_v1_Transaction_Authorize
64
+ let(:api_response) do
65
+ api_response_class.new(
66
+ response_header: SixSaferpay::ResponseHeader.new(request_id: 'test', spec_version: 'test'),
67
+ transaction: SixSaferpay::Transaction.new(
68
+ type: "PAYMENT",
69
+ status: transaction_status,
70
+ id: transaction_id,
71
+ date: transaction_date,
72
+ amount: SixSaferpay::Amount.new(value: amount_value, currency_code: amount_currency),
73
+ six_transaction_reference: six_transaction_reference,
74
+ ),
75
+ payment_means: payment_means
76
+ )
77
+ end
78
+
79
+ let(:gateway_success) { true }
80
+ let(:gateway_response) do
81
+ ::SolidusSixSaferpay::GatewayResponse.new(
82
+ gateway_success,
83
+ "initialize success: #{gateway_success}",
84
+ api_response
85
+ )
86
+ end
87
+
88
+ it 'updates the transaction_id' do
89
+ expect { subject.call }.to change { payment.transaction_id }.from(nil).to(transaction_id)
90
+ end
91
+
92
+ it 'updates the transaction status' do
93
+ expect { subject.call }.to change { payment.transaction_status }.from(nil).to(transaction_status)
94
+ end
95
+
96
+ it 'updates the transaction date' do
97
+ expect { subject.call }.to change { payment.transaction_date }.from(nil).to(DateTime.parse(transaction_date))
98
+ end
99
+
100
+ it 'updates the six_transaction_reference' do
101
+ expect { subject.call }.to change { payment.six_transaction_reference }.from(nil).to(six_transaction_reference)
102
+ end
103
+
104
+ it 'updates the display_text' do
105
+ expect { subject.call }.to change { payment.display_text }.from(nil).to(display_text)
106
+ end
107
+
108
+ it 'updates the response hash' do
109
+ expect { subject.call }.to change { payment.response_hash }.from(payment.response_hash).to(api_response.to_h)
110
+ end
111
+
112
+ it 'indicates success' do
113
+ subject.call
114
+
115
+ expect(subject).to be_success
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,202 @@
1
+ RSpec.shared_examples 'process_authorized_payment' do
2
+ before do
3
+ allow(subject).to receive(:gateway).and_return(double('gateway'))
4
+ end
5
+
6
+ context 'liability_shift check' do
7
+
8
+ before do
9
+ # ensure other methods don't modify outcome
10
+ allow(subject).to receive(:validate_payment!)
11
+ allow(subject).to receive(:cancel_old_solidus_payments)
12
+ allow(payment).to receive(:create_solidus_payment!)
13
+ end
14
+
15
+ context 'when liability shift is required' do
16
+ context 'and liability shift is not granted' do
17
+
18
+ let(:payment) { create(:six_saferpay_payment, :authorized, :without_liability_shift) }
19
+
20
+ it 'cancels the payment' do
21
+ expect(payment.payment_method.preferred_require_liability_shift).to be true
22
+ expect(payment.liability.liability_shift).to be false
23
+
24
+ expect(subject.gateway).to receive(:void).with(payment.transaction_id)
25
+
26
+ subject.call
27
+ end
28
+
29
+ it 'indicates failure' do
30
+ expect(payment.payment_method.preferred_require_liability_shift).to be true
31
+ expect(payment.liability.liability_shift).to be false
32
+
33
+ expect(subject.gateway).to receive(:void).with(payment.transaction_id)
34
+
35
+ subject.call
36
+
37
+ expect(subject).not_to be_success
38
+ end
39
+
40
+ end
41
+
42
+ context 'and liability shift is granted' do
43
+ it "doesn't cancel the payment" do
44
+ expect(payment.payment_method.preferred_require_liability_shift).to be true
45
+ expect(payment.liability.liability_shift).to be true
46
+
47
+ expect(subject.gateway).not_to receive(:void)
48
+
49
+ subject.call
50
+ end
51
+
52
+ it 'passes the liability shift check' do
53
+ expect(payment.payment_method.preferred_require_liability_shift).to be true
54
+ expect(payment.liability.liability_shift).to be true
55
+
56
+ subject.call
57
+
58
+ expect(subject).to be_success
59
+ end
60
+ end
61
+ end
62
+
63
+ context 'when liability shift is not required' do
64
+ let(:payment_method) { create(:saferpay_payment_method, :no_require_liability_shift) }
65
+
66
+ context 'and liability shift is not granted' do
67
+ let(:payment) { create(:six_saferpay_payment, :authorized, :without_liability_shift, payment_method: payment_method) }
68
+
69
+ it "doesn't cancel the payment" do
70
+ expect(payment.payment_method.preferred_require_liability_shift).to be false
71
+ expect(payment.liability.liability_shift).to be false
72
+
73
+ expect(subject.gateway).not_to receive(:void)
74
+
75
+ subject.call
76
+ end
77
+
78
+ it 'passes the liability shift check' do
79
+ expect(payment.payment_method.preferred_require_liability_shift).to be false
80
+ expect(payment.liability.liability_shift).to be false
81
+ subject.call
82
+
83
+ expect(subject).to be_success
84
+ end
85
+ end
86
+
87
+ context 'and liability shift is granted' do
88
+ let(:payment) { create(:six_saferpay_payment, :authorized, payment_method: payment_method) }
89
+ it "doesn't cancel the payment" do
90
+ expect(payment.payment_method.preferred_require_liability_shift).to be false
91
+ expect(payment.liability.liability_shift).to be true
92
+
93
+ expect(subject.gateway).not_to receive(:void)
94
+
95
+ subject.call
96
+ end
97
+
98
+ it 'passes the liability shift check' do
99
+ expect(payment.payment_method.preferred_require_liability_shift).to be false
100
+ expect(payment.liability.liability_shift).to be true
101
+ subject.call
102
+
103
+ expect(subject).to be_success
104
+ end
105
+ end
106
+ end
107
+ end
108
+
109
+ context 'payment validation' do
110
+ before do
111
+ allow(subject).to receive(:gateway).and_return(double('gateway'))
112
+
113
+
114
+ # ensure other methods don't modify outcome
115
+ allow(subject).to receive(:check_liability_shift_requirements!)
116
+ allow(subject).to receive(:cancel_old_solidus_payments)
117
+ allow(payment).to receive(:create_solidus_payment!)
118
+ end
119
+
120
+ it 'validates the payment' do
121
+ expect(Spree::SolidusSixSaferpay::PaymentValidator).to receive(:call).with(payment)
122
+ subject.call
123
+ end
124
+
125
+ context 'when the payment is invalid' do
126
+ it 'cancels the payment' do
127
+ expect(subject.gateway).to receive(:void).with(payment.transaction_id)
128
+
129
+ subject.call
130
+ end
131
+
132
+ it 'indicates failure' do
133
+ allow(subject.gateway).to receive(:void).with(payment.transaction_id)
134
+
135
+ subject.call
136
+
137
+ expect(subject).not_to be_success
138
+ end
139
+ end
140
+
141
+ context 'when the payment is valid' do
142
+ before do
143
+ allow(Spree::SolidusSixSaferpay::PaymentValidator).to receive(:call).with(payment).and_return(true)
144
+ end
145
+
146
+ it "doesn't cancel the payment" do
147
+ expect(subject.gateway).not_to receive(:void)
148
+
149
+ subject.call
150
+ end
151
+
152
+ it 'indicates success' do
153
+ subject.call
154
+
155
+ expect(subject).to be_success
156
+ end
157
+ end
158
+ end
159
+
160
+ context 'when the payment has passed all validations' do
161
+ before do
162
+ allow(subject).to receive(:check_liability_shift_requirements!).and_return(true)
163
+ allow(subject).to receive(:validate_payment!).and_return(true)
164
+ end
165
+
166
+ context 'when previous solidus payments exist for this order' do
167
+ let(:order) { payment.order }
168
+ let!(:previous_payment_invalid) { create(:payment_using_saferpay, order: order) }
169
+ let!(:previous_payment_checkout) { create(:payment_using_saferpay, order: order) }
170
+
171
+ before do
172
+ # This is bad practice because we mock which payments are invalidated here.
173
+ # The reason is that you can't stub methods on AR objects that
174
+ # are loaded from the DB and because #solidus_payments_to_cancel
175
+ # is just AR scopes, I prefer this test over using stuff like
176
+ # #expect_any_instance_of
177
+ allow(subject).to receive(:solidus_payments_to_cancel).and_return([previous_payment_checkout])
178
+ end
179
+
180
+ it 'cancels old solidus payments' do
181
+ expect(previous_payment_invalid).not_to receive(:cancel!)
182
+ expect(previous_payment_checkout).to receive(:cancel!)
183
+
184
+ subject.call
185
+ end
186
+ end
187
+
188
+ it 'creates a new solidus payment' do
189
+ expect(payment).to receive(:create_solidus_payment!)
190
+
191
+ subject.call
192
+ end
193
+
194
+ it 'indicates success' do
195
+ allow(payment).to receive(:create_solidus_payment!)
196
+
197
+ subject.call
198
+
199
+ expect(subject).to be_success
200
+ end
201
+ end
202
+ end
@@ -0,0 +1,29 @@
1
+ RSpec.shared_examples "it uses the payment page gateway" do
2
+
3
+ it_behaves_like "it has route access"
4
+
5
+ describe '#gateway' do
6
+ it 'configures the gateway urls correctly' do
7
+ expect(::SolidusSixSaferpay::PaymentPageGateway).to receive(:new)
8
+
9
+ subject.gateway
10
+ end
11
+
12
+ context 'when the gateway is configured correctly' do
13
+ before do
14
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_CUSTOMER_ID").and_return("customer_id")
15
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_TERMINAL_ID").and_return("terminal_id")
16
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_USERNAME").and_return("username")
17
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_PASSWORD").and_return("password")
18
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_BASE_URL").and_return("base_url")
19
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_CSS_URL").and_return("css_url")
20
+ end
21
+
22
+ it 'should return a PaymentPageGateway' do
23
+ expect(subject.gateway).to be_a(::SolidusSixSaferpay::PaymentPageGateway)
24
+ end
25
+
26
+ end
27
+ end
28
+ end
29
+
@@ -0,0 +1,28 @@
1
+ RSpec.shared_examples "it uses the transaction gateway" do
2
+
3
+ it_behaves_like "it has route access"
4
+
5
+ describe '#gateway' do
6
+ it 'configures the gateway urls correctly' do
7
+ expect(::SolidusSixSaferpay::TransactionGateway).to receive(:new)
8
+ subject.gateway
9
+ end
10
+
11
+ context 'when the gateway is configured correctly' do
12
+ before do
13
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_CUSTOMER_ID").and_return("customer_id")
14
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_TERMINAL_ID").and_return("terminal_id")
15
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_USERNAME").and_return("username")
16
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_PASSWORD").and_return("password")
17
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_BASE_URL").and_return("base_url")
18
+ allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_CSS_URL").and_return("css_url")
19
+ end
20
+
21
+ it 'should return a TransactionGateway' do
22
+ expect(subject.gateway).to be_a(::SolidusSixSaferpay::TransactionGateway)
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+
metadata CHANGED
@@ -1,71 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_six_saferpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Kiener
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-16 00:00:00.000000000 Z
11
+ date: 2020-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: solidus_core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '5.1'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
17
+ - - ">="
25
18
  - !ruby/object:Gem::Version
26
- version: '5.1'
27
- - !ruby/object:Gem::Dependency
28
- name: solidus
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
19
+ version: 2.0.0
20
+ - - "<"
32
21
  - !ruby/object:Gem::Version
33
- version: '2.7'
22
+ version: '3'
34
23
  type: :runtime
35
24
  prerelease: false
36
25
  version_requirements: !ruby/object:Gem::Requirement
37
26
  requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.7'
41
- - !ruby/object:Gem::Dependency
42
- name: solidus_support
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
27
+ - - ">="
46
28
  - !ruby/object:Gem::Version
47
- version: '0.1'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
29
+ version: 2.0.0
30
+ - - "<"
53
31
  - !ruby/object:Gem::Version
54
- version: '0.1'
32
+ version: '3'
55
33
  - !ruby/object:Gem::Dependency
56
- name: rails-i18n
34
+ name: solidus_support
57
35
  requirement: !ruby/object:Gem::Requirement
58
36
  requirements:
59
37
  - - "~>"
60
38
  - !ruby/object:Gem::Version
61
- version: '5.1'
39
+ version: 0.4.0
62
40
  type: :runtime
63
41
  prerelease: false
64
42
  version_requirements: !ruby/object:Gem::Requirement
65
43
  requirements:
66
44
  - - "~>"
67
45
  - !ruby/object:Gem::Version
68
- version: '5.1'
46
+ version: 0.4.0
69
47
  - !ruby/object:Gem::Dependency
70
48
  name: six_saferpay
71
49
  requirement: !ruby/object:Gem::Requirement
@@ -81,61 +59,67 @@ dependencies:
81
59
  - !ruby/object:Gem::Version
82
60
  version: '2.2'
83
61
  - !ruby/object:Gem::Dependency
84
- name: sqlite3
62
+ name: rails-i18n
85
63
  requirement: !ruby/object:Gem::Requirement
86
64
  requirements:
87
65
  - - "~>"
88
66
  - !ruby/object:Gem::Version
89
- version: '1.4'
90
- type: :development
67
+ version: '5.1'
68
+ type: :runtime
91
69
  prerelease: false
92
70
  version_requirements: !ruby/object:Gem::Requirement
93
71
  requirements:
94
72
  - - "~>"
95
73
  - !ruby/object:Gem::Version
96
- version: '1.4'
74
+ version: '5.1'
97
75
  - !ruby/object:Gem::Dependency
98
- name: rspec-rails
76
+ name: solidus_dev_support
99
77
  requirement: !ruby/object:Gem::Requirement
100
78
  requirements:
101
- - - "~>"
79
+ - - ">="
102
80
  - !ruby/object:Gem::Version
103
- version: '3.8'
81
+ version: '0'
104
82
  type: :development
105
83
  prerelease: false
106
84
  version_requirements: !ruby/object:Gem::Requirement
107
85
  requirements:
108
- - - "~>"
86
+ - - ">="
109
87
  - !ruby/object:Gem::Version
110
- version: '3.8'
88
+ version: '0'
111
89
  - !ruby/object:Gem::Dependency
112
- name: factory_bot_rails
90
+ name: shoulda-matchers
113
91
  requirement: !ruby/object:Gem::Requirement
114
92
  requirements:
115
93
  - - "~>"
116
94
  - !ruby/object:Gem::Version
117
- version: '5.0'
95
+ version: '4.1'
118
96
  type: :development
119
97
  prerelease: false
120
98
  version_requirements: !ruby/object:Gem::Requirement
121
99
  requirements:
122
100
  - - "~>"
123
101
  - !ruby/object:Gem::Version
124
- version: '5.0'
102
+ version: '4.1'
125
103
  - !ruby/object:Gem::Dependency
126
- name: shoulda-matchers
104
+ name: rails-controller-testing
127
105
  requirement: !ruby/object:Gem::Requirement
128
106
  requirements:
129
107
  - - "~>"
130
108
  - !ruby/object:Gem::Version
131
- version: '4.1'
109
+ version: '1.0'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 1.0.4
132
113
  type: :development
133
114
  prerelease: false
134
115
  version_requirements: !ruby/object:Gem::Requirement
135
116
  requirements:
136
117
  - - "~>"
137
118
  - !ruby/object:Gem::Version
138
- version: '4.1'
119
+ version: '1.0'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 1.0.4
139
123
  - !ruby/object:Gem::Dependency
140
124
  name: pry
141
125
  requirement: !ruby/object:Gem::Requirement
@@ -164,48 +148,6 @@ dependencies:
164
148
  - - "~>"
165
149
  - !ruby/object:Gem::Version
166
150
  version: '0.3'
167
- - !ruby/object:Gem::Dependency
168
- name: simplecov
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: '0.17'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: '0.17'
181
- - !ruby/object:Gem::Dependency
182
- name: database_cleaner
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: '1.7'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: '1.7'
195
- - !ruby/object:Gem::Dependency
196
- name: ffaker
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - "~>"
200
- - !ruby/object:Gem::Version
201
- version: '2.11'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - "~>"
207
- - !ruby/object:Gem::Version
208
- version: '2.11'
209
151
  description: Adds Saferpay Payment Page and Transaction payment methods to your Solidus
210
152
  application
211
153
  email:
@@ -214,10 +156,20 @@ executables: []
214
156
  extensions: []
215
157
  extra_rdoc_files: []
216
158
  files:
159
+ - ".circleci/config.yml"
160
+ - ".gem_release.yml"
161
+ - ".github/stale.yml"
162
+ - ".gitignore"
163
+ - ".rspec"
164
+ - ".rubocop.yml"
165
+ - ".travis.yml"
166
+ - Gemfile
167
+ - LICENSE
217
168
  - MIT-LICENSE
218
169
  - README.md
219
170
  - Rakefile
220
171
  - app/assets/config/solidus_six_saferpay_manifest.js
172
+ - app/assets/images/solidus_six_saferpay/.keep
221
173
  - app/assets/images/solidus_six_saferpay/credit_cards/icons/amex.png
222
174
  - app/assets/images/solidus_six_saferpay/credit_cards/icons/bonus_card.png
223
175
  - app/assets/images/solidus_six_saferpay/credit_cards/icons/cirrus.png
@@ -244,9 +196,13 @@ files:
244
196
  - app/assets/images/solidus_six_saferpay/credit_cards/icons/worldpay.png
245
197
  - app/assets/javascripts/solidus_six_saferpay/application.js
246
198
  - app/assets/javascripts/solidus_six_saferpay/saferpay_payment.js
199
+ - app/assets/javascripts/spree/backend/solidus_six_saferpay.js
200
+ - app/assets/javascripts/spree/frontend/solidus_six_saferpay.js
247
201
  - app/assets/stylesheets/solidus_six_saferpay/application.css
248
202
  - app/assets/stylesheets/solidus_six_saferpay/loading_animation.scss
249
203
  - app/assets/stylesheets/solidus_six_saferpay/payments.scss
204
+ - app/assets/stylesheets/spree/backend/solidus_six_saferpay.css
205
+ - app/assets/stylesheets/spree/frontend/solidus_six_saferpay.css
250
206
  - app/controllers/solidus_six_saferpay/application_controller.rb
251
207
  - app/controllers/spree/solidus_six_saferpay/checkout_controller.rb
252
208
  - app/controllers/spree/solidus_six_saferpay/payment_page/checkout_controller.rb
@@ -260,12 +216,12 @@ files:
260
216
  - app/services/spree/solidus_six_saferpay/assert_payment_page.rb
261
217
  - app/services/spree/solidus_six_saferpay/authorize_payment.rb
262
218
  - app/services/spree/solidus_six_saferpay/authorize_transaction.rb
219
+ - app/services/spree/solidus_six_saferpay/cancel_authorized_payment.rb
263
220
  - app/services/spree/solidus_six_saferpay/initialize_payment.rb
264
221
  - app/services/spree/solidus_six_saferpay/initialize_payment_page.rb
265
222
  - app/services/spree/solidus_six_saferpay/initialize_transaction.rb
266
223
  - app/services/spree/solidus_six_saferpay/inquire_payment.rb
267
224
  - app/services/spree/solidus_six_saferpay/inquire_payment_page_payment.rb
268
- - app/services/spree/solidus_six_saferpay/inquire_transaction.rb
269
225
  - app/services/spree/solidus_six_saferpay/inquire_transaction_payment.rb
270
226
  - app/services/spree/solidus_six_saferpay/payment_validator.rb
271
227
  - app/services/spree/solidus_six_saferpay/process_authorized_payment.rb
@@ -277,7 +233,13 @@ files:
277
233
  - app/views/spree/api/payments/source_views/_saferpay_payment.json.jbuilder
278
234
  - app/views/spree/checkout/payment/_saferpay_payment.html.erb
279
235
  - app/views/spree/six_saferpay_payments/_six_saferpay_payment.html.erb
280
- - app/views/spree/solidus_six_saferpay/checkout/iframe_breakout_redirect.html.erb
236
+ - app/views/spree/solidus_six_saferpay/checkout/iframe_breakout_redirect.erb
237
+ - bin/console
238
+ - bin/rails
239
+ - bin/rake
240
+ - bin/sandbox
241
+ - bin/setup
242
+ - config/initializers/assets.rb
281
243
  - config/locales/de.yml
282
244
  - config/locales/en.yml
283
245
  - config/locales/fr.yml
@@ -294,19 +256,114 @@ files:
294
256
  - lib/solidus_six_saferpay/payment_page_gateway.rb
295
257
  - lib/solidus_six_saferpay/transaction_gateway.rb
296
258
  - lib/solidus_six_saferpay/version.rb
297
- homepage: http://fadendaten.ch
259
+ - solidus_six_saferpay.gemspec
260
+ - spec/controllers/spree/solidus_six_saferpay/payment_page/checkout_controller_spec.rb
261
+ - spec/controllers/spree/solidus_six_saferpay/transaction/checkout_controller_spec.rb
262
+ - spec/dummy/.ruby-version
263
+ - spec/dummy/README.md
264
+ - spec/dummy/Rakefile
265
+ - spec/dummy/app/assets/config/manifest.js
266
+ - spec/dummy/app/assets/javascripts/cable.js
267
+ - spec/dummy/app/assets/stylesheets/application.css
268
+ - spec/dummy/app/channels/application_cable/channel.rb
269
+ - spec/dummy/app/channels/application_cable/connection.rb
270
+ - spec/dummy/app/controllers/application_controller.rb
271
+ - spec/dummy/app/helpers/application_helper.rb
272
+ - spec/dummy/app/jobs/application_job.rb
273
+ - spec/dummy/app/mailers/application_mailer.rb
274
+ - spec/dummy/app/models/application_record.rb
275
+ - spec/dummy/app/views/layouts/application.html.erb
276
+ - spec/dummy/app/views/layouts/mailer.html.erb
277
+ - spec/dummy/app/views/layouts/mailer.text.erb
278
+ - spec/dummy/bin/bundle
279
+ - spec/dummy/bin/rails
280
+ - spec/dummy/bin/rake
281
+ - spec/dummy/bin/setup
282
+ - spec/dummy/bin/update
283
+ - spec/dummy/config.ru
284
+ - spec/dummy/config/application.rb
285
+ - spec/dummy/config/boot.rb
286
+ - spec/dummy/config/cable.yml
287
+ - spec/dummy/config/credentials.yml.enc
288
+ - spec/dummy/config/database.yml
289
+ - spec/dummy/config/environment.rb
290
+ - spec/dummy/config/environments/development.rb
291
+ - spec/dummy/config/environments/production.rb
292
+ - spec/dummy/config/environments/test.rb
293
+ - spec/dummy/config/initializers/application_controller_renderer.rb
294
+ - spec/dummy/config/initializers/assets.rb
295
+ - spec/dummy/config/initializers/backtrace_silencers.rb
296
+ - spec/dummy/config/initializers/content_security_policy.rb
297
+ - spec/dummy/config/initializers/cookies_serializer.rb
298
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
299
+ - spec/dummy/config/initializers/inflections.rb
300
+ - spec/dummy/config/initializers/mime_types.rb
301
+ - spec/dummy/config/initializers/spree.rb
302
+ - spec/dummy/config/initializers/wrap_parameters.rb
303
+ - spec/dummy/config/locales/en.yml
304
+ - spec/dummy/config/master.key
305
+ - spec/dummy/config/routes.rb
306
+ - spec/dummy/config/storage.yml
307
+ - spec/dummy/db/schema.rb
308
+ - spec/dummy/db/seeds.rb
309
+ - spec/dummy/public/404.html
310
+ - spec/dummy/public/422.html
311
+ - spec/dummy/public/500.html
312
+ - spec/dummy/public/apple-touch-icon-precomposed.png
313
+ - spec/dummy/public/apple-touch-icon.png
314
+ - spec/dummy/public/favicon.ico
315
+ - spec/dummy/vendor/assets/javascripts/spree/backend/all.js
316
+ - spec/dummy/vendor/assets/javascripts/spree/frontend/all.js
317
+ - spec/dummy/vendor/assets/stylesheets/spree/backend/all.css
318
+ - spec/dummy/vendor/assets/stylesheets/spree/frontend/all.css
319
+ - spec/factories/payment_methods.rb
320
+ - spec/factories/payments.rb
321
+ - spec/factories/spree/six_saferpay_payments.rb
322
+ - spec/models/spree/six_saferpay_payment_spec.rb
323
+ - spec/rails_helper.rb
324
+ - spec/services/spree/solidus_six_saferpay/assert_payment_page_spec.rb
325
+ - spec/services/spree/solidus_six_saferpay/authorize_payment_spec.rb
326
+ - spec/services/spree/solidus_six_saferpay/authorize_transaction_spec.rb
327
+ - spec/services/spree/solidus_six_saferpay/cancel_authorized_payment_spec.rb
328
+ - spec/services/spree/solidus_six_saferpay/initialize_payment_page_spec.rb
329
+ - spec/services/spree/solidus_six_saferpay/initialize_payment_spec.rb
330
+ - spec/services/spree/solidus_six_saferpay/initialize_transaction_spec.rb
331
+ - spec/services/spree/solidus_six_saferpay/inquire_payment_page_payment_spec.rb
332
+ - spec/services/spree/solidus_six_saferpay/inquire_payment_spec.rb
333
+ - spec/services/spree/solidus_six_saferpay/inquire_transaction_payment_spec.rb
334
+ - spec/services/spree/solidus_six_saferpay/payment_validator_spec.rb
335
+ - spec/services/spree/solidus_six_saferpay/process_authorized_payment_spec.rb
336
+ - spec/services/spree/solidus_six_saferpay/process_payment_page_payment_spec.rb
337
+ - spec/services/spree/solidus_six_saferpay/process_transaction_payment_spec.rb
338
+ - spec/solidus_six_saferpay/configuration_spec.rb
339
+ - spec/solidus_six_saferpay/error_handler_spec.rb
340
+ - spec/solidus_six_saferpay/gateway_response_spec.rb
341
+ - spec/solidus_six_saferpay/gateway_spec.rb
342
+ - spec/solidus_six_saferpay/payment_page_gateway_spec.rb
343
+ - spec/solidus_six_saferpay/transaction_gateway_spec.rb
344
+ - spec/spec_helper.rb
345
+ - spec/support/route_access.rb
346
+ - spec/support/shared_examples/authorize_payment.rb
347
+ - spec/support/shared_examples/checkout_controller.rb
348
+ - spec/support/shared_examples/inquire_payment.rb
349
+ - spec/support/shared_examples/process_authorized_payment.rb
350
+ - spec/support/uses_payment_page_gateway.rb
351
+ - spec/support/uses_transaction_gateway.rb
352
+ homepage: https://github.com/fadendaten/solidus_six_saferpay
298
353
  licenses:
299
354
  - MIT
300
- metadata: {}
355
+ metadata:
356
+ homepage_uri: https://github.com/fadendaten/solidus_six_saferpay
357
+ source_code_uri: https://github.com/fadendaten/solidus_six_saferpay
301
358
  post_install_message:
302
359
  rdoc_options: []
303
360
  require_paths:
304
361
  - lib
305
362
  required_ruby_version: !ruby/object:Gem::Requirement
306
363
  requirements:
307
- - - ">="
364
+ - - "~>"
308
365
  - !ruby/object:Gem::Version
309
- version: '0'
366
+ version: '2.4'
310
367
  required_rubygems_version: !ruby/object:Gem::Requirement
311
368
  requirements:
312
369
  - - ">="
@@ -318,4 +375,96 @@ rubygems_version: 2.7.6
318
375
  signing_key:
319
376
  specification_version: 4
320
377
  summary: Saferpay Payment Page and Transaction payment methods for Solidus
321
- test_files: []
378
+ test_files:
379
+ - spec/controllers/spree/solidus_six_saferpay/payment_page/checkout_controller_spec.rb
380
+ - spec/controllers/spree/solidus_six_saferpay/transaction/checkout_controller_spec.rb
381
+ - spec/dummy/.ruby-version
382
+ - spec/dummy/README.md
383
+ - spec/dummy/Rakefile
384
+ - spec/dummy/app/assets/config/manifest.js
385
+ - spec/dummy/app/assets/javascripts/cable.js
386
+ - spec/dummy/app/assets/stylesheets/application.css
387
+ - spec/dummy/app/channels/application_cable/channel.rb
388
+ - spec/dummy/app/channels/application_cable/connection.rb
389
+ - spec/dummy/app/controllers/application_controller.rb
390
+ - spec/dummy/app/helpers/application_helper.rb
391
+ - spec/dummy/app/jobs/application_job.rb
392
+ - spec/dummy/app/mailers/application_mailer.rb
393
+ - spec/dummy/app/models/application_record.rb
394
+ - spec/dummy/app/views/layouts/application.html.erb
395
+ - spec/dummy/app/views/layouts/mailer.html.erb
396
+ - spec/dummy/app/views/layouts/mailer.text.erb
397
+ - spec/dummy/bin/bundle
398
+ - spec/dummy/bin/rails
399
+ - spec/dummy/bin/rake
400
+ - spec/dummy/bin/setup
401
+ - spec/dummy/bin/update
402
+ - spec/dummy/config.ru
403
+ - spec/dummy/config/application.rb
404
+ - spec/dummy/config/boot.rb
405
+ - spec/dummy/config/cable.yml
406
+ - spec/dummy/config/credentials.yml.enc
407
+ - spec/dummy/config/database.yml
408
+ - spec/dummy/config/environment.rb
409
+ - spec/dummy/config/environments/development.rb
410
+ - spec/dummy/config/environments/production.rb
411
+ - spec/dummy/config/environments/test.rb
412
+ - spec/dummy/config/initializers/application_controller_renderer.rb
413
+ - spec/dummy/config/initializers/assets.rb
414
+ - spec/dummy/config/initializers/backtrace_silencers.rb
415
+ - spec/dummy/config/initializers/content_security_policy.rb
416
+ - spec/dummy/config/initializers/cookies_serializer.rb
417
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
418
+ - spec/dummy/config/initializers/inflections.rb
419
+ - spec/dummy/config/initializers/mime_types.rb
420
+ - spec/dummy/config/initializers/spree.rb
421
+ - spec/dummy/config/initializers/wrap_parameters.rb
422
+ - spec/dummy/config/locales/en.yml
423
+ - spec/dummy/config/master.key
424
+ - spec/dummy/config/routes.rb
425
+ - spec/dummy/config/storage.yml
426
+ - spec/dummy/db/schema.rb
427
+ - spec/dummy/db/seeds.rb
428
+ - spec/dummy/public/404.html
429
+ - spec/dummy/public/422.html
430
+ - spec/dummy/public/500.html
431
+ - spec/dummy/public/apple-touch-icon-precomposed.png
432
+ - spec/dummy/public/apple-touch-icon.png
433
+ - spec/dummy/public/favicon.ico
434
+ - spec/dummy/vendor/assets/javascripts/spree/backend/all.js
435
+ - spec/dummy/vendor/assets/javascripts/spree/frontend/all.js
436
+ - spec/dummy/vendor/assets/stylesheets/spree/backend/all.css
437
+ - spec/dummy/vendor/assets/stylesheets/spree/frontend/all.css
438
+ - spec/factories/payment_methods.rb
439
+ - spec/factories/payments.rb
440
+ - spec/factories/spree/six_saferpay_payments.rb
441
+ - spec/models/spree/six_saferpay_payment_spec.rb
442
+ - spec/rails_helper.rb
443
+ - spec/services/spree/solidus_six_saferpay/assert_payment_page_spec.rb
444
+ - spec/services/spree/solidus_six_saferpay/authorize_payment_spec.rb
445
+ - spec/services/spree/solidus_six_saferpay/authorize_transaction_spec.rb
446
+ - spec/services/spree/solidus_six_saferpay/cancel_authorized_payment_spec.rb
447
+ - spec/services/spree/solidus_six_saferpay/initialize_payment_page_spec.rb
448
+ - spec/services/spree/solidus_six_saferpay/initialize_payment_spec.rb
449
+ - spec/services/spree/solidus_six_saferpay/initialize_transaction_spec.rb
450
+ - spec/services/spree/solidus_six_saferpay/inquire_payment_page_payment_spec.rb
451
+ - spec/services/spree/solidus_six_saferpay/inquire_payment_spec.rb
452
+ - spec/services/spree/solidus_six_saferpay/inquire_transaction_payment_spec.rb
453
+ - spec/services/spree/solidus_six_saferpay/payment_validator_spec.rb
454
+ - spec/services/spree/solidus_six_saferpay/process_authorized_payment_spec.rb
455
+ - spec/services/spree/solidus_six_saferpay/process_payment_page_payment_spec.rb
456
+ - spec/services/spree/solidus_six_saferpay/process_transaction_payment_spec.rb
457
+ - spec/solidus_six_saferpay/configuration_spec.rb
458
+ - spec/solidus_six_saferpay/error_handler_spec.rb
459
+ - spec/solidus_six_saferpay/gateway_response_spec.rb
460
+ - spec/solidus_six_saferpay/gateway_spec.rb
461
+ - spec/solidus_six_saferpay/payment_page_gateway_spec.rb
462
+ - spec/solidus_six_saferpay/transaction_gateway_spec.rb
463
+ - spec/spec_helper.rb
464
+ - spec/support/route_access.rb
465
+ - spec/support/shared_examples/authorize_payment.rb
466
+ - spec/support/shared_examples/checkout_controller.rb
467
+ - spec/support/shared_examples/inquire_payment.rb
468
+ - spec/support/shared_examples/process_authorized_payment.rb
469
+ - spec/support/uses_payment_page_gateway.rb
470
+ - spec/support/uses_transaction_gateway.rb