spree_gateway 3.6.1 → 3.6.4

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: fe136745a4952c109be6bf5181f835c8bead01e7a4af597298151c6a7ab99906
4
- data.tar.gz: dd862525415b7c5ab06707916b82261a46ad208e4a9c9b3e0cb36674abaac858
3
+ metadata.gz: 0552edd565bc5548c37193554fab4ac475fdafc0e46a50cd35cb9dea9f008752
4
+ data.tar.gz: b9de992c711cd14a26e22c7ba7e395d0b81dd9acbdee55f032d274b6e1712f40
5
5
  SHA512:
6
- metadata.gz: 4c459f16bf20b77fee7444def8c37ffd34d03c6cb294aebd82b80b990bca8ad390604e7b063f804df233bbebbf152d923c476d337a7d2b84052467a9c11bec21
7
- data.tar.gz: e447da970e9bfacbff93f49dd0dc5e9cc9622f29a8c3ec819114579fca1fa8a8728d358fd2d80635752057b2a80b7d399963c4c20056bc901bf0c0affe57ade3
6
+ metadata.gz: 4ef24a0aff0e214d043c325f95e00b72d86def24a51d97d603ba424d6df5df7ebc2a42dea8a6de69c6d8a2ff95ff042c2ba9363bfb53637682b04dd5ec722fb7
7
+ data.tar.gz: 422e86964485e15bc21347324d923f4108b1e9b7ed132e3023a1b177668c6942178a578fc8cbb97149a3eee0ef6c78609380184768d788e258bf2406dff3c0e9
data/.travis.yml CHANGED
@@ -15,6 +15,7 @@ gemfile:
15
15
  # - gemfiles/spree_3_2.gemfile
16
16
  - gemfiles/spree_3_5.gemfile
17
17
  - gemfiles/spree_3_7.gemfile
18
+ - gemfiles/spree_4_0.gemfile
18
19
  - gemfiles/spree_master.gemfile
19
20
 
20
21
  script:
@@ -34,10 +35,16 @@ matrix:
34
35
  gemfile: gemfiles/spree_master.gemfile
35
36
  - rvm: 2.4.4
36
37
  gemfile: gemfiles/spree_master.gemfile
38
+ - rvm: 2.3.7
39
+ gemfile: gemfiles/spree_4_0.gemfile
40
+ - rvm: 2.4.4
41
+ gemfile: gemfiles/spree_4_0.gemfile
37
42
  - rvm: 2.5.1
38
43
  gemfile: gemfiles/spree_3_2.gemfile
39
44
  - rvm: 2.4.4
40
45
  gemfile: gemfiles/spree_3_2.gemfile
46
+ - rvm: 2.5.1
47
+ gemfile: gemfiles/spree_3_5.gemfile
41
48
 
42
49
  before_install:
43
50
  - mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
data/Appraisals CHANGED
@@ -14,6 +14,11 @@ appraise 'spree-3-7' do
14
14
  gem 'rails-controller-testing'
15
15
  end
16
16
 
17
+ appraise 'spree-4-0' do
18
+ gem 'spree', '~> 4.0.0.rc2'
19
+ gem 'rails-controller-testing'
20
+ end
21
+
17
22
  appraise 'spree-master' do
18
23
  gem 'spree', github: 'spree/spree', branch: 'master'
19
24
  gem 'rails-controller-testing'
@@ -40,16 +40,16 @@ module Spree
40
40
  provider.capture(money, response_code, gateway_options)
41
41
  end
42
42
 
43
- def credit(money, creditcard, response_code, gateway_options)
44
- provider.refund(money, response_code, {})
43
+ def credit(money, creditcard, response_code, gateway_options)tes
44
+ provider.refund(money, response_code, {}, gateway_options)
45
45
  end
46
46
 
47
47
  def void(response_code, creditcard, gateway_options)
48
- provider.void(response_code, {})
48
+ provider.void(response_code, {}, gateway_options)
49
49
  end
50
50
 
51
51
  def cancel(response_code)
52
- provider.void(response_code, {})
52
+ provider.void(response_code, {}, gateway_options)
53
53
  end
54
54
 
55
55
  def create_profile(payment)
@@ -87,14 +87,17 @@ module Spree
87
87
 
88
88
  # In this gateway, what we call 'secret_key' is the 'login'
89
89
  def options
90
- options = super
91
- options.merge(:login => preferred_secret_key)
90
+ super.merge(
91
+ login: preferred_secret_key,
92
+ application: app_info
93
+ )
92
94
  end
93
95
 
94
96
  def options_for_purchase_or_auth(money, creditcard, gateway_options)
95
97
  options = {}
96
98
  options[:description] = "Spree Order ID: #{gateway_options[:order_id]}"
97
99
  options[:currency] = gateway_options[:currency]
100
+ options[:application] = app_info
98
101
 
99
102
  if customer = creditcard.gateway_customer_profile_id
100
103
  options[:customer] = customer
@@ -133,5 +136,11 @@ module Spree
133
136
  source.cc_type = CARD_TYPE_MAPPING[source.cc_type] if CARD_TYPE_MAPPING.include?(source.cc_type)
134
137
  source
135
138
  end
139
+
140
+ def app_info
141
+ name_with_version = "SpreeGateway/#{SpreeGateway.version}"
142
+ url = 'https://spreecommerce.org'
143
+ "#{name_with_version} #{url}"
144
+ end
136
145
  end
137
146
  end
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails-controller-testing"
6
+ gem "spree", "~> 4.0.0.rc2"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,27 @@
1
+ module ActiveMerchant
2
+ module Billing
3
+ module StripeGatewayDecorator
4
+ def self.prepended(base)
5
+ base.class_eval do
6
+ alias_method :original_headers, :headers
7
+ alias_method :original_add_customer_data, :add_customer_data
8
+
9
+ private
10
+
11
+ def headers(options = {})
12
+ headers = original_headers(options)
13
+ headers['User-Agent'] = headers['X-Stripe-Client-User-Agent']
14
+ headers
15
+ end
16
+
17
+ def add_customer_data(post, options)
18
+ original_add_customer_data(post, options)
19
+ post[:payment_user_agent] = "SpreeGateway/#{SpreeGateway.version}"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+
27
+ ActiveMerchant::Billing::StripeGateway.prepend(ActiveMerchant::Billing::StripeGatewayDecorator)
data/lib/spree_gateway.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  require 'spree_core'
2
2
  require 'spree_gateway/engine'
3
+ require 'spree_gateway/version'
3
4
  require 'spree_extension'
@@ -40,6 +40,9 @@ module SpreeGateway
40
40
  Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/spree/*_decorator*.rb')) do |c|
41
41
  Rails.application.config.cache_classes ? require(c) : load(c)
42
42
  end
43
+ Dir.glob(File.join(File.dirname(__FILE__), '../../lib/active_merchant/**/*_decorator*.rb')) do |c|
44
+ Rails.application.config.cache_classes ? require(c) : load(c)
45
+ end
43
46
  end
44
47
 
45
48
  def self.backend_available?
@@ -0,0 +1,5 @@
1
+ module SpreeGateway
2
+ def self.version
3
+ '3.6.4'
4
+ end
5
+ end
data/spec/spec_helper.rb CHANGED
@@ -11,6 +11,7 @@ require 'capybara/rspec'
11
11
  require 'capybara/rails'
12
12
  require 'capybara-screenshot/rspec'
13
13
  require "selenium-webdriver"
14
+ require 'webdrivers'
14
15
  require 'database_cleaner'
15
16
  require 'ffaker'
16
17
  require 'rspec/active_model/mocks'
@@ -56,8 +57,10 @@ RSpec.configure do |config|
56
57
  Capybara.register_driver :chrome do |app|
57
58
  Capybara::Selenium::Driver.new app,
58
59
  browser: :chrome,
59
- options: Selenium::WebDriver::Chrome::Options.new(args: %w[disable-popup-blocking headless disable-gpu window-size=1920,1080])
60
+ options: Selenium::WebDriver::Chrome::Options.new(
61
+ args: %w[no-sandbox disable-dev-shm-usage disable-popup-blocking headless disable-gpu window-size=1920,1080 --enable-features=NetworkService,NetworkServiceInProcess --disable-features=VizDisplayCompositor],
62
+ log_level: :error
63
+ )
60
64
  end
61
-
62
65
  Capybara.javascript_driver = :chrome
63
66
  end
@@ -1,8 +1,13 @@
1
1
  # coding: utf-8
2
+ lib = File.expand_path('../lib/', __FILE__)
3
+ $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
4
+
5
+ require 'spree_gateway/version'
6
+
2
7
  Gem::Specification.new do |s|
3
8
  s.platform = Gem::Platform::RUBY
4
9
  s.name = 'spree_gateway'
5
- s.version = '3.6.1'
10
+ s.version = SpreeGateway.version
6
11
  s.summary = 'Additional Payment Gateways for Spree Commerce'
7
12
  s.description = s.summary
8
13
 
@@ -21,7 +26,7 @@ Gem::Specification.new do |s|
21
26
  s.add_dependency 'spree_extension'
22
27
 
23
28
  s.add_development_dependency 'appraisal'
24
- s.add_development_dependency 'bootstrap-sass', '>= 3.3.5.1'
29
+ s.add_development_dependency 'bootstrap-sass'
25
30
  s.add_development_dependency 'braintree'
26
31
  s.add_development_dependency 'capybara'
27
32
  s.add_development_dependency 'capybara-screenshot'
@@ -31,14 +36,15 @@ Gem::Specification.new do |s|
31
36
  s.add_development_dependency 'ffaker'
32
37
  s.add_development_dependency 'guard-rspec'
33
38
  s.add_development_dependency 'launchy'
34
- s.add_development_dependency 'mysql2', '~> 0.5.1'
35
- s.add_development_dependency 'pg', '~> 0.18'
39
+ s.add_development_dependency 'mysql2'
40
+ s.add_development_dependency 'pg'
36
41
  s.add_development_dependency 'pry'
37
42
  s.add_development_dependency 'puma'
38
43
  s.add_development_dependency 'rspec-activemodel-mocks'
39
44
  s.add_development_dependency 'rspec-rails'
40
45
  s.add_development_dependency 'sass-rails'
41
46
  s.add_development_dependency 'selenium-webdriver'
47
+ s.add_development_dependency 'webdrivers'
42
48
  s.add_development_dependency 'simplecov'
43
- s.add_development_dependency 'sqlite3', '~> 1.4.1'
49
+ s.add_development_dependency 'sqlite3'
44
50
  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.6.1
4
+ version: 3.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spree Commerce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-12 00:00:00.000000000 Z
11
+ date: 2019-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: 3.3.5.1
67
+ version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 3.3.5.1
74
+ version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: braintree
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -202,30 +202,30 @@ dependencies:
202
202
  name: mysql2
203
203
  requirement: !ruby/object:Gem::Requirement
204
204
  requirements:
205
- - - "~>"
205
+ - - ">="
206
206
  - !ruby/object:Gem::Version
207
- version: 0.5.1
207
+ version: '0'
208
208
  type: :development
209
209
  prerelease: false
210
210
  version_requirements: !ruby/object:Gem::Requirement
211
211
  requirements:
212
- - - "~>"
212
+ - - ">="
213
213
  - !ruby/object:Gem::Version
214
- version: 0.5.1
214
+ version: '0'
215
215
  - !ruby/object:Gem::Dependency
216
216
  name: pg
217
217
  requirement: !ruby/object:Gem::Requirement
218
218
  requirements:
219
- - - "~>"
219
+ - - ">="
220
220
  - !ruby/object:Gem::Version
221
- version: '0.18'
221
+ version: '0'
222
222
  type: :development
223
223
  prerelease: false
224
224
  version_requirements: !ruby/object:Gem::Requirement
225
225
  requirements:
226
- - - "~>"
226
+ - - ">="
227
227
  - !ruby/object:Gem::Version
228
- version: '0.18'
228
+ version: '0'
229
229
  - !ruby/object:Gem::Dependency
230
230
  name: pry
231
231
  requirement: !ruby/object:Gem::Requirement
@@ -310,6 +310,20 @@ dependencies:
310
310
  - - ">="
311
311
  - !ruby/object:Gem::Version
312
312
  version: '0'
313
+ - !ruby/object:Gem::Dependency
314
+ name: webdrivers
315
+ requirement: !ruby/object:Gem::Requirement
316
+ requirements:
317
+ - - ">="
318
+ - !ruby/object:Gem::Version
319
+ version: '0'
320
+ type: :development
321
+ prerelease: false
322
+ version_requirements: !ruby/object:Gem::Requirement
323
+ requirements:
324
+ - - ">="
325
+ - !ruby/object:Gem::Version
326
+ version: '0'
313
327
  - !ruby/object:Gem::Dependency
314
328
  name: simplecov
315
329
  requirement: !ruby/object:Gem::Requirement
@@ -328,16 +342,16 @@ dependencies:
328
342
  name: sqlite3
329
343
  requirement: !ruby/object:Gem::Requirement
330
344
  requirements:
331
- - - "~>"
345
+ - - ">="
332
346
  - !ruby/object:Gem::Version
333
- version: 1.4.1
347
+ version: '0'
334
348
  type: :development
335
349
  prerelease: false
336
350
  version_requirements: !ruby/object:Gem::Requirement
337
351
  requirements:
338
- - - "~>"
352
+ - - ">="
339
353
  - !ruby/object:Gem::Version
340
- version: 1.4.1
354
+ version: '0'
341
355
  description: Additional Payment Gateways for Spree Commerce
342
356
  email: gems@spreecommerce.com
343
357
  executables: []
@@ -399,11 +413,14 @@ files:
399
413
  - gemfiles/spree_3_2.gemfile
400
414
  - gemfiles/spree_3_5.gemfile
401
415
  - gemfiles/spree_3_7.gemfile
416
+ - gemfiles/spree_4_0.gemfile
402
417
  - gemfiles/spree_master.gemfile
418
+ - lib/active_merchant/billing/stripe_gateway_decorator.rb
403
419
  - lib/controllers/spree/apple_pay_domain_verification_controller.rb
404
420
  - lib/generators/spree_gateway/install/install_generator.rb
405
421
  - lib/spree_gateway.rb
406
422
  - lib/spree_gateway/engine.rb
423
+ - lib/spree_gateway/version.rb
407
424
  - lib/views/backend/spree/admin/log_entries/_braintree.html.erb
408
425
  - lib/views/backend/spree/admin/log_entries/_stripe.html.erb
409
426
  - lib/views/backend/spree/admin/payments/source_forms/_quickcheckout.html.erb