spree_gateway 3.9.3 → 3.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -15
- data/Gemfile +9 -1
- data/README.md +2 -2
- data/Rakefile +2 -2
- data/app/models/spree/gateway/stripe_elements_gateway.rb +4 -0
- data/app/models/spree/gateway/stripe_gateway.rb +4 -0
- data/app/models/{spree → spree_gateway}/apple_pay_order_decorator.rb +2 -2
- data/app/models/{spree → spree_gateway}/apple_pay_payment_decorator.rb +2 -2
- data/app/models/{spree → spree_gateway}/credit_card_decorator.rb +2 -2
- data/app/models/{spree → spree_gateway}/order_decorator.rb +2 -2
- data/app/models/{spree → spree_gateway}/payment_decorator.rb +2 -2
- data/config/locales/en.yml +1 -0
- data/config/routes.rb +1 -0
- data/db/migrate/20200317135551_add_spree_check_payment_source.rb +12 -12
- data/db/migrate/20200422114908_add_intent_key_to_payment.rb +1 -1
- data/lib/controllers/spree/api/v2/storefront/intents_controller.rb +18 -0
- data/lib/spree_gateway/engine.rb +4 -1
- data/lib/spree_gateway/version.rb +1 -1
- data/spec/features/admin/stripe_elements_payment_spec.rb +2 -1
- data/spec/features/stripe_checkout_spec.rb +9 -3
- data/spec/features/stripe_elements_3ds_checkout_spec.rb +2 -1
- data/spec/models/gateway/authorize_net_spec.rb +1 -1
- data/spec/models/gateway/balanced_gateway_spec.rb +1 -1
- data/spec/models/gateway/banwire_spec.rb +1 -1
- data/spec/models/gateway/beanstream_spec.rb +1 -1
- data/spec/models/gateway/braintree_gateway_spec.rb +24 -13
- data/spec/models/gateway/card_save_spec.rb +1 -1
- data/spec/models/gateway/{data_cache_spec.rb → data_cash_spec.rb} +1 -1
- data/spec/models/gateway/epay_spec.rb +1 -1
- data/spec/models/gateway/eway_rapid_spec.rb +1 -1
- data/spec/models/gateway/eway_spec.rb +1 -1
- data/spec/models/gateway/moneris_spec.rb +1 -1
- data/spec/models/gateway/pay_junction_spec.rb +1 -1
- data/spec/models/gateway/pay_pal_spec.rb +1 -1
- data/spec/models/gateway/payflow_pro_spec.rb +1 -1
- data/spec/models/gateway/paymill_spec.rb +1 -1
- data/spec/models/gateway/pin_gateway_spec.rb +1 -1
- data/spec/models/gateway/quickpay_spec.rb +1 -1
- data/spec/models/gateway/sage_pay_spec.rb +1 -1
- data/spec/models/gateway/secure_pay_au_spec.rb +1 -1
- data/spec/models/gateway/usa_epay_transaction_spec.rb +2 -2
- data/spec/models/gateway/worldpay_spec.rb +1 -1
- data/spec/models/spree/order_spec.rb +4 -2
- data/spec/requests/spree/api/v2/storefront/intents_controller_spec.rb +198 -0
- data/spree_gateway.gemspec +2 -3
- metadata +16 -29
- data/Appraisals +0 -15
- data/db/migrate/20121017004102_update_braintree_payment_method_type.rb +0 -9
- data/db/migrate/20130213222555_update_stripe_payment_method_type.rb +0 -9
- data/db/migrate/20130415222802_update_balanced_payment_method_type.rb +0 -9
- data/db/migrate/20131008221012_update_paypal_payment_method_type.rb +0 -9
- data/db/migrate/20131112133401_migrate_stripe_preferences.rb +0 -8
- data/gemfiles/spree_3_7.gemfile +0 -9
- data/gemfiles/spree_4_1.gemfile +0 -8
- data/gemfiles/spree_master.gemfile +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 056db537dbbb9403df9df6e2822fa462b9c0b2eac0f880548d7ad9deb93e91c5
|
4
|
+
data.tar.gz: aeb658e8f6abfe36b8b84d45bb819a2cc02510f27010cf6ef059c3ae7fc78e30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9896b8790e3ad9bfd23cd5387fe8718d0e1dcb52edd4dcfce1026fdbe875192bd1287b45613be7a1ec395eeb8279e06817f92d9f45a7ab510dd37b910f27394a
|
7
|
+
data.tar.gz: 3659666f037e516a8ac535d11e5f95d4dcb64f7794e110ddb51b2a8087f699948c0e37c12c0d91bd48ca38633f1ced10dfb31528bbf873bfc09606f4fc994593
|
data/.travis.yml
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
os: linux
|
2
2
|
dist: bionic
|
3
3
|
|
4
|
+
cache: bundler
|
5
|
+
|
4
6
|
addons:
|
5
7
|
apt:
|
6
8
|
sources:
|
@@ -11,6 +13,7 @@ addons:
|
|
11
13
|
services:
|
12
14
|
- mysql
|
13
15
|
- postgresql
|
16
|
+
- redis-server
|
14
17
|
|
15
18
|
language: ruby
|
16
19
|
|
@@ -22,20 +25,6 @@ env:
|
|
22
25
|
- DB=mysql
|
23
26
|
- DB=postgres
|
24
27
|
|
25
|
-
gemfile:
|
26
|
-
- gemfiles/spree_3_7.gemfile
|
27
|
-
- gemfiles/spree_4_1.gemfile
|
28
|
-
- gemfiles/spree_master.gemfile
|
29
|
-
|
30
|
-
jobs:
|
31
|
-
allow_failures:
|
32
|
-
- gemfile: gemfiles/spree_master.gemfile
|
33
|
-
exclude:
|
34
|
-
- rvm: 3.0
|
35
|
-
gemfile: gemfiles/spree_4_1.gemfile
|
36
|
-
- rvm: 3.0
|
37
|
-
gemfile: gemfiles/spree_3_7.gemfile
|
38
|
-
|
39
28
|
before_install:
|
40
29
|
- mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
|
41
30
|
|
@@ -47,4 +36,4 @@ before_script:
|
|
47
36
|
|
48
37
|
script:
|
49
38
|
- bundle exec rake test_app
|
50
|
-
- bundle exec rake spec
|
39
|
+
- bundle exec rake spec
|
data/Gemfile
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gem 'rails-controller-testing'
|
4
|
-
gem 'spree', github: 'spree/spree', branch: '
|
4
|
+
gem 'spree', github: 'spree/spree', branch: 'main'
|
5
|
+
gem 'spree_backend', github: 'spree/spree_backend', branch: 'main'
|
6
|
+
gem 'spree_frontend', github: 'spree/spree_legacy_frontend', branch: 'main'
|
7
|
+
|
8
|
+
if ENV['DB'] == 'mysql'
|
9
|
+
gem 'mysql2'
|
10
|
+
else
|
11
|
+
gem 'pg', '~> 1.1'
|
12
|
+
end
|
5
13
|
|
6
14
|
gemspec
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Spree Gateway
|
2
2
|
|
3
|
-
[![Build Status](https://api.travis-ci.org/spree/spree_gateway.svg?branch=
|
3
|
+
[![Build Status](https://api.travis-ci.org/spree/spree_gateway.svg?branch=main)](https://travis-ci.org/spree/spree_gateway)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/spree/spree_gateway.svg)](https://codeclimate.com/github/spree/spree_gateway)
|
5
5
|
|
6
6
|
Community supported Spree Payment Method Gateways. It works as a wrapper for
|
@@ -100,6 +100,6 @@ We are [available for hire][spark].
|
|
100
100
|
|
101
101
|
[1]: http://www.fsf.org/licensing/essays/free-sw.html
|
102
102
|
[2]: https://github.com/spree/spree_gateway/issues
|
103
|
-
[3]: https://github.com/spree/spree_gateway/blob/
|
103
|
+
[3]: https://github.com/spree/spree_gateway/blob/main/LICENSE.md
|
104
104
|
[4]: https://github.com/spree
|
105
105
|
[5]: https://github.com/spree/spree_gateway/graphs/contributors
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'bundler'
|
|
2
2
|
Bundler::GemHelper.install_tasks
|
3
3
|
|
4
4
|
require 'rspec/core/rake_task'
|
5
|
-
require 'spree/testing_support/
|
5
|
+
require 'spree/testing_support/extension_rake'
|
6
6
|
|
7
7
|
RSpec::Core::RakeTask.new
|
8
8
|
|
@@ -11,5 +11,5 @@ task :default => [:spec]
|
|
11
11
|
desc "Generates a dummy app for testing"
|
12
12
|
task :test_app do
|
13
13
|
ENV['LIB_NAME'] = 'spree_gateway'
|
14
|
-
Rake::Task['
|
14
|
+
Rake::Task['extension:test_app'].invoke
|
15
15
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SpreeGateway
|
2
2
|
module ApplePayOrderDecorator
|
3
3
|
def confirmation_required?
|
4
4
|
return false if paid_with_apple_pay?
|
@@ -17,4 +17,4 @@ module Spree
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
Spree::Order.prepend
|
20
|
+
::Spree::Order.prepend(::SpreeGateway::ApplePayOrderDecorator)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SpreeGateway
|
2
2
|
module ApplePayPaymentDecorator
|
3
3
|
def apple_pay?
|
4
4
|
payment_method.is_a? Spree::Gateway::StripeApplePayGateway
|
@@ -6,4 +6,4 @@ module Spree
|
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
-
Spree::Payment.prepend
|
9
|
+
::Spree::Payment.prepend(::SpreeGateway::ApplePayPaymentDecorator)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SpreeGateway
|
2
2
|
module CreditCardDecorator
|
3
3
|
def set_last_digits
|
4
4
|
self.last_digits ||= number.to_s.length <= 4 ? number : number.to_s.slice(-4..-1)
|
@@ -7,4 +7,4 @@ module Spree
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
-
::Spree::CreditCard.prepend(::
|
10
|
+
::Spree::CreditCard.prepend(::SpreeGateway::CreditCardDecorator)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SpreeGateway
|
2
2
|
module OrderDecorator
|
3
3
|
def self.prepended(base)
|
4
4
|
return if base.checkout_steps.key?(:payment_confirm)
|
@@ -25,4 +25,4 @@ module Spree
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
Spree::Order.prepend(
|
28
|
+
::Spree::Order.prepend(::SpreeGateway::OrderDecorator)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SpreeGateway
|
2
2
|
module PaymentDecorator
|
3
3
|
def handle_response(response, success_state, failure_state)
|
4
4
|
if response.success? && response.respond_to?(:params)
|
@@ -33,4 +33,4 @@ module Spree
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
Spree::Payment.prepend(
|
36
|
+
::Spree::Payment.prepend(::SpreeGateway::PaymentDecorator)
|
data/config/locales/en.yml
CHANGED
@@ -12,6 +12,7 @@ en:
|
|
12
12
|
payment_has_been_cancelled: The payment has been cancelled.
|
13
13
|
please_wait_for_confirmation_popup: Please wait for payment confirmation popup to appear.
|
14
14
|
payment_successfully_authorized: The payment was successfully authorized.
|
15
|
+
no_payment_authorization_needed: Payment autorization not needed.
|
15
16
|
order_state:
|
16
17
|
payment_confirm: Verify payment
|
17
18
|
log_entry:
|
data/config/routes.rb
CHANGED
@@ -3,19 +3,19 @@ class AddSpreeCheckPaymentSource < ActiveRecord::Migration[5.1]
|
|
3
3
|
create_table :spree_checks do |t|
|
4
4
|
t.references :payment_method
|
5
5
|
t.references :user
|
6
|
-
t.string
|
7
|
-
t.string
|
8
|
-
t.string
|
9
|
-
t.string
|
10
|
-
t.string
|
11
|
-
t.string
|
12
|
-
t.string
|
13
|
-
t.string
|
14
|
-
t.string
|
6
|
+
t.string 'account_holder_name'
|
7
|
+
t.string 'account_holder_type'
|
8
|
+
t.string 'routing_number'
|
9
|
+
t.string 'account_number'
|
10
|
+
t.string 'account_type', default: 'checking'
|
11
|
+
t.string 'status'
|
12
|
+
t.string 'last_digits'
|
13
|
+
t.string 'gateway_customer_profile_id'
|
14
|
+
t.string 'gateway_payment_profile_id'
|
15
15
|
|
16
|
-
t.datetime
|
17
|
-
t.datetime
|
18
|
-
t.datetime
|
16
|
+
t.datetime 'created_at', null: false
|
17
|
+
t.datetime 'updated_at', null: false
|
18
|
+
t.datetime 'deleted_at'
|
19
19
|
end
|
20
20
|
add_index :spree_payment_methods, :id
|
21
21
|
end
|
@@ -5,6 +5,24 @@ module Spree
|
|
5
5
|
class IntentsController < ::Spree::Api::V2::BaseController
|
6
6
|
include Spree::Api::V2::Storefront::OrderConcern
|
7
7
|
|
8
|
+
def payment_confirmation_data
|
9
|
+
spree_authorize! :update, spree_current_order, order_token
|
10
|
+
|
11
|
+
if spree_current_order.intents?
|
12
|
+
spree_current_order.process_payments!
|
13
|
+
spree_current_order.reload
|
14
|
+
last_valid_payment = spree_current_order.payments.valid.where.not(intent_client_key: nil).last
|
15
|
+
|
16
|
+
if last_valid_payment.present?
|
17
|
+
client_secret = last_valid_payment.intent_client_key
|
18
|
+
publishable_key = last_valid_payment.payment_method&.preferred_publishable_key
|
19
|
+
return render json: { client_secret: client_secret, pk_key: publishable_key }, status: :ok
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
render_error_payload(I18n.t('spree.no_payment_authorization_needed'))
|
24
|
+
end
|
25
|
+
|
8
26
|
def handle_response
|
9
27
|
if params['response']['error']
|
10
28
|
invalidate_payment
|
data/lib/spree_gateway/engine.rb
CHANGED
@@ -4,7 +4,7 @@ module SpreeGateway
|
|
4
4
|
|
5
5
|
config.autoload_paths += %W(#{config.root}/lib)
|
6
6
|
|
7
|
-
|
7
|
+
config.after_initialize do |app|
|
8
8
|
app.config.spree.payment_methods << Spree::Gateway::AuthorizeNet
|
9
9
|
app.config.spree.payment_methods << Spree::Gateway::AuthorizeNetCim
|
10
10
|
app.config.spree.payment_methods << Spree::Gateway::BalancedGateway
|
@@ -41,6 +41,9 @@ module SpreeGateway
|
|
41
41
|
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/spree/*_decorator*.rb')) do |c|
|
42
42
|
Rails.application.config.cache_classes ? require(c) : load(c)
|
43
43
|
end
|
44
|
+
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/spree_gateway/*_decorator*.rb')) do |c|
|
45
|
+
Rails.application.config.cache_classes ? require(c) : load(c)
|
46
|
+
end
|
44
47
|
Dir.glob(File.join(File.dirname(__FILE__), '../../lib/active_merchant/**/*_decorator*.rb')) do |c|
|
45
48
|
Rails.application.config.cache_classes ? require(c) : load(c)
|
46
49
|
end
|
@@ -13,7 +13,8 @@ describe 'Admin Panel Stripe elements payment', type: :feature do
|
|
13
13
|
Spree::Gateway::StripeElementsGateway.create!(
|
14
14
|
name: 'Stripe Element',
|
15
15
|
preferred_secret_key: 'sk_test_VCZnDv3GLU15TRvn8i2EsaAN',
|
16
|
-
preferred_publishable_key: 'pk_test_Cuf0PNtiAkkMpTVC2gwYDMIg'
|
16
|
+
preferred_publishable_key: 'pk_test_Cuf0PNtiAkkMpTVC2gwYDMIg',
|
17
|
+
stores: [::Spree::Store.default]
|
17
18
|
)
|
18
19
|
end
|
19
20
|
|
@@ -8,15 +8,21 @@ describe "Stripe checkout", type: :feature, js: true do
|
|
8
8
|
let!(:mug) { create(:product, :name => "RoR Mug") }
|
9
9
|
let!(:stripe_payment_method) do
|
10
10
|
Spree::Gateway::StripeGateway.create!(
|
11
|
-
:
|
12
|
-
:
|
13
|
-
:
|
11
|
+
name: 'Stripe',
|
12
|
+
preferred_secret_key: 'sk_test_VCZnDv3GLU15TRvn8i2EsaAN',
|
13
|
+
preferred_publishable_key: 'pk_test_Cuf0PNtiAkkMpTVC2gwYDMIg',
|
14
|
+
stores: [::Spree::Store.default]
|
14
15
|
)
|
15
16
|
end
|
16
17
|
|
17
18
|
let!(:zone) { create(:zone) }
|
18
19
|
|
19
20
|
before do
|
21
|
+
if Spree.version.to_f >= 4.2
|
22
|
+
payment_method = Spree::PaymentMethod.first
|
23
|
+
payment_method.update!(stores: [Spree::Store.first])
|
24
|
+
end
|
25
|
+
|
20
26
|
user = create(:user)
|
21
27
|
|
22
28
|
order = OrderWalkthrough.up_to(:delivery)
|
@@ -9,7 +9,8 @@ describe 'Stripe Elements 3ds checkout', type: :feature, js: true do
|
|
9
9
|
name: 'Stripe',
|
10
10
|
preferred_secret_key: 'sk_test_VCZnDv3GLU15TRvn8i2EsaAN',
|
11
11
|
preferred_publishable_key: 'pk_test_Cuf0PNtiAkkMpTVC2gwYDMIg',
|
12
|
-
preferred_intents: preferred_intents
|
12
|
+
preferred_intents: preferred_intents,
|
13
|
+
stores: [::Spree::Store.default]
|
13
14
|
)
|
14
15
|
end
|
15
16
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::AuthorizeNet do
|
4
|
-
let (:gateway) { described_class.create!(name: 'Authorize.net') }
|
4
|
+
let (:gateway) { described_class.create!(name: 'Authorize.net', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a AuthorizeNet gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::BalancedGateway do
|
4
|
-
let(:gateway) { described_class.create!(name: 'Balanced') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'Balanced', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a Balanced gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::Banwire do
|
4
|
-
let(:gateway) { described_class.create!(name: 'Banwire') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'Banwire', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a Banwire gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::Beanstream do
|
4
|
-
let(:gateway) { described_class.create!(name: 'Beanstream') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'Beanstream', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a Beanstream gateway' do
|
@@ -2,13 +2,24 @@ require 'spec_helper'
|
|
2
2
|
require 'pry'
|
3
3
|
|
4
4
|
describe Spree::Gateway::BraintreeGateway do
|
5
|
-
let!(:country) { create(:country, name: 'United States', iso_name: 'UNITED STATES', iso3: 'USA', iso: 'US', numcode: 840) }
|
6
|
-
let!(:state) { create(:state, name: 'Maryland', abbr: 'MD', country: country) }
|
7
|
-
let!(:address) { create(:address, firstname: 'John', lastname: 'Doe', address1: '1234 My Street', address2: 'Apt 1', city: 'Washington DC', zipcode: '20123', phone: '(555)555-5555', state: state, country: country) }
|
8
|
-
|
9
5
|
before do
|
6
|
+
country = Spree::Country.find_by(name: 'United States of America')
|
7
|
+
country.update(name: 'United States', iso_name: 'UNITED STATES', iso3: 'USA', iso: 'US', numcode: 840)
|
8
|
+
state = create(:state, name: 'Maryland', abbr: 'MD', country: country)
|
9
|
+
@address = create(:address,
|
10
|
+
firstname: 'John',
|
11
|
+
lastname: 'Doe',
|
12
|
+
address1: '1234 My Street',
|
13
|
+
address2: 'Apt 1',
|
14
|
+
city: 'Washington DC',
|
15
|
+
zipcode: '20123',
|
16
|
+
phone: '(555)555-5555',
|
17
|
+
state: state,
|
18
|
+
country: country)
|
19
|
+
|
20
|
+
|
10
21
|
Spree::Gateway.update_all(active: false)
|
11
|
-
@gateway = Spree::Gateway::BraintreeGateway.create!(name: 'Braintree Gateway', active: true)
|
22
|
+
@gateway = Spree::Gateway::BraintreeGateway.create!(name: 'Braintree Gateway', active: true, stores: [::Spree::Store.default])
|
12
23
|
@gateway.preferences = {
|
13
24
|
environment: 'sandbox',
|
14
25
|
merchant_id: 'zbn5yzq9t7wmwx42',
|
@@ -18,7 +29,7 @@ describe Spree::Gateway::BraintreeGateway do
|
|
18
29
|
@gateway.save!
|
19
30
|
|
20
31
|
with_payment_profiles_off do
|
21
|
-
order = create(:order_with_totals, bill_address: address, ship_address: address)
|
32
|
+
order = create(:order_with_totals, bill_address: @address, ship_address: @address)
|
22
33
|
order.update_with_updater!
|
23
34
|
|
24
35
|
# Use a valid CC from braintree sandbox: https://www.braintreepayments.com/docs/ruby/reference/sandbox
|
@@ -37,7 +48,7 @@ describe Spree::Gateway::BraintreeGateway do
|
|
37
48
|
|
38
49
|
describe 'payment profile creation' do
|
39
50
|
before do
|
40
|
-
order = create(:order_with_totals, bill_address: address, ship_address: address)
|
51
|
+
order = create(:order_with_totals, bill_address: @address, ship_address: @address)
|
41
52
|
order.update_with_updater!
|
42
53
|
|
43
54
|
@credit_card = create(:credit_card,
|
@@ -56,12 +67,12 @@ describe Spree::Gateway::BraintreeGateway do
|
|
56
67
|
remote_customer = @gateway.provider.instance_variable_get(:@braintree_gateway).customer.find(@credit_card.gateway_customer_profile_id)
|
57
68
|
remote_address = remote_customer.addresses.first rescue nil
|
58
69
|
expect(remote_address).not_to be_nil
|
59
|
-
expect(remote_address.street_address).to eq(address.address1)
|
60
|
-
expect(remote_address.extended_address).to eq(address.address2)
|
61
|
-
expect(remote_address.locality).to eq(address.city)
|
62
|
-
expect(remote_address.region).to eq(address.state.name)
|
63
|
-
expect(remote_address.country_code_alpha2).to eq(address.country.iso)
|
64
|
-
expect(remote_address.postal_code).to eq(address.zipcode)
|
70
|
+
expect(remote_address.street_address).to eq(@address.address1)
|
71
|
+
expect(remote_address.extended_address).to eq(@address.address2)
|
72
|
+
expect(remote_address.locality).to eq(@address.city)
|
73
|
+
expect(remote_address.region).to eq(@address.state.name)
|
74
|
+
expect(remote_address.country_code_alpha2).to eq(@address.country.iso)
|
75
|
+
expect(remote_address.postal_code).to eq(@address.zipcode)
|
65
76
|
end
|
66
77
|
end
|
67
78
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::CardSave do
|
4
|
-
let(:gateway) { described_class.create!(name: 'CardSave') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'CardSave', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a CardSave gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::DataCash do
|
4
|
-
let(:gateway) { described_class.create!(name: 'DataCash') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'DataCash', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a DataCash gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::Epay do
|
4
|
-
let(:gateway) { described_class.create!(name: 'Epay') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'Epay', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a Epay gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::EwayRapid do
|
4
|
-
let(:gateway) { described_class.create!(name: 'eWAY Rapid') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'eWAY Rapid', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
describe '#provider_class' do
|
7
7
|
it 'should be an eWAY Rapid gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::Eway do
|
4
|
-
let(:gateway) { described_class.create!(name: 'Eway') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'Eway', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a Eway gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::Moneris do
|
4
|
-
let(:gateway) { described_class.create!(name: 'Moneris') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'Moneris', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a Moneris gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::PayJunction do
|
4
|
-
let(:gateway) { described_class.create!(name: 'PayJunction') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'PayJunction', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a PayJunction gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::PayPalGateway do
|
4
|
-
let(:gateway) { described_class.create!(name: 'PayPal') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'PayPal', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a PayPal gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::PayflowPro do
|
4
|
-
let(:gateway) { described_class.create!(name: 'PayflowPro') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'PayflowPro', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a Payflow gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::Paymill do
|
4
|
-
let(:gateway) { described_class.create!(name: 'Paymill') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'Paymill', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a Paymill gateway' do
|
@@ -4,7 +4,7 @@ describe Spree::Gateway::PinGateway do
|
|
4
4
|
|
5
5
|
before do
|
6
6
|
Spree::Gateway.update_all(active: false)
|
7
|
-
@gateway = described_class.create!(name: 'Pin Gateway', active: true)
|
7
|
+
@gateway = described_class.create!(name: 'Pin Gateway', active: true, stores: [::Spree::Store.default])
|
8
8
|
@gateway.set_preference(:api_key, 'W_VzkRCZSILiKWUS-dndUg')
|
9
9
|
@gateway.save!
|
10
10
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::Quickpay do
|
4
|
-
let(:gateway) { described_class.create!(name: 'QuickpayGateway') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'QuickpayGateway', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a Quickpay gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::SagePay do
|
4
|
-
let(:gateway) { described_class.create!(name: 'SagePay') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'SagePay', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a SagePay gateway' do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::SecurePayAU do
|
4
|
-
let(:gateway) { described_class.create!(name: 'SecurePayAU') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'SecurePayAU', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a SecurePayAU gateway' do
|
@@ -3,11 +3,11 @@ require 'spec_helper'
|
|
3
3
|
describe Spree::Gateway::UsaEpayTransaction do
|
4
4
|
before do
|
5
5
|
Spree::Gateway.update_all(active: false)
|
6
|
-
@gateway = Spree::Gateway::UsaEpayTransaction.create!(name: 'USA EPay Gateway', active: true)
|
6
|
+
@gateway = Spree::Gateway::UsaEpayTransaction.create!(name: 'USA EPay Gateway', active: true, stores: [::Spree::Store.default])
|
7
7
|
@gateway.set_preference(:login, '0r19zQBdp5nS8i3t4hFxz0di13yf56q1')
|
8
8
|
@gateway.save!
|
9
9
|
|
10
|
-
country =
|
10
|
+
country = Spree::Country.find_by(name: 'United States of America')
|
11
11
|
state = create(:state, name: 'Maryland', abbr: 'MD', country: country)
|
12
12
|
address = create(:address,
|
13
13
|
firstname: 'John',
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Spree::Gateway::Worldpay do
|
4
|
-
let(:gateway) { described_class.create!(name: 'Worldpay') }
|
4
|
+
let(:gateway) { described_class.create!(name: 'Worldpay', stores: [::Spree::Store.default]) }
|
5
5
|
|
6
6
|
context '.provider_class' do
|
7
7
|
it 'is a Worldpay gateway' do
|
@@ -6,14 +6,16 @@ describe Spree::Order do
|
|
6
6
|
let(:stripe_apple_pay_payment_method) do
|
7
7
|
Spree::Gateway::StripeApplePayGateway.create!(
|
8
8
|
name: 'ApplePay',
|
9
|
-
preferred_domain_verification_certificate: FFaker::Lorem.characters(20)
|
9
|
+
preferred_domain_verification_certificate: FFaker::Lorem.characters(20),
|
10
|
+
stores: [::Spree::Store.default]
|
10
11
|
)
|
11
12
|
end
|
12
13
|
let(:stripe_credit_card_payment_method) do
|
13
14
|
Spree::Gateway::StripeGateway.create!(
|
14
15
|
name: 'CreditCard',
|
15
16
|
preferred_secret_key: FFaker::Lorem.characters(20),
|
16
|
-
preferred_publishable_key: FFaker::Lorem.characters(20)
|
17
|
+
preferred_publishable_key: FFaker::Lorem.characters(20),
|
18
|
+
stores: [::Spree::Store.default]
|
17
19
|
)
|
18
20
|
end
|
19
21
|
|
@@ -0,0 +1,198 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Api V2 Storefront Intents Spec', type: :request do
|
4
|
+
let!(:store) { Spree::Store.default }
|
5
|
+
let(:currency) { store.default_currency }
|
6
|
+
let(:user) { create(:user) }
|
7
|
+
let(:order) { create(:order, user: user, store: store, currency: currency) }
|
8
|
+
|
9
|
+
include_context 'API v2 tokens'
|
10
|
+
|
11
|
+
describe '#payment_confirmation_data' do
|
12
|
+
subject :post_payment_confirmation_data do
|
13
|
+
post '/api/v2/storefront/intents/payment_confirmation_data', headers: headers, params: params
|
14
|
+
end
|
15
|
+
|
16
|
+
include_context 'API v2 tokens'
|
17
|
+
|
18
|
+
context 'when user is authorized' do
|
19
|
+
let(:params) { {} }
|
20
|
+
let(:headers) { headers_bearer.merge(headers_order_token) }
|
21
|
+
|
22
|
+
context 'when current order has payment intent' do
|
23
|
+
let(:provider) do
|
24
|
+
double('provider').tap do |p|
|
25
|
+
p.stub(:purchase)
|
26
|
+
p.stub(:authorize)
|
27
|
+
p.stub(:capture)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
let(:gateway) do
|
31
|
+
gateway = Spree::Gateway::StripeElementsGateway.new(active: true)
|
32
|
+
gateway.set_preference :secret_key, 'secret_key'
|
33
|
+
gateway.set_preference :intents, 'true'
|
34
|
+
gateway.name = 'Stripe Elements'
|
35
|
+
gateway.stores << order.store
|
36
|
+
allow(gateway).to receive(:options_for_purchase_or_auth).and_return ['money','cc','opts']
|
37
|
+
allow(gateway).to receive_messages provider: provider
|
38
|
+
allow(gateway).to receive_messages source_required: true
|
39
|
+
allow(gateway).to receive_messages create_profile: true
|
40
|
+
gateway
|
41
|
+
end
|
42
|
+
let!(:payment) do
|
43
|
+
create(:payment,
|
44
|
+
source: create(:credit_card),
|
45
|
+
order: order,
|
46
|
+
payment_method: gateway,
|
47
|
+
state: 'pending',
|
48
|
+
intent_client_key: intent_client_key)
|
49
|
+
end
|
50
|
+
|
51
|
+
before { post_payment_confirmation_data }
|
52
|
+
|
53
|
+
context 'when last valid payment has intent client key' do
|
54
|
+
let(:intent_client_key) { 'intent_client_key' }
|
55
|
+
|
56
|
+
it_behaves_like 'returns 200 HTTP status'
|
57
|
+
end
|
58
|
+
|
59
|
+
context 'when last valid payment does not have intent client key' do
|
60
|
+
let(:intent_client_key) { nil }
|
61
|
+
|
62
|
+
it_behaves_like 'returns 422 HTTP status'
|
63
|
+
|
64
|
+
it 'includes valid response message' do
|
65
|
+
expect(response.body).to include I18n.t('spree.no_payment_authorization_needed')
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
context 'when current order has completed payments' do
|
70
|
+
let(:order) { create(:order_ready_to_ship, user: user, store: store, currency: currency) }
|
71
|
+
let(:intent_client_key) { 'intent_client_key' }
|
72
|
+
|
73
|
+
it_behaves_like 'returns 403 HTTP status'
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
context 'when current order does not have payment intent' do
|
78
|
+
before { post_payment_confirmation_data }
|
79
|
+
|
80
|
+
it_behaves_like 'returns 422 HTTP status'
|
81
|
+
|
82
|
+
it 'includes valid response message' do
|
83
|
+
expect(response.body).to include I18n.t('spree.no_payment_authorization_needed')
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
context 'when some authorization data is missing' do
|
89
|
+
let(:params) { {} }
|
90
|
+
let(:headers) { {} }
|
91
|
+
|
92
|
+
before { post_payment_confirmation_data }
|
93
|
+
|
94
|
+
it_behaves_like 'returns 403 HTTP status'
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
describe '#handle_response' do
|
99
|
+
subject :post_handle_response do
|
100
|
+
post '/api/v2/storefront/intents/handle_response', headers: headers, params: params
|
101
|
+
end
|
102
|
+
|
103
|
+
let(:headers) { headers_bearer.merge(headers_order_token) }
|
104
|
+
let(:provider) do
|
105
|
+
double('provider').tap do |p|
|
106
|
+
p.stub(:purchase)
|
107
|
+
p.stub(:authorize)
|
108
|
+
p.stub(:capture)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
let(:gateway) do
|
112
|
+
gateway = Spree::Gateway::StripeElementsGateway.new(active: true)
|
113
|
+
gateway.set_preference :secret_key, 'secret_key'
|
114
|
+
gateway.set_preference :intents, 'true'
|
115
|
+
gateway.name = 'Stripe Elements'
|
116
|
+
gateway.stores << order.store
|
117
|
+
allow(gateway).to receive(:options_for_purchase_or_auth).and_return ['money','cc','opts']
|
118
|
+
allow(gateway).to receive_messages provider: provider
|
119
|
+
allow(gateway).to receive_messages source_required: true
|
120
|
+
allow(gateway).to receive_messages create_profile: true
|
121
|
+
gateway
|
122
|
+
end
|
123
|
+
let!(:payment) do
|
124
|
+
create(:payment,
|
125
|
+
source: create(:credit_card),
|
126
|
+
order: order,
|
127
|
+
payment_method: gateway,
|
128
|
+
state: 'pending',
|
129
|
+
intent_client_key: 'intent_client_key')
|
130
|
+
end
|
131
|
+
|
132
|
+
include_context 'API v2 tokens'
|
133
|
+
|
134
|
+
context 'when response param does not include errors' do
|
135
|
+
let(:params) do
|
136
|
+
{
|
137
|
+
response: {
|
138
|
+
message: 'everything is ok'
|
139
|
+
}
|
140
|
+
}
|
141
|
+
end
|
142
|
+
|
143
|
+
before { post_handle_response }
|
144
|
+
|
145
|
+
it_behaves_like 'returns 200 HTTP status'
|
146
|
+
|
147
|
+
it 'includes valid response message' do
|
148
|
+
expect(response.body).to include I18n.t('spree.payment_successfully_authorized')
|
149
|
+
end
|
150
|
+
|
151
|
+
it 'does not update payment' do
|
152
|
+
expect { post_handle_response }.not_to change { payment }
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
context 'when response param includes errors' do
|
157
|
+
let(:payment_response_code) { payment.response_code }
|
158
|
+
let(:params) do
|
159
|
+
{
|
160
|
+
response: {
|
161
|
+
error: {
|
162
|
+
payment_intent: {
|
163
|
+
id: payment_response_code
|
164
|
+
},
|
165
|
+
message: 'something went wrong'
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
end
|
170
|
+
|
171
|
+
before { post_handle_response }
|
172
|
+
|
173
|
+
it_behaves_like 'returns 422 HTTP status'
|
174
|
+
|
175
|
+
context 'when payment to invalidate is found' do
|
176
|
+
it 'changes payment state to failed' do
|
177
|
+
expect(payment.state).not_to eq 'failed'
|
178
|
+
expect(payment.reload.state).to eq 'failed'
|
179
|
+
end
|
180
|
+
|
181
|
+
it 'clears payment intent_client_key' do
|
182
|
+
expect(payment.intent_client_key).not_to be nil
|
183
|
+
expect(payment.reload.intent_client_key).to be nil
|
184
|
+
end
|
185
|
+
|
186
|
+
it 'includes valid response message' do
|
187
|
+
expect(response.body).to include params[:response][:error][:message]
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
context 'when payment to invalidate is not found' do
|
192
|
+
let(:payment_response_code) { 'unexisting response code' }
|
193
|
+
|
194
|
+
it_behaves_like 'returns 404 HTTP status'
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
data/spree_gateway.gemspec
CHANGED
@@ -28,11 +28,10 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.require_path = 'lib'
|
29
29
|
s.requirements << 'none'
|
30
30
|
|
31
|
-
|
32
|
-
s.add_dependency 'spree_core', spree_version
|
31
|
+
s.add_dependency 'spree_core', '>= 3.7.0'
|
33
32
|
s.add_dependency 'spree_extension'
|
34
33
|
|
35
|
-
s.add_development_dependency 'braintree', '~>
|
34
|
+
s.add_development_dependency 'braintree', '~> 3.0.0'
|
36
35
|
s.add_development_dependency 'rspec-activemodel-mocks'
|
37
36
|
s.add_development_dependency 'spree_dev_tools'
|
38
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.
|
4
|
+
version: 3.10.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:
|
11
|
+
date: 2022-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.7.0
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '5.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +24,6 @@ dependencies:
|
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 3.7.0
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '5.0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: spree_extension
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,14 +44,14 @@ dependencies:
|
|
50
44
|
requirements:
|
51
45
|
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
47
|
+
version: 3.0.0
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
51
|
requirements:
|
58
52
|
- - "~>"
|
59
53
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
54
|
+
version: 3.0.0
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
56
|
name: rspec-activemodel-mocks
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,17 +89,13 @@ files:
|
|
95
89
|
- ".gitignore"
|
96
90
|
- ".rspec"
|
97
91
|
- ".travis.yml"
|
98
|
-
- Appraisals
|
99
92
|
- Gemfile
|
100
93
|
- Guardfile
|
101
94
|
- LICENSE.md
|
102
95
|
- README.md
|
103
96
|
- Rakefile
|
104
|
-
- app/models/spree/apple_pay_order_decorator.rb
|
105
|
-
- app/models/spree/apple_pay_payment_decorator.rb
|
106
97
|
- app/models/spree/billing_integration.rb
|
107
98
|
- app/models/spree/check.rb
|
108
|
-
- app/models/spree/credit_card_decorator.rb
|
109
99
|
- app/models/spree/gateway/authorize_net.rb
|
110
100
|
- app/models/spree/gateway/authorize_net_cim.rb
|
111
101
|
- app/models/spree/gateway/balanced_gateway.rb
|
@@ -136,8 +126,11 @@ files:
|
|
136
126
|
- app/models/spree/gateway/stripe_gateway.rb
|
137
127
|
- app/models/spree/gateway/usa_epay_transaction.rb
|
138
128
|
- app/models/spree/gateway/worldpay.rb
|
139
|
-
- app/models/
|
140
|
-
- app/models/
|
129
|
+
- app/models/spree_gateway/apple_pay_order_decorator.rb
|
130
|
+
- app/models/spree_gateway/apple_pay_payment_decorator.rb
|
131
|
+
- app/models/spree_gateway/credit_card_decorator.rb
|
132
|
+
- app/models/spree_gateway/order_decorator.rb
|
133
|
+
- app/models/spree_gateway/payment_decorator.rb
|
141
134
|
- app/views/spree/checkout/_payment_confirm.html.erb
|
142
135
|
- config/initializers/inflections.rb
|
143
136
|
- config/initializers/spree_permitted_attributes.rb
|
@@ -146,16 +139,8 @@ files:
|
|
146
139
|
- config/locales/en.yml
|
147
140
|
- config/locales/sv.yml
|
148
141
|
- config/routes.rb
|
149
|
-
- db/migrate/20121017004102_update_braintree_payment_method_type.rb
|
150
|
-
- db/migrate/20130213222555_update_stripe_payment_method_type.rb
|
151
|
-
- db/migrate/20130415222802_update_balanced_payment_method_type.rb
|
152
|
-
- db/migrate/20131008221012_update_paypal_payment_method_type.rb
|
153
|
-
- db/migrate/20131112133401_migrate_stripe_preferences.rb
|
154
142
|
- db/migrate/20200317135551_add_spree_check_payment_source.rb
|
155
143
|
- db/migrate/20200422114908_add_intent_key_to_payment.rb
|
156
|
-
- gemfiles/spree_3_7.gemfile
|
157
|
-
- gemfiles/spree_4_1.gemfile
|
158
|
-
- gemfiles/spree_master.gemfile
|
159
144
|
- lib/active_merchant/billing/stripe_gateway_decorator.rb
|
160
145
|
- lib/controllers/spree/api/v2/storefront/intents_controller.rb
|
161
146
|
- lib/controllers/spree/apple_pay_domain_verification_controller.rb
|
@@ -194,7 +179,7 @@ files:
|
|
194
179
|
- spec/models/gateway/braintree_gateway_spec.rb
|
195
180
|
- spec/models/gateway/card_save_spec.rb
|
196
181
|
- spec/models/gateway/cyber_source_spec.rb
|
197
|
-
- spec/models/gateway/
|
182
|
+
- spec/models/gateway/data_cash_spec.rb
|
198
183
|
- spec/models/gateway/epay_spec.rb
|
199
184
|
- spec/models/gateway/eway_rapid_spec.rb
|
200
185
|
- spec/models/gateway/eway_spec.rb
|
@@ -214,6 +199,7 @@ files:
|
|
214
199
|
- spec/models/gateway/worldpay_spec.rb
|
215
200
|
- spec/models/spree/order_spec.rb
|
216
201
|
- spec/requests/apple_pay_domain_verification.rb
|
202
|
+
- spec/requests/spree/api/v2/storefront/intents_controller_spec.rb
|
217
203
|
- spec/spec_helper.rb
|
218
204
|
- spec/support/order_walktrough.rb
|
219
205
|
- spec/support/wait_for_stripe.rb
|
@@ -224,9 +210,9 @@ licenses:
|
|
224
210
|
- BSD-3-Clause
|
225
211
|
metadata:
|
226
212
|
bug_tracker_uri: https://github.com/spree/spree_gateway/issues
|
227
|
-
changelog_uri: https://github.com/spree/spree_gateway/releases/tag/v3.
|
213
|
+
changelog_uri: https://github.com/spree/spree_gateway/releases/tag/v3.10.0
|
228
214
|
documentation_uri: https://guides.spreecommerce.org/
|
229
|
-
source_code_uri: https://github.com/spree/spree_gateway/tree/v3.
|
215
|
+
source_code_uri: https://github.com/spree/spree_gateway/tree/v3.10.0
|
230
216
|
post_install_message:
|
231
217
|
rdoc_options: []
|
232
218
|
require_paths:
|
@@ -243,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
243
229
|
version: '0'
|
244
230
|
requirements:
|
245
231
|
- none
|
246
|
-
rubygems_version: 3.
|
232
|
+
rubygems_version: 3.0.9
|
247
233
|
signing_key:
|
248
234
|
specification_version: 4
|
249
235
|
summary: Additional Payment Gateways for Spree Commerce
|
@@ -260,7 +246,7 @@ test_files:
|
|
260
246
|
- spec/models/gateway/braintree_gateway_spec.rb
|
261
247
|
- spec/models/gateway/card_save_spec.rb
|
262
248
|
- spec/models/gateway/cyber_source_spec.rb
|
263
|
-
- spec/models/gateway/
|
249
|
+
- spec/models/gateway/data_cash_spec.rb
|
264
250
|
- spec/models/gateway/epay_spec.rb
|
265
251
|
- spec/models/gateway/eway_rapid_spec.rb
|
266
252
|
- spec/models/gateway/eway_spec.rb
|
@@ -280,6 +266,7 @@ test_files:
|
|
280
266
|
- spec/models/gateway/worldpay_spec.rb
|
281
267
|
- spec/models/spree/order_spec.rb
|
282
268
|
- spec/requests/apple_pay_domain_verification.rb
|
269
|
+
- spec/requests/spree/api/v2/storefront/intents_controller_spec.rb
|
283
270
|
- spec/spec_helper.rb
|
284
271
|
- spec/support/order_walktrough.rb
|
285
272
|
- spec/support/wait_for_stripe.rb
|
data/Appraisals
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
appraise 'spree-3-7' do
|
2
|
-
gem 'spree', '~> 3.7.0'
|
3
|
-
gem 'rails-controller-testing'
|
4
|
-
gem 'sass-rails'
|
5
|
-
end
|
6
|
-
|
7
|
-
appraise 'spree-4-1' do
|
8
|
-
gem 'spree', '~> 4.1.0'
|
9
|
-
gem 'rails-controller-testing'
|
10
|
-
end
|
11
|
-
|
12
|
-
appraise 'spree-master' do
|
13
|
-
gem 'spree', github: 'spree/spree', branch: 'master'
|
14
|
-
gem 'rails-controller-testing'
|
15
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class UpdateBraintreePaymentMethodType < SpreeExtension::Migration[4.2]
|
2
|
-
def up
|
3
|
-
Spree::PaymentMethod.where(:type => "Spree::Gateway::Braintree").update_all(:type => "Spree::Gateway::BraintreeGateway")
|
4
|
-
end
|
5
|
-
|
6
|
-
def down
|
7
|
-
Spree::PaymentMethod.where(:type => "Spree::Gateway::BraintreeGateway").update_all(:type => "Spree::Gateway::Braintree")
|
8
|
-
end
|
9
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class UpdateStripePaymentMethodType < SpreeExtension::Migration[4.2]
|
2
|
-
def up
|
3
|
-
Spree::PaymentMethod.where(:type => "Spree::Gateway::Stripe").update_all(:type => "Spree::Gateway::StripeGateway")
|
4
|
-
end
|
5
|
-
|
6
|
-
def down
|
7
|
-
Spree::PaymentMethod.where(:type => "Spree::Gateway::StripeGateway").update_all(:type => "Spree::Gateway::Stripe")
|
8
|
-
end
|
9
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class UpdateBalancedPaymentMethodType < SpreeExtension::Migration[4.2]
|
2
|
-
def up
|
3
|
-
Spree::PaymentMethod.where(:type => "Spree::Gateway::Balanced").update_all(:type => "Spree::Gateway::BalancedGateway")
|
4
|
-
end
|
5
|
-
|
6
|
-
def down
|
7
|
-
Spree::PaymentMethod.where(:type => "Spree::Gateway::BalancedGateway").update_all(:type => "Spree::Gateway::Balanced")
|
8
|
-
end
|
9
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class UpdatePaypalPaymentMethodType < SpreeExtension::Migration[4.2]
|
2
|
-
def up
|
3
|
-
Spree::PaymentMethod.where(:type => "Spree::Gateway::PayPal").update_all(:type => "Spree::Gateway::PayPalGateway")
|
4
|
-
end
|
5
|
-
|
6
|
-
def down
|
7
|
-
Spree::PaymentMethod.where(:type => "Spree::Gateway::PayPalGateway").update_all(:type => "Spree::Gateway::PayPal")
|
8
|
-
end
|
9
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
class MigrateStripePreferences < SpreeExtension::Migration[4.2]
|
2
|
-
def up
|
3
|
-
Spree::Preference.where("#{ActiveRecord::Base.connection.quote_column_name("key")} LIKE 'spree/gateway/stripe_gateway/login%'").each do |pref|
|
4
|
-
pref.key = pref.key.gsub('login', 'secret_key')
|
5
|
-
pref.save
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
data/gemfiles/spree_3_7.gemfile
DELETED
data/gemfiles/spree_4_1.gemfile
DELETED