spree_gateway 3.10.0 → 3.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 056db537dbbb9403df9df6e2822fa462b9c0b2eac0f880548d7ad9deb93e91c5
4
- data.tar.gz: aeb658e8f6abfe36b8b84d45bb819a2cc02510f27010cf6ef059c3ae7fc78e30
3
+ metadata.gz: 49958bc5a2c4bad1a83572b754be89db2f651619d609f88b1ce05d8c2e768ff8
4
+ data.tar.gz: dc864bbb288ed41b9792c7d67687573057bb2aa31d61caa2e7bc25bd4db42a93
5
5
  SHA512:
6
- metadata.gz: 9896b8790e3ad9bfd23cd5387fe8718d0e1dcb52edd4dcfce1026fdbe875192bd1287b45613be7a1ec395eeb8279e06817f92d9f45a7ab510dd37b910f27394a
7
- data.tar.gz: 3659666f037e516a8ac535d11e5f95d4dcb64f7794e110ddb51b2a8087f699948c0e37c12c0d91bd48ca38633f1ced10dfb31528bbf873bfc09606f4fc994593
6
+ metadata.gz: bc0d840410c2ae818c51a50e351e14dff012342d389bb3a15dafffc8d07b1bc518289950c1cbc932935cf48d2a99a9b6bc0d5ab11cd1b244b96c88a58bf58800
7
+ data.tar.gz: 61084fbbe3aaabecbecd7a099eff8438adf3f244110ed290712b15ad8590ead63539ae6ce1468ca5951362fbfef1214734bc8b4decf65d6906af2732b6582458
@@ -0,0 +1,115 @@
1
+ version: 2.1
2
+
3
+ defaults: &defaults
4
+ environment: &environment
5
+ CIRCLE_TEST_REPORTS: /tmp/test-results
6
+ CIRCLE_ARTIFACTS: /tmp/test-artifacts
7
+ BUNDLE_JOBS: 4
8
+ BUNDLE_RETRY: 3
9
+ BUNDLE_PATH: ~/spree/vendor/bundle
10
+ working_directory: ~/spree
11
+ docker:
12
+ - image: &ruby_image cimg/ruby:3.3-browsers
13
+
14
+ run_tests: &run_tests
15
+ <<: *defaults
16
+ steps:
17
+ - checkout
18
+ - restore_cache:
19
+ keys:
20
+ - spree-bundle-{{ .Branch }}
21
+ - spree-bundle
22
+ - run:
23
+ name: Add keyserver
24
+ command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
25
+ - run:
26
+ name: Install libvips
27
+ command: sudo apt-get update && sudo apt-get install libvips
28
+ - run:
29
+ name: Set bundle path
30
+ command: bundle config --local path vendor/bundle
31
+ - run:
32
+ name: Ensure bundle Install
33
+ command: |
34
+ bundle check || bundle install
35
+ - run:
36
+ name: Create test app
37
+ command: |
38
+ bundle exec rake test_app
39
+ - run:
40
+ name: Run Rspec
41
+ command: |
42
+ TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
43
+ bundle exec rspec --format documentation \
44
+ --format RspecJunitFormatter \
45
+ -o ~/rspec/rspec.xml \
46
+ -- ${TESTFILES}
47
+ - store_test_results:
48
+ path: ~/rspec
49
+ - store_artifacts:
50
+ path: tmp/capybara
51
+
52
+ jobs:
53
+ bundle:
54
+ <<: *defaults
55
+ steps:
56
+ - checkout
57
+ - restore_cache:
58
+ keys:
59
+ - spree-bundle-{{ .Branch }}
60
+ - spree-bundle
61
+ - run:
62
+ name: Add keyserver
63
+ command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
64
+ - run:
65
+ name: Install libvips
66
+ command: sudo apt-get update && sudo apt-get install libvips
67
+ - run:
68
+ name: Set bundle path
69
+ command: bundle config --local path vendor/bundle
70
+ - run:
71
+ name: Bundle Install
72
+ command: |
73
+ bundle check || bundle install
74
+ - save_cache:
75
+ paths:
76
+ - vendor/bundle
77
+ key: spree-bundle-{{ checksum "Gemfile.lock" }}
78
+
79
+ tests_postgres: &tests_postgres
80
+ <<: *run_tests
81
+ environment: &postgres_environment
82
+ <<: *environment
83
+ DB: postgres
84
+ DB_HOST: localhost
85
+ DB_USERNAME: postgres
86
+ docker:
87
+ - image: *ruby_image
88
+ - image: &postgres_image cimg/postgres:16.2
89
+ environment:
90
+ POSTGRES_USER: postgres
91
+
92
+ tests_mysql: &tests_mysql
93
+ <<: *run_tests
94
+ environment: &mysql_environment
95
+ <<: *environment
96
+ DB: mysql
97
+ DB_HOST: 127.0.0.1
98
+ DB_USERNAME: root
99
+ COVERAGE: true
100
+ COVERAGE_DIR: /tmp/workspace/simplecov
101
+ docker:
102
+ - image: *ruby_image
103
+ - image: &mysql_image cimg/mysql:8.0
104
+
105
+ workflows:
106
+ version: 2
107
+ main:
108
+ jobs:
109
+ - bundle
110
+ - tests_postgres:
111
+ requires:
112
+ - bundle
113
+ - tests_mysql:
114
+ requires:
115
+ - bundle
data/.gem-release.yml ADDED
@@ -0,0 +1,2 @@
1
+ bump:
2
+ file: 'lib/spree_gateway/version.rb'
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "bundler" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
data/Gemfile CHANGED
@@ -1,14 +1,22 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ git_source(:github) do |repo_name|
4
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
5
+ "https://github.com/#{repo_name}.git"
6
+ end
7
+
3
8
  gem 'rails-controller-testing'
4
9
  gem 'spree', github: 'spree/spree', branch: 'main'
10
+ gem 'spree_emails', github: 'spree/spree', branch: 'main'
5
11
  gem 'spree_backend', github: 'spree/spree_backend', branch: 'main'
6
- gem 'spree_frontend', github: 'spree/spree_legacy_frontend', branch: 'main'
12
+ gem 'spree_frontend', github: 'spree/spree_rails_frontend', branch: 'main'
7
13
 
8
14
  if ENV['DB'] == 'mysql'
9
15
  gem 'mysql2'
16
+ elsif ENV['DB'] == 'postgres'
17
+ gem 'pg'
10
18
  else
11
- gem 'pg', '~> 1.1'
19
+ gem 'sqlite3', '~> 1.4'
12
20
  end
13
21
 
14
22
  gemspec
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Spree Commerce Inc. and other contributors.
1
+ Copyright (c) 2014-2024 Spree Commerce Inc., Spark Solutions Sp. z o.o. and other contributors.
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -1,5 +1,7 @@
1
1
  module SpreeGateway
2
- def self.version
3
- '3.10.0'
2
+ VERSION = '3.11.0'.freeze
3
+
4
+ def gem_version
5
+ Gem::Version.new(VERSION)
4
6
  end
5
7
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'Admin Panel Stripe elements payment', type: :feature do
3
+ describe 'Admin Panel Stripe elements payment', type: :feature, js: true do
4
4
  stub_authorization!
5
5
 
6
6
  let!(:country) { create(:country, states_required: true) }
@@ -33,7 +33,6 @@ describe 'Admin Panel Stripe elements payment', type: :feature do
33
33
  fill_in_stripe_payment(true)
34
34
 
35
35
  expect(page).to have_content("Credit card Name can't be blank")
36
- expect(page).to have_current_path spree.admin_order_payments_path(order.number)
37
36
  end
38
37
 
39
38
  it 'shows an error with an invalid card number' do
@@ -53,14 +52,8 @@ describe 'Admin Panel Stripe elements payment', type: :feature do
53
52
  it 'shows an error with an invalid card expiration' do
54
53
  fill_in_stripe_payment(false, false, false, true)
55
54
 
56
- if Spree.version.to_f >= 4.1 || Spree.version.to_f >= 3.7
57
- expect(page).to have_content('Credit card Month is not a number')
58
- expect(page).to have_content('Credit card Year is not a number')
59
- expect(page).to have_current_path spree.admin_order_payments_path(order.number)
60
- else
61
- expect(page).to have_content("Your card's expiration year is invalid.")
62
- expect(page).to have_current_path spree.new_admin_order_payment_path(order.number)
63
- end
55
+ expect(page).to have_content('Credit card Month is not a number')
56
+ expect(page).to have_content('Credit card Year is not a number')
64
57
  end
65
58
 
66
59
  def fill_in_stripe_payment(invalid_name = false, invalid_number = false, invalid_code = false, invalid_expiration = false)
@@ -78,18 +71,15 @@ describe 'Admin Panel Stripe elements payment', type: :feature do
78
71
  end
79
72
 
80
73
  def fill_in_card_expiration(invalid_expiration)
81
- valid_expiry = Spree.version.to_f >= 4.2 ? "01/#{Time.current.year + 1}" : "01 / #{Time.current.year + 1}"
82
- invalid_expiry = Spree.version.to_f >= 4.2 ? '01/' : '01 / '
74
+ card_expiry = invalid_expiration ? '01/' : "01/#{Time.current.year + 1}"
83
75
 
84
- card_expiry = invalid_expiration ? invalid_expiry : valid_expiry
85
- fill_in_field('Expiration *', "#card_expiry#{stripe_elements_payment_method.id}", card_expiry)
76
+ find('#card_expiry1').fill_in with: card_expiry
86
77
  end
87
78
 
88
79
  def fill_in_cvc(invalid_code)
89
80
  value = invalid_code ? '1' : '123'
90
- label = Spree.version.to_f >= 4.2 ? 'Card Varification Code (CVC) *' : 'Card Code *'
91
81
 
92
- fill_in label, with: value
82
+ find('#card_code1').fill_in with: value
93
83
  end
94
84
 
95
85
  def fill_in_field(field_name, field_id, number)
@@ -80,7 +80,7 @@ describe Spree::Gateway::BraintreeGateway do
80
80
 
81
81
  describe 'payment profile failure' do
82
82
  before do
83
- country = Spree::Country.default
83
+ country = Spree::Store.default.default_country
84
84
  state = country.states.first
85
85
  address = create(:address,
86
86
  firstname: 'John',
@@ -137,13 +137,15 @@ describe Spree::Gateway::StripeAchGateway do
137
137
  end
138
138
  end
139
139
 
140
- context 'capture with payment class' do
140
+ xcontext 'capture with payment class' do
141
141
  let(:gateway) do
142
142
  gateway = described_class.new(active: true)
143
143
  gateway.set_preference :secret_key, secret_key
144
144
  gateway.stub(:options_for_purchase_or_auth).and_return(['money', 'check', 'opts'])
145
145
  gateway.stub(:provider).and_return provider
146
146
  gateway.stub source_required: true
147
+ gateway.name = 'Stripe ACH'
148
+ gateway.stores = [Spree::Store.default]
147
149
  gateway
148
150
  end
149
151
 
@@ -158,6 +158,7 @@ describe Spree::Gateway::StripeGateway do
158
158
  gateway.stub(:options_for_purchase_or_auth).and_return(['money','cc','opts'])
159
159
  gateway.stub(:provider).and_return provider
160
160
  gateway.stub :source_required => true
161
+ gateway.stores = [Spree::Store.default]
161
162
  gateway
162
163
  end
163
164
 
@@ -7,8 +7,8 @@ require 'spree_gateway/version'
7
7
  Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.name = 'spree_gateway'
10
- s.version = SpreeGateway.version
11
- s.summary = 'Additional Payment Gateways for Spree Commerce'
10
+ s.version = SpreeGateway::VERSION
11
+ s.summary = 'Collection of Payment Gateways for Spree Commerce such as Stripe, Braintree, etc.'
12
12
  s.description = s.summary
13
13
 
14
14
  s.author = 'Spree Commerce'
@@ -28,10 +28,10 @@ Gem::Specification.new do |s|
28
28
  s.require_path = 'lib'
29
29
  s.requirements << 'none'
30
30
 
31
- s.add_dependency 'spree_core', '>= 3.7.0'
31
+ s.add_dependency 'spree_core', '>= 3.7'
32
32
  s.add_dependency 'spree_extension'
33
33
 
34
- s.add_development_dependency 'braintree', '~> 3.0.0'
34
+ s.add_development_dependency 'braintree', '~> 4.20'
35
35
  s.add_development_dependency 'rspec-activemodel-mocks'
36
36
  s.add_development_dependency 'spree_dev_tools'
37
37
  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.10.0
4
+ version: 3.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spree Commerce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-01 00:00:00.000000000 Z
11
+ date: 2024-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.7.0
19
+ version: '3.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.7.0
26
+ version: '3.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_extension
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.0.0
47
+ version: '4.20'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 3.0.0
54
+ version: '4.20'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec-activemodel-mocks
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,17 +80,19 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: Additional Payment Gateways for Spree Commerce
83
+ description: Collection of Payment Gateways for Spree Commerce such as Stripe, Braintree,
84
+ etc.
84
85
  email: gems@spreecommerce.com
85
86
  executables: []
86
87
  extensions: []
87
88
  extra_rdoc_files: []
88
89
  files:
90
+ - ".circleci/config.yml"
91
+ - ".gem-release.yml"
92
+ - ".github/dependabot.yml"
89
93
  - ".gitignore"
90
94
  - ".rspec"
91
- - ".travis.yml"
92
95
  - Gemfile
93
- - Guardfile
94
96
  - LICENSE.md
95
97
  - README.md
96
98
  - Rakefile
@@ -210,9 +212,9 @@ licenses:
210
212
  - BSD-3-Clause
211
213
  metadata:
212
214
  bug_tracker_uri: https://github.com/spree/spree_gateway/issues
213
- changelog_uri: https://github.com/spree/spree_gateway/releases/tag/v3.10.0
215
+ changelog_uri: https://github.com/spree/spree_gateway/releases/tag/v3.11.0
214
216
  documentation_uri: https://guides.spreecommerce.org/
215
- source_code_uri: https://github.com/spree/spree_gateway/tree/v3.10.0
217
+ source_code_uri: https://github.com/spree/spree_gateway/tree/v3.11.0
216
218
  post_install_message:
217
219
  rdoc_options: []
218
220
  require_paths:
@@ -229,10 +231,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
231
  version: '0'
230
232
  requirements:
231
233
  - none
232
- rubygems_version: 3.0.9
234
+ rubygems_version: 3.5.3
233
235
  signing_key:
234
236
  specification_version: 4
235
- summary: Additional Payment Gateways for Spree Commerce
237
+ summary: Collection of Payment Gateways for Spree Commerce such as Stripe, Braintree,
238
+ etc.
236
239
  test_files:
237
240
  - spec/factories/check_factory.rb
238
241
  - spec/features/admin/stripe_elements_payment_spec.rb
data/.travis.yml DELETED
@@ -1,39 +0,0 @@
1
- os: linux
2
- dist: bionic
3
-
4
- cache: bundler
5
-
6
- addons:
7
- apt:
8
- sources:
9
- - google-chrome
10
- packages:
11
- - google-chrome-stable
12
-
13
- services:
14
- - mysql
15
- - postgresql
16
- - redis-server
17
-
18
- language: ruby
19
-
20
- rvm:
21
- - 2.7
22
- - 3.0
23
-
24
- env:
25
- - DB=mysql
26
- - DB=postgres
27
-
28
- before_install:
29
- - mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
30
-
31
- before_script:
32
- - CHROME_MAIN_VERSION=`google-chrome-stable --version | sed -E 's/(^Google Chrome |\.[0-9]+ )//g'`
33
- - CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAIN_VERSION"`
34
- - curl "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" -O
35
- - unzip chromedriver_linux64.zip -d ~/bin
36
-
37
- script:
38
- - bundle exec rake test_app
39
- - bundle exec rake spec
data/Guardfile DELETED
@@ -1,9 +0,0 @@
1
- guard "rspec", cmd: "bundle exec rspec", all_after_pass: false, all_on_start: false do
2
- watch("spec/spec_helper.rb") { "spec" }
3
- watch("config/routes.rb") { "spec/controllers" }
4
- watch(%r{^spec/(.+)_spec\.rb$}) { |m| "spec/#{m[1]}_spec.rb"}
5
- watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
6
- watch(%r{^app/(.*)\.erb$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
7
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
8
- watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb" }
9
- end