spree_gateway 3.2.0 → 3.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +15 -6
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/app/models/spree/gateway/eway_rapid.rb +14 -0
- data/app/models/spree/gateway/stripe_gateway.rb +16 -7
- data/config/locales/bg.yml +0 -7
- data/config/locales/de.yml +0 -7
- data/config/locales/en.yml +0 -7
- data/config/locales/sv.yml +0 -7
- data/db/migrate/20121017004102_update_braintree_payment_method_type.rb +2 -2
- data/db/migrate/20130213222555_update_stripe_payment_method_type.rb +2 -2
- data/db/migrate/20130415222802_update_balanced_payment_method_type.rb +3 -3
- data/db/migrate/20131008221012_update_paypal_payment_method_type.rb +2 -2
- data/db/migrate/20131112133401_migrate_stripe_preferences.rb +1 -1
- data/lib/active_merchant/billing/gateways/stripe_decorator.rb +17 -0
- data/lib/spree_gateway.rb +2 -0
- data/lib/spree_gateway/engine.rb +5 -2
- data/lib/spree_gateway/version.rb +5 -0
- data/spec/models/gateway/eway_rapid_spec.rb +23 -0
- data/spec/spec_helper.rb +11 -2
- data/spree_gateway.gemspec +14 -6
- metadata +62 -39
- data/app/models/spree/billing_integration/skrill/quick_checkout.rb +0 -48
- data/app/models/spree/skrill_transaction.rb +0 -19
- data/config/routes.rb +0 -13
- data/db/migrate/20111118164631_create_skrill_transactions.rb +0 -13
- data/lib/active_merchant/billing/skrill.rb +0 -18
- data/lib/controllers/frontend/spree/checkout_controller_decorator.rb +0 -51
- data/lib/controllers/frontend/spree/skrill_status_controller.rb +0 -39
- data/lib/views/backend/spree/admin/payments/source_views/_quickcheckout.html.erb +0 -39
- data/lib/views/frontend/spree/checkout/payment/_quickcheckout.html.erb +0 -26
- data/spec/controllers/spree/checkout_controller_spec.rb +0 -13
- data/spec/controllers/spree/skrill_status_controller_spec.rb +0 -8
- data/spec/factories/payment_method_factory.rb +0 -5
- data/spec/factories/skrill_transaction_factory.rb +0 -10
- data/spec/lib/active_merchant/billing_skrill_spec.rb +0 -18
- data/spec/models/billing_integration/skrill_quick_checkout_spec.rb +0 -11
- data/spec/models/skrill_transaction_spec.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 648d40901742451fde4132f84a47a1cb6cd87da368e231026bd43bc0de827317
|
4
|
+
data.tar.gz: a7074f7a84f7f59e91302d2fa40d939d074df09665a6c5187cf2282104a5d934
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab2a9999f550f7c983f74fd4d373e5283e8b4c851c51db219358c8003f3d0c24fef1436ee259fc872399e40c8660c843d3edb589f6371739ed92379dc869473e
|
7
|
+
data.tar.gz: 03dfc59510f180067067e29cdd37cbd4a545c1b172c0a096ede0a9a3f1ff8006be49b35ac93755c15eeede25a94bff3f9016f0a887505d21b71f87b9183d75ed
|
data/.travis.yml
CHANGED
@@ -3,6 +3,9 @@ dist: trusty
|
|
3
3
|
|
4
4
|
language: ruby
|
5
5
|
|
6
|
+
addons:
|
7
|
+
chrome: stable
|
8
|
+
|
6
9
|
env:
|
7
10
|
- DB=postgres
|
8
11
|
- DB=mysql
|
@@ -20,9 +23,15 @@ rvm:
|
|
20
23
|
- 2.3.1
|
21
24
|
- 2.2.7
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
matrix:
|
27
|
+
allow_failures:
|
28
|
+
- gemfile: gemfiles/spree_master.gemfile
|
29
|
+
|
30
|
+
before_install:
|
31
|
+
- mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
|
32
|
+
- wget -N https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip -P ~/
|
33
|
+
- unzip ~/chromedriver_linux64.zip -d ~/
|
34
|
+
- rm ~/chromedriver_linux64.zip
|
35
|
+
- sudo mv -f ~/chromedriver /usr/local/share/
|
36
|
+
- sudo chmod +x /usr/local/share/chromedriver
|
37
|
+
- sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
module Spree
|
2
|
+
class Gateway::EwayRapid < Gateway
|
3
|
+
preference :login, :string
|
4
|
+
preference :password, :string
|
5
|
+
|
6
|
+
def provider_class
|
7
|
+
ActiveMerchant::Billing::EwayRapidGateway
|
8
|
+
end
|
9
|
+
|
10
|
+
def options
|
11
|
+
super().merge(:test => self.preferred_test_mode)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -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)
|
@@ -60,7 +60,7 @@ module Spree
|
|
60
60
|
}.merge! address_for(payment)
|
61
61
|
|
62
62
|
source = update_source!(payment.source)
|
63
|
-
if source.
|
63
|
+
if source.gateway_payment_profile_id.present?
|
64
64
|
creditcard = source.gateway_payment_profile_id
|
65
65
|
else
|
66
66
|
creditcard = source
|
@@ -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
|
-
|
91
|
-
|
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
|
data/config/locales/bg.yml
CHANGED
@@ -2,10 +2,3 @@
|
|
2
2
|
bg:
|
3
3
|
spree:
|
4
4
|
payment_has_been_cancelled: Плащането беше прекъснато.
|
5
|
-
complete_skrill_checkout: Моля довършете Вашето плащане със Skrill преди да продължите
|
6
|
-
skrill: Skrill
|
7
|
-
skrill_transaction: Транзакция
|
8
|
-
skrill_customer_id: Клиентски номер
|
9
|
-
skrill_transaction_id: Номер на транкцията
|
10
|
-
skrill_payment_type: Вид на плащане
|
11
|
-
skrill_payment_currency: Валута
|
data/config/locales/de.yml
CHANGED
@@ -2,10 +2,3 @@
|
|
2
2
|
de:
|
3
3
|
spree:
|
4
4
|
payment_has_been_cancelled: Die Zahlung wurde abgebrochen.
|
5
|
-
complete_skrill_checkout: Bitte schliessen Sie die Skrill-Zahlung ab
|
6
|
-
skrill: Skrill
|
7
|
-
skrill_transaction: Transaktion
|
8
|
-
skrill_customer_id: Kunden ID
|
9
|
-
skrill_transaction_id: Transaktions ID
|
10
|
-
skrill_payment_type: Bezahlart
|
11
|
-
skrill_payment_currency: Währung
|
data/config/locales/en.yml
CHANGED
@@ -2,13 +2,6 @@
|
|
2
2
|
en:
|
3
3
|
spree:
|
4
4
|
payment_has_been_cancelled: The payment has been cancelled.
|
5
|
-
complete_skrill_checkout: Please complete Skrill checkout before continuing
|
6
|
-
skrill: Skrill
|
7
|
-
skrill_transaction: Transaction
|
8
|
-
skrill_customer_id: Customer ID
|
9
|
-
skrill_transaction_id: Transaction ID
|
10
|
-
skrill_payment_type: Payment Type
|
11
|
-
skrill_payment_currency: Payment Currency
|
12
5
|
log_entry:
|
13
6
|
braintree:
|
14
7
|
message: Message
|
data/config/locales/sv.yml
CHANGED
@@ -2,10 +2,3 @@
|
|
2
2
|
sv:
|
3
3
|
spree:
|
4
4
|
payment_has_been_cancelled: Betalningen har avbrutits.
|
5
|
-
complete_skrill_checkout: Var god fyll i Skrill kassan innan du fortsätter
|
6
|
-
skrill: Skrill
|
7
|
-
skrill_transaction: Transaktion
|
8
|
-
skrill_customer_id: Kund ID
|
9
|
-
skrill_transaction_id: Transaktion ID
|
10
|
-
skrill_payment_type: Betalningstyp
|
11
|
-
skrill_payment_currency: Betalningsvaluta
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class UpdateBraintreePaymentMethodType <
|
1
|
+
class UpdateBraintreePaymentMethodType < SpreeExtension::Migration[4.2]
|
2
2
|
def up
|
3
3
|
Spree::PaymentMethod.where(:type => "Spree::Gateway::Braintree").update_all(:type => "Spree::Gateway::BraintreeGateway")
|
4
4
|
end
|
5
|
-
|
5
|
+
|
6
6
|
def down
|
7
7
|
Spree::PaymentMethod.where(:type => "Spree::Gateway::BraintreeGateway").update_all(:type => "Spree::Gateway::Braintree")
|
8
8
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class UpdateStripePaymentMethodType <
|
1
|
+
class UpdateStripePaymentMethodType < SpreeExtension::Migration[4.2]
|
2
2
|
def up
|
3
3
|
Spree::PaymentMethod.where(:type => "Spree::Gateway::Stripe").update_all(:type => "Spree::Gateway::StripeGateway")
|
4
4
|
end
|
5
|
-
|
5
|
+
|
6
6
|
def down
|
7
7
|
Spree::PaymentMethod.where(:type => "Spree::Gateway::StripeGateway").update_all(:type => "Spree::Gateway::Stripe")
|
8
8
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
class UpdateBalancedPaymentMethodType <
|
1
|
+
class UpdateBalancedPaymentMethodType < SpreeExtension::Migration[4.2]
|
2
2
|
def up
|
3
3
|
Spree::PaymentMethod.where(:type => "Spree::Gateway::Balanced").update_all(:type => "Spree::Gateway::BalancedGateway")
|
4
4
|
end
|
5
|
-
|
5
|
+
|
6
6
|
def down
|
7
7
|
Spree::PaymentMethod.where(:type => "Spree::Gateway::BalancedGateway").update_all(:type => "Spree::Gateway::Balanced")
|
8
8
|
end
|
9
|
-
end
|
9
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class UpdatePaypalPaymentMethodType <
|
1
|
+
class UpdatePaypalPaymentMethodType < SpreeExtension::Migration[4.2]
|
2
2
|
def up
|
3
3
|
Spree::PaymentMethod.where(:type => "Spree::Gateway::PayPal").update_all(:type => "Spree::Gateway::PayPalGateway")
|
4
4
|
end
|
5
|
-
|
5
|
+
|
6
6
|
def down
|
7
7
|
Spree::PaymentMethod.where(:type => "Spree::Gateway::PayPalGateway").update_all(:type => "Spree::Gateway::PayPal")
|
8
8
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class MigrateStripePreferences <
|
1
|
+
class MigrateStripePreferences < SpreeExtension::Migration[4.2]
|
2
2
|
def up
|
3
3
|
Spree::Preference.where("#{ActiveRecord::Base.connection.quote_column_name("key")} LIKE 'spree/gateway/stripe_gateway/login%'").each do |pref|
|
4
4
|
pref.key = pref.key.gsub('login', 'secret_key')
|
@@ -0,0 +1,17 @@
|
|
1
|
+
ActiveMerchant::Billing::StripeGateway.class_eval do
|
2
|
+
private
|
3
|
+
|
4
|
+
alias_method :original_headers, :headers
|
5
|
+
alias_method :original_add_customer_data, :add_customer_data
|
6
|
+
|
7
|
+
def headers(options = {})
|
8
|
+
headers = original_headers(options)
|
9
|
+
headers['User-Agent'] = headers['X-Stripe-Client-User-Agent']
|
10
|
+
headers
|
11
|
+
end
|
12
|
+
|
13
|
+
def add_customer_data(post, options)
|
14
|
+
original_add_customer_data(post, options)
|
15
|
+
post[:payment_user_agent] = "SpreeGateway/#{SpreeGateway.version}"
|
16
|
+
end
|
17
|
+
end
|
data/lib/spree_gateway.rb
CHANGED
data/lib/spree_gateway/engine.rb
CHANGED
@@ -5,7 +5,6 @@ module SpreeGateway
|
|
5
5
|
config.autoload_paths += %W(#{config.root}/lib)
|
6
6
|
|
7
7
|
initializer "spree.gateway.payment_methods", :after => "spree.register.payment_methods" do |app|
|
8
|
-
app.config.spree.payment_methods << Spree::BillingIntegration::Skrill::QuickCheckout
|
9
8
|
app.config.spree.payment_methods << Spree::Gateway::AuthorizeNet
|
10
9
|
app.config.spree.payment_methods << Spree::Gateway::AuthorizeNetCim
|
11
10
|
app.config.spree.payment_methods << Spree::Gateway::BalancedGateway
|
@@ -17,6 +16,7 @@ module SpreeGateway
|
|
17
16
|
app.config.spree.payment_methods << Spree::Gateway::DataCash
|
18
17
|
app.config.spree.payment_methods << Spree::Gateway::Epay
|
19
18
|
app.config.spree.payment_methods << Spree::Gateway::Eway
|
19
|
+
app.config.spree.payment_methods << Spree::Gateway::EwayRapid
|
20
20
|
app.config.spree.payment_methods << Spree::Gateway::Maxipago
|
21
21
|
app.config.spree.payment_methods << Spree::Gateway::Migs
|
22
22
|
app.config.spree.payment_methods << Spree::Gateway::Moneris
|
@@ -38,12 +38,15 @@ module SpreeGateway
|
|
38
38
|
if SpreeGateway::Engine.frontend_available?
|
39
39
|
Rails.application.config.assets.precompile += [
|
40
40
|
'lib/assets/javascripts/spree/frontend/spree_gateway.js',
|
41
|
-
'lib/assets/
|
41
|
+
'lib/assets/stylesheets/spree/frontend/spree_gateway.css',
|
42
42
|
]
|
43
43
|
Dir.glob(File.join(File.dirname(__FILE__), "../../controllers/frontend/*/*_decorator*.rb")) do |c|
|
44
44
|
Rails.configuration.cache_classes ? require(c) : load(c)
|
45
45
|
end
|
46
46
|
end
|
47
|
+
Dir.glob(File.join(File.dirname(__FILE__), '../../lib/active_merchant/**/*_decorator*.rb')) do |c|
|
48
|
+
Rails.application.config.cache_classes ? require(c) : load(c)
|
49
|
+
end
|
47
50
|
end
|
48
51
|
|
49
52
|
def self.backend_available?
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Spree::Gateway::EwayRapid do
|
4
|
+
let(:gateway) { described_class.create!(name: 'eWAY Rapid') }
|
5
|
+
|
6
|
+
describe '#provider_class' do
|
7
|
+
it 'should be an eWAY Rapid gateway' do
|
8
|
+
expect(gateway.provider_class).to eq ::ActiveMerchant::Billing::EwayRapidGateway
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe '#options' do
|
13
|
+
it 'should flag test option if preferred_test_mode is true' do
|
14
|
+
gateway.preferred_test_mode = true
|
15
|
+
expect(gateway.options[:test]).to be true
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should unflag test option if preferred_test_mode is false' do
|
19
|
+
gateway.preferred_test_mode = false
|
20
|
+
expect(gateway.options[:test]).to be false
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -9,8 +9,9 @@ require 'rspec/rails'
|
|
9
9
|
require 'rspec/active_model/mocks'
|
10
10
|
require 'capybara/rspec'
|
11
11
|
require 'capybara/rails'
|
12
|
-
require 'capybara/poltergeist'
|
13
12
|
require 'capybara-screenshot/rspec'
|
13
|
+
require "selenium-webdriver"
|
14
|
+
require 'webdrivers'
|
14
15
|
require 'database_cleaner'
|
15
16
|
require 'ffaker'
|
16
17
|
require 'rspec/active_model/mocks'
|
@@ -52,5 +53,13 @@ RSpec.configure do |config|
|
|
52
53
|
DatabaseCleaner.clean
|
53
54
|
end
|
54
55
|
|
55
|
-
Capybara.
|
56
|
+
Capybara.register_driver :chrome do |app|
|
57
|
+
Capybara::Selenium::Driver.new app,
|
58
|
+
browser: :chrome,
|
59
|
+
options: Selenium::WebDriver::Chrome::Options.new(
|
60
|
+
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],
|
61
|
+
log_level: :error
|
62
|
+
)
|
63
|
+
end
|
64
|
+
Capybara.javascript_driver = :chrome
|
56
65
|
end
|
data/spree_gateway.gemspec
CHANGED
@@ -1,15 +1,20 @@
|
|
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 =
|
10
|
+
s.version = SpreeGateway.version
|
6
11
|
s.summary = 'Additional Payment Gateways for Spree Commerce'
|
7
12
|
s.description = s.summary
|
8
13
|
|
9
14
|
s.author = 'Spree Commerce'
|
10
15
|
s.email = 'gems@spreecommerce.com'
|
11
|
-
s.homepage = '
|
12
|
-
s.license =
|
16
|
+
s.homepage = 'https://spreecommerce.org'
|
17
|
+
s.license = 'BSD-3-Clause'
|
13
18
|
|
14
19
|
s.files = `git ls-files`.split("\n")
|
15
20
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
@@ -18,6 +23,7 @@ Gem::Specification.new do |s|
|
|
18
23
|
|
19
24
|
spree_version = '>= 3.1.0', '< 4.0'
|
20
25
|
s.add_dependency 'spree_core', spree_version
|
26
|
+
s.add_dependency 'spree_extension'
|
21
27
|
|
22
28
|
s.add_development_dependency 'braintree'
|
23
29
|
s.add_development_dependency 'capybara'
|
@@ -25,19 +31,21 @@ Gem::Specification.new do |s|
|
|
25
31
|
s.add_development_dependency 'coffee-rails'
|
26
32
|
s.add_development_dependency 'database_cleaner'
|
27
33
|
s.add_development_dependency 'factory_girl'
|
34
|
+
s.add_development_dependency 'factory_bot', '~> 4.7'
|
28
35
|
s.add_development_dependency 'ffaker'
|
29
36
|
s.add_development_dependency 'guard-rspec'
|
30
37
|
s.add_development_dependency 'launchy'
|
31
38
|
s.add_development_dependency 'mysql2'
|
32
|
-
s.add_development_dependency 'pg'
|
33
|
-
s.add_development_dependency 'poltergeist'
|
39
|
+
s.add_development_dependency 'pg', '~> 0.18'
|
34
40
|
s.add_development_dependency 'pry'
|
41
|
+
s.add_development_dependency 'puma'
|
35
42
|
s.add_development_dependency 'rspec-activemodel-mocks'
|
36
43
|
s.add_development_dependency 'rspec-rails'
|
37
44
|
s.add_development_dependency 'bootstrap-sass', '>= 3.3.5.1'
|
38
45
|
s.add_development_dependency 'sass-rails', '>= 3.2'
|
39
46
|
s.add_development_dependency 'selenium-webdriver'
|
47
|
+
s.add_development_dependency 'webdrivers', '~> 3.9.0'
|
40
48
|
s.add_development_dependency 'simplecov'
|
41
|
-
s.add_development_dependency 'sqlite3'
|
49
|
+
s.add_development_dependency 'sqlite3', '~> 1.3.6'
|
42
50
|
s.add_development_dependency 'appraisal'
|
43
51
|
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.3.5
|
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: 2019-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -30,6 +30,20 @@ dependencies:
|
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '4.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: spree_extension
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
48
|
name: braintree
|
35
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,6 +128,20 @@ dependencies:
|
|
114
128
|
- - ">="
|
115
129
|
- !ruby/object:Gem::Version
|
116
130
|
version: '0'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: factory_bot
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '4.7'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '4.7'
|
117
145
|
- !ruby/object:Gem::Dependency
|
118
146
|
name: ffaker
|
119
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,18 +202,18 @@ dependencies:
|
|
174
202
|
name: pg
|
175
203
|
requirement: !ruby/object:Gem::Requirement
|
176
204
|
requirements:
|
177
|
-
- - "
|
205
|
+
- - "~>"
|
178
206
|
- !ruby/object:Gem::Version
|
179
|
-
version: '0'
|
207
|
+
version: '0.18'
|
180
208
|
type: :development
|
181
209
|
prerelease: false
|
182
210
|
version_requirements: !ruby/object:Gem::Requirement
|
183
211
|
requirements:
|
184
|
-
- - "
|
212
|
+
- - "~>"
|
185
213
|
- !ruby/object:Gem::Version
|
186
|
-
version: '0'
|
214
|
+
version: '0.18'
|
187
215
|
- !ruby/object:Gem::Dependency
|
188
|
-
name:
|
216
|
+
name: pry
|
189
217
|
requirement: !ruby/object:Gem::Requirement
|
190
218
|
requirements:
|
191
219
|
- - ">="
|
@@ -199,7 +227,7 @@ dependencies:
|
|
199
227
|
- !ruby/object:Gem::Version
|
200
228
|
version: '0'
|
201
229
|
- !ruby/object:Gem::Dependency
|
202
|
-
name:
|
230
|
+
name: puma
|
203
231
|
requirement: !ruby/object:Gem::Requirement
|
204
232
|
requirements:
|
205
233
|
- - ">="
|
@@ -282,6 +310,20 @@ dependencies:
|
|
282
310
|
- - ">="
|
283
311
|
- !ruby/object:Gem::Version
|
284
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: 3.9.0
|
320
|
+
type: :development
|
321
|
+
prerelease: false
|
322
|
+
version_requirements: !ruby/object:Gem::Requirement
|
323
|
+
requirements:
|
324
|
+
- - "~>"
|
325
|
+
- !ruby/object:Gem::Version
|
326
|
+
version: 3.9.0
|
285
327
|
- !ruby/object:Gem::Dependency
|
286
328
|
name: simplecov
|
287
329
|
requirement: !ruby/object:Gem::Requirement
|
@@ -300,16 +342,16 @@ dependencies:
|
|
300
342
|
name: sqlite3
|
301
343
|
requirement: !ruby/object:Gem::Requirement
|
302
344
|
requirements:
|
303
|
-
- - "
|
345
|
+
- - "~>"
|
304
346
|
- !ruby/object:Gem::Version
|
305
|
-
version:
|
347
|
+
version: 1.3.6
|
306
348
|
type: :development
|
307
349
|
prerelease: false
|
308
350
|
version_requirements: !ruby/object:Gem::Requirement
|
309
351
|
requirements:
|
310
|
-
- - "
|
352
|
+
- - "~>"
|
311
353
|
- !ruby/object:Gem::Version
|
312
|
-
version:
|
354
|
+
version: 1.3.6
|
313
355
|
- !ruby/object:Gem::Dependency
|
314
356
|
name: appraisal
|
315
357
|
requirement: !ruby/object:Gem::Requirement
|
@@ -340,7 +382,6 @@ files:
|
|
340
382
|
- README.md
|
341
383
|
- Rakefile
|
342
384
|
- app/models/spree/billing_integration.rb
|
343
|
-
- app/models/spree/billing_integration/skrill/quick_checkout.rb
|
344
385
|
- app/models/spree/gateway/authorize_net.rb
|
345
386
|
- app/models/spree/gateway/authorize_net_cim.rb
|
346
387
|
- app/models/spree/gateway/balanced_gateway.rb
|
@@ -352,6 +393,7 @@ files:
|
|
352
393
|
- app/models/spree/gateway/data_cash.rb
|
353
394
|
- app/models/spree/gateway/epay.rb
|
354
395
|
- app/models/spree/gateway/eway.rb
|
396
|
+
- app/models/spree/gateway/eway_rapid.rb
|
355
397
|
- app/models/spree/gateway/maxipago.rb
|
356
398
|
- app/models/spree/gateway/migs.rb
|
357
399
|
- app/models/spree/gateway/moneris.rb
|
@@ -367,13 +409,10 @@ files:
|
|
367
409
|
- app/models/spree/gateway/stripe_gateway.rb
|
368
410
|
- app/models/spree/gateway/usa_epay_transaction.rb
|
369
411
|
- app/models/spree/gateway/worldpay.rb
|
370
|
-
- app/models/spree/skrill_transaction.rb
|
371
412
|
- config/locales/bg.yml
|
372
413
|
- config/locales/de.yml
|
373
414
|
- config/locales/en.yml
|
374
415
|
- config/locales/sv.yml
|
375
|
-
- config/routes.rb
|
376
|
-
- db/migrate/20111118164631_create_skrill_transactions.rb
|
377
416
|
- db/migrate/20121017004102_update_braintree_payment_method_type.rb
|
378
417
|
- db/migrate/20130213222555_update_stripe_payment_method_type.rb
|
379
418
|
- db/migrate/20130415222802_update_balanced_payment_method_type.rb
|
@@ -382,30 +421,21 @@ files:
|
|
382
421
|
- gemfiles/spree_3_1.gemfile
|
383
422
|
- gemfiles/spree_3_2.gemfile
|
384
423
|
- gemfiles/spree_master.gemfile
|
385
|
-
- lib/active_merchant/billing/
|
424
|
+
- lib/active_merchant/billing/gateways/stripe_decorator.rb
|
386
425
|
- lib/assets/javascripts/spree/frontend/spree_gateway.js
|
387
426
|
- lib/assets/stylesheets/spree/frontend/spree_gateway.css
|
388
|
-
- lib/controllers/frontend/spree/checkout_controller_decorator.rb
|
389
|
-
- lib/controllers/frontend/spree/skrill_status_controller.rb
|
390
427
|
- lib/generators/spree_gateway/install/install_generator.rb
|
391
428
|
- lib/spree_gateway.rb
|
392
429
|
- lib/spree_gateway/engine.rb
|
430
|
+
- lib/spree_gateway/version.rb
|
393
431
|
- lib/views/backend/spree/admin/log_entries/_braintree.html.erb
|
394
432
|
- lib/views/backend/spree/admin/log_entries/_stripe.html.erb
|
395
433
|
- lib/views/backend/spree/admin/payments/source_forms/_quickcheckout.html.erb
|
396
434
|
- lib/views/backend/spree/admin/payments/source_forms/_stripe.html.erb
|
397
|
-
- lib/views/backend/spree/admin/payments/source_views/_quickcheckout.html.erb
|
398
435
|
- lib/views/backend/spree/admin/payments/source_views/_stripe.html.erb
|
399
|
-
- lib/views/frontend/spree/checkout/payment/_quickcheckout.html.erb
|
400
436
|
- lib/views/frontend/spree/checkout/payment/_stripe.html.erb
|
401
437
|
- script/rails
|
402
|
-
- spec/controllers/spree/checkout_controller_spec.rb
|
403
|
-
- spec/controllers/spree/skrill_status_controller_spec.rb
|
404
|
-
- spec/factories/payment_method_factory.rb
|
405
|
-
- spec/factories/skrill_transaction_factory.rb
|
406
438
|
- spec/features/stripe_checkout_spec.rb
|
407
|
-
- spec/lib/active_merchant/billing_skrill_spec.rb
|
408
|
-
- spec/models/billing_integration/skrill_quick_checkout_spec.rb
|
409
439
|
- spec/models/gateway/authorize_net_cim_spec.rb
|
410
440
|
- spec/models/gateway/authorize_net_spec.rb
|
411
441
|
- spec/models/gateway/balanced_gateway_spec.rb
|
@@ -416,6 +446,7 @@ files:
|
|
416
446
|
- spec/models/gateway/cyber_source_spec.rb
|
417
447
|
- spec/models/gateway/data_cache_spec.rb
|
418
448
|
- spec/models/gateway/epay_spec.rb
|
449
|
+
- spec/models/gateway/eway_rapid_spec.rb
|
419
450
|
- spec/models/gateway/eway_spec.rb
|
420
451
|
- spec/models/gateway/maxipago_spec.rb
|
421
452
|
- spec/models/gateway/moneris_spec.rb
|
@@ -430,13 +461,12 @@ files:
|
|
430
461
|
- spec/models/gateway/stripe_gateway_spec.rb
|
431
462
|
- spec/models/gateway/usa_epay_transaction_spec.rb
|
432
463
|
- spec/models/gateway/worldpay_spec.rb
|
433
|
-
- spec/models/skrill_transaction_spec.rb
|
434
464
|
- spec/spec_helper.rb
|
435
465
|
- spec/support/wait_for_stripe.rb
|
436
466
|
- spree_gateway.gemspec
|
437
|
-
homepage:
|
467
|
+
homepage: https://spreecommerce.org
|
438
468
|
licenses:
|
439
|
-
- BSD-3
|
469
|
+
- BSD-3-Clause
|
440
470
|
metadata: {}
|
441
471
|
post_install_message:
|
442
472
|
rdoc_options: []
|
@@ -454,19 +484,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
454
484
|
version: '0'
|
455
485
|
requirements:
|
456
486
|
- none
|
457
|
-
|
458
|
-
rubygems_version: 2.6.10
|
487
|
+
rubygems_version: 3.0.2
|
459
488
|
signing_key:
|
460
489
|
specification_version: 4
|
461
490
|
summary: Additional Payment Gateways for Spree Commerce
|
462
491
|
test_files:
|
463
|
-
- spec/controllers/spree/checkout_controller_spec.rb
|
464
|
-
- spec/controllers/spree/skrill_status_controller_spec.rb
|
465
|
-
- spec/factories/payment_method_factory.rb
|
466
|
-
- spec/factories/skrill_transaction_factory.rb
|
467
492
|
- spec/features/stripe_checkout_spec.rb
|
468
|
-
- spec/lib/active_merchant/billing_skrill_spec.rb
|
469
|
-
- spec/models/billing_integration/skrill_quick_checkout_spec.rb
|
470
493
|
- spec/models/gateway/authorize_net_cim_spec.rb
|
471
494
|
- spec/models/gateway/authorize_net_spec.rb
|
472
495
|
- spec/models/gateway/balanced_gateway_spec.rb
|
@@ -477,6 +500,7 @@ test_files:
|
|
477
500
|
- spec/models/gateway/cyber_source_spec.rb
|
478
501
|
- spec/models/gateway/data_cache_spec.rb
|
479
502
|
- spec/models/gateway/epay_spec.rb
|
503
|
+
- spec/models/gateway/eway_rapid_spec.rb
|
480
504
|
- spec/models/gateway/eway_spec.rb
|
481
505
|
- spec/models/gateway/maxipago_spec.rb
|
482
506
|
- spec/models/gateway/moneris_spec.rb
|
@@ -491,6 +515,5 @@ test_files:
|
|
491
515
|
- spec/models/gateway/stripe_gateway_spec.rb
|
492
516
|
- spec/models/gateway/usa_epay_transaction_spec.rb
|
493
517
|
- spec/models/gateway/worldpay_spec.rb
|
494
|
-
- spec/models/skrill_transaction_spec.rb
|
495
518
|
- spec/spec_helper.rb
|
496
519
|
- spec/support/wait_for_stripe.rb
|
@@ -1,48 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
class BillingIntegration::Skrill::QuickCheckout < BillingIntegration
|
3
|
-
preference :merchant_id, :string
|
4
|
-
preference :language, :string, :default => 'EN'
|
5
|
-
preference :currency, :string, :default => 'EUR'
|
6
|
-
preference :payment_options, :string, :default => 'ACC'
|
7
|
-
preference :pay_to_email, :string , :default => 'your@merchant.email_here'
|
8
|
-
|
9
|
-
def provider_class
|
10
|
-
ActiveMerchant::Billing::Skrill
|
11
|
-
end
|
12
|
-
|
13
|
-
def redirect_url(order, opts = {})
|
14
|
-
opts.merge! self.preferences
|
15
|
-
|
16
|
-
set_global_options(opts)
|
17
|
-
|
18
|
-
opts[:detail1_text] = order.number
|
19
|
-
opts[:detail1_description] = "Order:"
|
20
|
-
|
21
|
-
opts[:pay_from_email] = order.email
|
22
|
-
opts[:firstname] = order.bill_address.firstname
|
23
|
-
opts[:lastname] = order.bill_address.lastname
|
24
|
-
opts[:address] = order.bill_address.address1
|
25
|
-
opts[:address2] = order.bill_address.address2
|
26
|
-
opts[:phone_number] = order.bill_address.phone.gsub(/\D/,'') if order.bill_address.phone
|
27
|
-
opts[:city] = order.bill_address.city
|
28
|
-
opts[:postal_code] = order.bill_address.zipcode
|
29
|
-
opts[:state] = order.bill_address.state.nil? ? order.bill_address.state_name.to_s : order.bill_address.state.abbr
|
30
|
-
opts[:country] = order.bill_address.country.name
|
31
|
-
opts[:pay_to_email] = self.preferred_pay_to_email
|
32
|
-
opts[:hide_login] = 1
|
33
|
-
opts[:merchant_fields] = 'platform,order_id,payment_method_id'
|
34
|
-
opts[:platform] = 'Spree'
|
35
|
-
opts[:order_id] = order.number
|
36
|
-
|
37
|
-
skrill = self.provider
|
38
|
-
skrill.payment_url(opts)
|
39
|
-
end
|
40
|
-
|
41
|
-
private
|
42
|
-
def set_global_options(opts)
|
43
|
-
opts[:recipient_description] = Spree::Config[:site_name]
|
44
|
-
opts[:payment_methods] = self.preferred_payment_options
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
class SkrillTransaction < ActiveRecord::Base
|
3
|
-
has_many :payments, :as => :source
|
4
|
-
|
5
|
-
def actions
|
6
|
-
[]
|
7
|
-
end
|
8
|
-
|
9
|
-
def self.create_from_postback(params)
|
10
|
-
SkrillTransaction.create(:email => params[:pay_from_email],
|
11
|
-
:amount => params[:mb_amount],
|
12
|
-
:currency => params[:mb_currency],
|
13
|
-
:transaction_id => params[:mb_transaction_id],
|
14
|
-
:customer_id => params[:customer_id],
|
15
|
-
:payment_type => params[:payment_type])
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|
data/config/routes.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Spree::Core::Engine.add_routes do
|
2
|
-
# Add your extension routes here
|
3
|
-
resources :orders, :only => [] do
|
4
|
-
resource :checkout, :controller => 'checkout' do
|
5
|
-
member do
|
6
|
-
get :skrill_cancel
|
7
|
-
get :skrill_return
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
post '/skrill' => 'skrill_status#update'
|
13
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
class CreateSkrillTransactions < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :spree_skrill_transactions do |t|
|
4
|
-
t.string :email
|
5
|
-
t.float :amount
|
6
|
-
t.string :currency
|
7
|
-
t.integer :transaction_id
|
8
|
-
t.integer :customer_id
|
9
|
-
t.string :payment_type
|
10
|
-
t.timestamps null: true
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
class Skrill < Gateway
|
4
|
-
|
5
|
-
def service_url
|
6
|
-
"https://www.moneybookers.com/app/payment.pl"
|
7
|
-
end
|
8
|
-
|
9
|
-
def payment_url(opts)
|
10
|
-
post = PostData.new
|
11
|
-
post.merge! opts
|
12
|
-
|
13
|
-
"#{service_url}?#{post.to_s}"
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
CheckoutController.class_eval do
|
3
|
-
before_filter :confirm_skrill, :only => [:update]
|
4
|
-
|
5
|
-
def skrill_return
|
6
|
-
|
7
|
-
unless @order.payments.where(:source_type => 'Spree::SkrillTransaction').present?
|
8
|
-
payment_method = PaymentMethod.find(params[:payment_method_id])
|
9
|
-
skrill_transaction = SkrillTransaction.new
|
10
|
-
|
11
|
-
payment = @order.payments.create({:amount => @order.total,
|
12
|
-
:source => skrill_transaction,
|
13
|
-
:payment_method => payment_method},
|
14
|
-
:without_protection => true)
|
15
|
-
payment.started_processing!
|
16
|
-
payment.pend!
|
17
|
-
end
|
18
|
-
|
19
|
-
@order.update_attributes({:state => "complete", :completed_at => Time.now}, :without_protection => true)
|
20
|
-
|
21
|
-
until @order.state == "complete"
|
22
|
-
if @order.next!
|
23
|
-
@order.update_with_updater!
|
24
|
-
state_callback(:after)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
@order.finalize!
|
29
|
-
|
30
|
-
flash.notice = Spree.t(:order_processed_successfully)
|
31
|
-
redirect_to completion_route
|
32
|
-
end
|
33
|
-
|
34
|
-
def skrill_cancel
|
35
|
-
flash[:error] = Spree.t(:payment_has_been_cancelled)
|
36
|
-
redirect_to edit_order_path(@order)
|
37
|
-
end
|
38
|
-
|
39
|
-
private
|
40
|
-
def confirm_skrill
|
41
|
-
return unless (params[:state] == "payment") && params[:order] && params[:order][:payments_attributes]
|
42
|
-
|
43
|
-
payment_method = PaymentMethod.find(params[:order][:payments_attributes].first[:payment_method_id])
|
44
|
-
if payment_method.kind_of?(BillingIntegration::Skrill::QuickCheckout)
|
45
|
-
#TODO confirming payment method
|
46
|
-
redirect_to edit_order_checkout_url(@order, :state => 'payment'),
|
47
|
-
:notice => Spree.t(:complete_skrill_checkout)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
class SkrillStatusController < ApplicationController
|
3
|
-
def update
|
4
|
-
@order = Order.find_by_number!(params[:order_id])
|
5
|
-
payment_method = PaymentMethod.find(params[:payment_method_id])
|
6
|
-
skrill_transaction = SkrillTransaction.create_from_postback params
|
7
|
-
|
8
|
-
payment = @order.payments.where(:state => "pending",
|
9
|
-
:payment_method_id => payment_method).first
|
10
|
-
|
11
|
-
if payment
|
12
|
-
payment.source = skrill_transaction
|
13
|
-
payment.save
|
14
|
-
else
|
15
|
-
payment = @order.payments.create(:amount => @order.total,
|
16
|
-
:source => skrill_transaction,
|
17
|
-
:payment_method => payment_method)
|
18
|
-
end
|
19
|
-
|
20
|
-
payment.started_processing!
|
21
|
-
|
22
|
-
unless payment.completed?
|
23
|
-
case params[:status]
|
24
|
-
when "0"
|
25
|
-
payment.pend #may already be pending
|
26
|
-
when "2" #processed / captured
|
27
|
-
payment.complete!
|
28
|
-
when "-1", "-2"
|
29
|
-
payment.failure!
|
30
|
-
else
|
31
|
-
raise "Unexpected payment status"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
render :text => ""
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
<fieldset>
|
2
|
-
<legend><%= Spree.t(:skrill) %></legend>
|
3
|
-
|
4
|
-
<table class="index">
|
5
|
-
<tr>
|
6
|
-
<th colspan="6"><%= Spree.t(:skrill_transaction) %></th>
|
7
|
-
</tr>
|
8
|
-
<tr>
|
9
|
-
<td><label><%= Spree.t(:email) %>:</label></td>
|
10
|
-
<td>
|
11
|
-
<%= payment.source.email %>
|
12
|
-
</td>
|
13
|
-
</tr>
|
14
|
-
<tr>
|
15
|
-
<td><label><%= Spree.t(:skrill_customer_id) %>:</label></td>
|
16
|
-
<td>
|
17
|
-
<%= payment.source.customer_id %>
|
18
|
-
</td>
|
19
|
-
</tr>
|
20
|
-
<tr>
|
21
|
-
<td><label><%= Spree.t(:skrill_transaction_id) %>:</label></td>
|
22
|
-
<td>
|
23
|
-
<%= payment.source.transaction_id %>
|
24
|
-
</td>
|
25
|
-
</tr>
|
26
|
-
<tr>
|
27
|
-
<td><label><%= Spree.t(:skrill_payment_type) %>:</label></td>
|
28
|
-
<td>
|
29
|
-
<%= payment.source.payment_type %>
|
30
|
-
</td>
|
31
|
-
</tr>
|
32
|
-
<tr>
|
33
|
-
<td><label><%= Spree.t(:skrill_payment_currency) %>:</label></td>
|
34
|
-
<td>
|
35
|
-
<%= payment.source.currency %>
|
36
|
-
</td>
|
37
|
-
</tr>
|
38
|
-
</table>
|
39
|
-
</fieldset>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<p data-hook="skrill_quick_checkout"></p>
|
2
|
-
|
3
|
-
<%
|
4
|
-
opts = {}
|
5
|
-
opts[:transaction_id] = "#{@order.number}"
|
6
|
-
opts[:amount] = @order.total
|
7
|
-
opts[:return_url] = skrill_return_order_checkout_url(@order, :token => @order.guest_token,
|
8
|
-
:payment_method_id => payment_method.id)
|
9
|
-
opts[:cancel_url] = skrill_cancel_order_checkout_url(@order, :token => @order.guest_token)
|
10
|
-
opts[:status_url] = skrill_url
|
11
|
-
opts[:payment_method_id] = payment_method.id
|
12
|
-
%>
|
13
|
-
|
14
|
-
<style>
|
15
|
-
iframe.skrill_frame{
|
16
|
-
border: 0px;
|
17
|
-
width: 500px;
|
18
|
-
height: 500px;
|
19
|
-
}
|
20
|
-
</style>
|
21
|
-
|
22
|
-
<fieldset id="skrill_payment__<%= payment_method.id %>" data-hook>
|
23
|
-
<legend><%= Spree.t(:payment_information) %></legend>
|
24
|
-
<iframe id="skrill_frame_<%= payment_method.id %>"
|
25
|
-
class="skrill_frame" src="<%= payment_method.redirect_url @order, opts %>"></iframe>
|
26
|
-
</fieldset>
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe ActiveMerchant::Billing::Skrill do
|
4
|
-
let(:url) { 'https://www.moneybookers.com/app/payment.pl' }
|
5
|
-
|
6
|
-
context '.service_url' do
|
7
|
-
it 'return its url' do
|
8
|
-
expect(subject.service_url).to eq url
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
context '.payment_url' do
|
13
|
-
it 'prepend options to url' do
|
14
|
-
options = { 'hi' => 'you' }
|
15
|
-
expect(subject.payment_url(options)).to eq "#{url}?hi=you"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::BillingIntegration::Skrill::QuickCheckout, focus: true do
|
4
|
-
let(:quick_checkout) { create(:skrill_quick_checkout) }
|
5
|
-
|
6
|
-
context '.provider_class' do
|
7
|
-
it 'is a Billing::Skrill class' do
|
8
|
-
expect(quick_checkout.provider_class).to eq ::ActiveMerchant::Billing::Skrill
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|