Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SSL Issue - Update Specs #215

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 42 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,63 @@
sudo: required
dist: trusty
---
os: linux
dist: bionic

addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable

services:
- mysql
- postgresql

language: ruby

script:
- bundle exec rake test_app
- bundle exec rake spec
rvm:
- 2.5
- 2.6
- 2.7

env:
- DB=mysql
- DB=postgres

addons:
chrome: stable
postgresql: 9.4

rvm:
- 2.3.8
- 2.4.4
- 2.5.1

gemfile:
- gemfiles/spree_3_5.gemfile
- gemfiles/spree_3_7.gemfile
- gemfiles/spree_4_0.gemfile
- gemfiles/spree_4_1.gemfile
- gemfiles/spree_master.gemfile

before_install:
- mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"

matrix:
jobs:
exclude:
- rvm: 2.5.1
gemfile: gemfiles/spree_3_5.gemfile
- rvm: 2.4.4
- rvm: 2.6
gemfile: gemfiles/spree_3_7.gemfile
- rvm: 2.7
gemfile: gemfiles/spree_3_7.gemfile
- rvm: 2.5
gemfile: gemfiles/spree_4_0.gemfile
- rvm: 2.3.8
- rvm: 2.7
gemfile: gemfiles/spree_4_0.gemfile
- rvm: 2.4.4
gemfile: gemfiles/spree_master.gemfile
- rvm: 2.3.8
- rvm: 2.5
gemfile: gemfiles/spree_4_1.gemfile
- rvm: 2.7
gemfile: gemfiles/spree_4_1.gemfile
- rvm: 2.5
gemfile: gemfiles/spree_master.gemfile
allow_failures:
- gemfile: gemfiles/spree_master.gemfile
- gemfile: gemfiles/spree_master.gemfile

before_install:
- mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
- wget -N https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo mv -f ~/chromedriver /usr/local/share/
- sudo chmod +x /usr/local/share/chromedriver
- sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver

before_script:
- CHROME_MAIN_VERSION=`google-chrome-stable --version | sed -E 's/(^Google Chrome |\.[0-9]+ )//g'`
- CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAIN_VERSION"`
- curl "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" -O
- unzip chromedriver_linux64.zip -d ~/bin

script:
- bundle exec rake test_app
- bundle exec rake spec
12 changes: 6 additions & 6 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
appraise 'spree-3-5' do
gem 'spree', '~> 3.5.0'
gem 'rails-controller-testing'
end

appraise 'spree-3-7' do
gem 'spree', '~> 3.7.0'
gem 'rails-controller-testing'
end

appraise 'spree-4-0' do
gem 'spree', '~> 4.0.0.rc2'
gem 'spree', '~> 4.0.0'
gem 'rails-controller-testing'
end

appraise 'spree-4-1' do
gem 'spree', '~> 4.1.0'
gem 'rails-controller-testing'
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SpreePaypalExpress = {
}
}

$(document).ready(function() {
document.addEventListener("DOMContentLoaded", function() {
SpreePaypalExpress.updateSaveAndContinueVisibility();
paymentMethods = $('div[data-hook="checkout_payment_step"] input[type="radio"]').click(function (e) {
SpreePaypalExpress.updateSaveAndContinueVisibility();
Expand Down
12 changes: 7 additions & 5 deletions app/models/spree/gateway/pay_pal_express.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ def provider_class

def provider
::PayPal::SDK.configure(
:mode => preferred_server.present? ? preferred_server : "sandbox",
:username => preferred_login,
:password => preferred_password,
:signature => preferred_signature)
provider_class.new
mode: preferred_server.present? ? preferred_server : "sandbox",
username: preferred_login,
password: preferred_password,
signature: preferred_signature,
ssl_options: { ca_file: nil }
)
provider_class.new
end

def auto_capture?
Expand Down
6 changes: 4 additions & 2 deletions app/views/spree/checkout/payment/_paypal.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
<%= link_to(image_tag("https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif"), paypal_express_url(:payment_method_id => payment_method.id), :method => :post, :id => "paypal_button") %>

<script>
SpreePaypalExpress.paymentMethodID = "<%= payment_method.id %>"
</script>
document.addEventListener("DOMContentLoaded", function() {
SpreePaypalExpress.paymentMethodID = "<%= payment_method.id %>"
})
</script>
4 changes: 2 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ en:
spree:
paypal:
already_refunded: "This payment has been refunded and no further action can be taken on it."
no_payment_via_admin_backend: "You cannot charge PayPal accounts through the admin backend at this time."
no_payment_via_admin_backend: "You cannot charge PayPal accounts through the admin back-end at this time."
transaction: "PayPal Transaction"
payer_id: "Payer ID"
transaction_id: "Transaction ID"
Expand All @@ -18,4 +18,4 @@ en:
flash:
cancel: "Don't want to use PayPal? No problems."
connection_failed: "Could not connect to PayPal."
generic_error: "PayPal failed. %{reasons}"
generic_error: "PayPal failed. %{reasons}"
8 changes: 0 additions & 8 deletions gemfiles/spree_3_5.gemfile

This file was deleted.

10 changes: 5 additions & 5 deletions gemfiles/spree_3_7.gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "spree", "~> 3.7.0"
gem "rails-controller-testing"
gem "sass-rails"
gem 'spree', '~> 3.7.0'
gem 'rails-controller-testing'
gem 'sass-rails'

gemspec path: "../"
gemspec path: '../'
8 changes: 4 additions & 4 deletions gemfiles/spree_4_0.gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "spree", "~> 4.0.0.rc2"
gem "rails-controller-testing"
gem 'spree', '~> 4.0.0'
gem 'rails-controller-testing'

gemspec path: "../"
gemspec path: '../'
8 changes: 8 additions & 0 deletions gemfiles/spree_4_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was generated by Appraisal

source 'https://rubygems.org'

gem 'spree', '~> 4.1.0'
gem 'rails-controller-testing'

gemspec path: '../'
8 changes: 4 additions & 4 deletions gemfiles/spree_master.gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file was generated by Appraisal

source "https://rubygems.org"
source 'https://rubygems.org'

gem "spree", github: "spree/spree", branch: "master"
gem "rails-controller-testing"
gem 'spree', github: 'spree/spree', branch: 'master'
gem 'rails-controller-testing'

gemspec path: "../"
gemspec path: '../'
Loading