solidus_stripe 5.0.0 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -0
- data/app/models/solidus_stripe/payment_intent.rb +2 -1
- data/bin/dummy-app +0 -3
- data/bin/rails-new +2 -0
- data/lib/solidus_stripe/version.rb +1 -1
- data/spec/support/solidus_stripe/backend_test_helper.rb +9 -1
- data/spec/system/backend/solidus_stripe/orders/payments_spec.rb +6 -2
- data/spec/system/frontend/solidus_stripe/checkout_spec.rb +19 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '024918e27fdd100b73a5695aa31d9217cc244ecb44fc4fb209df09eda07462af'
|
4
|
+
data.tar.gz: d9f652e6df2d4680e7a81e792449a34d189de9aecf8d320cad78ccb8d3460417
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df078370f8522e3ab4c38ddcb114aa91ffde2b932aa6bb63ab4292b24645f0828d7ba556319b1e52878b46b43bd672e0c60d396110b722192bf00764296a45f6
|
7
|
+
data.tar.gz: 6f2d40c7bb04dd739589e161e02777c872fbc547567767e4f0fc1f1508f800b22c7442c3a264b9ce1595c8bf1e483a89725500ffe27375c50a3f55e0f2fe0b69
|
data/Rakefile
CHANGED
@@ -39,7 +39,8 @@ module SolidusStripe
|
|
39
39
|
|
40
40
|
def usable?
|
41
41
|
stripe_intent_id &&
|
42
|
-
stripe_intent.status == 'requires_payment_method'
|
42
|
+
(stripe_intent.status == 'requires_payment_method' ||
|
43
|
+
stripe_intent.status == 'requires_confirmation') &&
|
43
44
|
stripe_intent.amount == stripe_order_amount
|
44
45
|
end
|
45
46
|
|
data/bin/dummy-app
CHANGED
@@ -22,8 +22,5 @@ echo "gem 'simplecov', '~> 0.22', require: false" >> Gemfile
|
|
22
22
|
echo "gem 'simplecov-cobertura', require: false" >> Gemfile
|
23
23
|
unbundled bundle install
|
24
24
|
|
25
|
-
unbundled bundle add solidus --github solidusio/solidus --branch "${SOLIDUS_BRANCH:-main}" --version '> 0.a'
|
26
|
-
unbundled bundle exec rake db:drop db:create
|
27
|
-
unbundled bundle exec rails generate solidus:install --auto-accept --payment-method=none --no-seed --no-sample "$@"
|
28
25
|
unbundled bundle add $extension_name --path ..
|
29
26
|
unbundled bundle exec rails generate $extension_name:install --migrate --load-seeds=false --specs=all
|
data/bin/rails-new
CHANGED
@@ -11,6 +11,8 @@ rails_version=`bundle exec ruby -rrails/version -e'puts Rails.version'`
|
|
11
11
|
solidus_version=`bundle exec ruby -rspree/core/version -e'puts Spree::VERSION'`
|
12
12
|
cache_path="tmp/cache/rails-new/${app_name}-${rails_version}-${solidus_version}-${ruby_version}.zip"
|
13
13
|
|
14
|
+
test $CI && cache_path="" # Disable caching on CI
|
15
|
+
|
14
16
|
# Stay away from the bundler env of the containing extension.
|
15
17
|
function unbundled {
|
16
18
|
echo "~~> Running: $@"
|
@@ -70,7 +70,14 @@ module SolidusStripe::BackendTestHelper
|
|
70
70
|
|
71
71
|
def visit_payment_page(payment)
|
72
72
|
visit_payments_page
|
73
|
-
|
73
|
+
click_on_payment(payment)
|
74
|
+
end
|
75
|
+
|
76
|
+
def click_on_payment(payment)
|
77
|
+
payment_number_link = find_link(payment.number)
|
78
|
+
page.current_window.resize_to(1200, 800)
|
79
|
+
scroll_to payment_number_link
|
80
|
+
payment_number_link.click
|
74
81
|
end
|
75
82
|
|
76
83
|
# Action helper methods for performing operations on payments
|
@@ -110,6 +117,7 @@ module SolidusStripe::BackendTestHelper
|
|
110
117
|
def complete_order_with_existing_payment_source
|
111
118
|
visit_payments_page
|
112
119
|
click_on "Continue"
|
120
|
+
page.current_window.resize_to(1200, 800)
|
113
121
|
click_on "Confirm"
|
114
122
|
click_on "Complete Order"
|
115
123
|
end
|
@@ -13,8 +13,12 @@ RSpec.describe 'SolidusStripe Orders Payments', :js do
|
|
13
13
|
it 'navigates to the payments page' do
|
14
14
|
payment = create_authorized_payment
|
15
15
|
visit_payments_page
|
16
|
-
|
17
|
-
|
16
|
+
within('[data-hook="admin_order_tabs"]') do
|
17
|
+
payments_link = find_link('Payments')
|
18
|
+
scroll_to payments_link
|
19
|
+
page.current_window.resize_to(1200, 800)
|
20
|
+
payments_link.click
|
21
|
+
end
|
18
22
|
expect(page).to have_content(payment.number)
|
19
23
|
end
|
20
24
|
|
@@ -203,4 +203,23 @@ RSpec.describe 'SolidusStripe Checkout', :js do
|
|
203
203
|
end
|
204
204
|
end
|
205
205
|
end
|
206
|
+
|
207
|
+
context 'when refreshing the confirmation page' do
|
208
|
+
it 'does not create a duplicate payment intent' do
|
209
|
+
create_payment_method
|
210
|
+
visit_payment_step(user: create(:user))
|
211
|
+
choose_new_stripe_payment
|
212
|
+
fill_in_stripe_country('United States')
|
213
|
+
fill_stripe_form(number: '4000000000003220')
|
214
|
+
submit_payment
|
215
|
+
expect(page).to have_content('Confirm')
|
216
|
+
check_terms_of_service # ensure we're on the confirm page before refreshing
|
217
|
+
page.driver.browser.navigate.refresh
|
218
|
+
check_terms_of_service
|
219
|
+
confirm_order
|
220
|
+
authorize_3d_secure_2_payment(authenticate: true)
|
221
|
+
expect(page).to have_content('Your order has been processed successfully')
|
222
|
+
payment_intent_is_created_with_required_capture
|
223
|
+
end
|
224
|
+
end
|
206
225
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_stripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
291
|
- !ruby/object:Gem::Version
|
292
292
|
version: '0'
|
293
293
|
requirements: []
|
294
|
-
rubygems_version: 3.4.
|
294
|
+
rubygems_version: 3.4.18
|
295
295
|
signing_key:
|
296
296
|
specification_version: 4
|
297
297
|
summary: Stripe Payment Method for Solidus
|