spree_gateway 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +35 -93
- data/.gitignore +0 -14
- data/.rspec +0 -1
- data/.travis.yml +0 -22
- data/Gemfile +0 -14
- data/LICENSE +0 -26
- data/README.md +0 -68
- data/Rakefile +0 -14
- data/Versionfile +0 -12
- data/app/controllers/spree/checkout_controller_decorator.rb +0 -51
- data/app/controllers/spree/skrill_status_controller.rb +0 -39
- data/app/models/spree/billing_integration/skrill/quick_checkout.rb +0 -52
- data/app/models/spree/gateway/authorize_net.rb +0 -18
- data/app/models/spree/gateway/authorize_net_cim.rb +0 -134
- data/app/models/spree/gateway/balanced_gateway.rb +0 -68
- data/app/models/spree/gateway/banwire.rb +0 -16
- data/app/models/spree/gateway/beanstream.rb +0 -195
- data/app/models/spree/gateway/braintree_gateway.rb +0 -143
- data/app/models/spree/gateway/card_save.rb +0 -12
- data/app/models/spree/gateway/data_cash.rb +0 -12
- data/app/models/spree/gateway/eway.rb +0 -22
- data/app/models/spree/gateway/fatzebra.rb +0 -17
- data/app/models/spree/gateway/klarna.rb +0 -0
- data/app/models/spree/gateway/linkpoint.rb +0 -30
- data/app/models/spree/gateway/moneris.rb +0 -13
- data/app/models/spree/gateway/pay_junction.rb +0 -18
- data/app/models/spree/gateway/pay_pal_gateway.rb +0 -14
- data/app/models/spree/gateway/payflow_pro.rb +0 -19
- data/app/models/spree/gateway/paymill.rb +0 -15
- data/app/models/spree/gateway/pin_gateway.rb +0 -18
- data/app/models/spree/gateway/sage_pay.rb +0 -13
- data/app/models/spree/gateway/samurai.rb +0 -65
- data/app/models/spree/gateway/secure_pay_au.rb +0 -10
- data/app/models/spree/gateway/stripe_gateway.rb +0 -94
- data/app/models/spree/gateway/usa_epay.rb +0 -11
- data/app/models/spree/gateway/worldpay.rb +0 -96
- data/app/models/spree/payment_decorator.rb +0 -3
- data/app/models/spree/skrill_transaction.rb +0 -21
- data/app/views/spree/admin/payments/source_forms/_quickcheckout.html.erb +0 -8
- data/app/views/spree/admin/payments/source_views/_quickcheckout.html.erb +0 -39
- data/app/views/spree/checkout/payment/_quickcheckout.html.erb +0 -26
- data/config/locales/bg.yml +0 -11
- data/config/locales/de.yml +0 -11
- data/config/locales/en.yml +0 -11
- data/config/locales/sv.yml +0 -11
- data/config/routes.rb +0 -13
- data/db/migrate/20111118164631_create_skrill_transactions.rb +0 -14
- 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/lib/active_merchant/billing/skrill.rb +0 -18
- data/lib/generators/spree_gateway/install/install_generator.rb +0 -28
- data/lib/spree_gateway/engine.rb +0 -41
- data/lib/spree_gateway.rb +0 -3
- data/script/rails +0 -5
- data/spec/factories/payment_method_factory.rb +0 -4
- data/spec/models/gateway/authorize_net_cim_spec.rb +0 -17
- data/spec/models/gateway/authorize_net_spec.rb +0 -17
- data/spec/models/gateway/balanced_gateway_spec.rb +0 -9
- data/spec/models/gateway/banwire_spec.rb +0 -9
- data/spec/models/gateway/braintree_gateway_spec.rb +0 -284
- data/spec/models/gateway/eway_spec.rb +0 -17
- data/spec/models/gateway/fatzebra_spec.rb +0 -47
- data/spec/models/gateway/linkpoint_spec.rb +0 -60
- data/spec/models/gateway/pay_junction_spec.rb +0 -17
- data/spec/models/gateway/payflow_pro_spec.rb +0 -17
- data/spec/models/gateway/pin_gateway_spec.rb +0 -57
- data/spec/models/gateway/stripe_gateway_spec.rb +0 -122
- data/spec/models/gateway/usa_epay_spec.rb +0 -38
- data/spec/spec_helper.rb +0 -34
- data/spree_gateway.gemspec +0 -26
@@ -1,65 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
class Gateway::Samurai < Gateway
|
3
|
-
preference :login, :string
|
4
|
-
preference :password, :string
|
5
|
-
preference :processor_token, :string
|
6
|
-
|
7
|
-
attr_accessible :preferred_login, :preferred_password, :preferred_processor_token
|
8
|
-
|
9
|
-
def provider_class
|
10
|
-
ActiveMerchant::Billing::SamuraiGateway
|
11
|
-
end
|
12
|
-
|
13
|
-
def payment_profiles_supported?
|
14
|
-
true
|
15
|
-
end
|
16
|
-
|
17
|
-
def purchase(money, creditcard, gateway_options)
|
18
|
-
gateway_options[:billing_reference] = gateway_options[:order_id]
|
19
|
-
gateway_options[:customer_reference] = gateway_options[:customer]
|
20
|
-
gateway_options[:description] = "Spree Order"
|
21
|
-
provider.purchase(money, creditcard.gateway_customer_profile_id, gateway_options)
|
22
|
-
end
|
23
|
-
|
24
|
-
def authorize(money, creditcard, gateway_options)
|
25
|
-
gateway_options[:billing_reference] = gateway_options[:order_id]
|
26
|
-
gateway_options[:customer_reference] = gateway_options[:customer]
|
27
|
-
gateway_options[:description] = "Spree Order"
|
28
|
-
provider.authorize(money, creditcard.gateway_customer_profile_id, gateway_options)
|
29
|
-
end
|
30
|
-
|
31
|
-
def capture(authorization, creditcard, gateway_options)
|
32
|
-
gateway_options[:billing_reference] = gateway_options[:order_id]
|
33
|
-
gateway_options[:customer_reference] = gateway_options[:customer]
|
34
|
-
gateway_options[:description] = "Spree Order"
|
35
|
-
provider.capture(nil, authorization.response_code, {})
|
36
|
-
end
|
37
|
-
|
38
|
-
def credit(money, creditcard, response_code, gateway_options)
|
39
|
-
provider.credit(money, response_code, {})
|
40
|
-
end
|
41
|
-
|
42
|
-
def void(response_code, gateway_options)
|
43
|
-
provider.void(response_code, {})
|
44
|
-
end
|
45
|
-
|
46
|
-
def create_profile(payment)
|
47
|
-
return unless payment.source.gateway_customer_profile_id.nil?
|
48
|
-
|
49
|
-
options = {}
|
50
|
-
options[:email] = payment.order.email
|
51
|
-
options[:address] = {}
|
52
|
-
options[:address][:address1] = payment.order.bill_address.address1
|
53
|
-
options[:address][:address2] = payment.order.bill_address.address2
|
54
|
-
options[:address][:city] = payment.order.bill_address.city
|
55
|
-
options[:address][:state] = payment.order.bill_address.state.abbr
|
56
|
-
options[:address][:zip] = payment.order.bill_address.zipcode
|
57
|
-
response = provider.store(payment.source, options)
|
58
|
-
if response.success?
|
59
|
-
payment.source.update_attributes!(:gateway_customer_profile_id => response.params['payment_method_token'])
|
60
|
-
else
|
61
|
-
payment.send(:gateway_error, response.message)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
@@ -1,94 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
class Gateway::StripeGateway < Gateway
|
3
|
-
preference :login, :string
|
4
|
-
|
5
|
-
attr_accessible :preferred_login, :preferred_currency
|
6
|
-
|
7
|
-
def provider_class
|
8
|
-
ActiveMerchant::Billing::StripeGateway
|
9
|
-
end
|
10
|
-
|
11
|
-
def payment_profiles_supported?
|
12
|
-
true
|
13
|
-
end
|
14
|
-
|
15
|
-
def purchase(money, creditcard, gateway_options)
|
16
|
-
provider.purchase(*options_for_purchase_or_auth(money, creditcard, gateway_options))
|
17
|
-
end
|
18
|
-
|
19
|
-
def authorize(money, creditcard, gateway_options)
|
20
|
-
provider.authorize(*options_for_purchase_or_auth(money, creditcard, gateway_options))
|
21
|
-
end
|
22
|
-
|
23
|
-
def capture(payment, creditcard, gateway_options)
|
24
|
-
provider.capture((payment.amount * 100).round, payment.response_code, gateway_options)
|
25
|
-
end
|
26
|
-
|
27
|
-
def credit(money, creditcard, response_code, gateway_options)
|
28
|
-
provider.refund(money, response_code, {})
|
29
|
-
end
|
30
|
-
|
31
|
-
def void(response_code, creditcard, gateway_options)
|
32
|
-
provider.void(response_code, {})
|
33
|
-
end
|
34
|
-
|
35
|
-
def create_profile(payment)
|
36
|
-
return unless payment.source.gateway_customer_profile_id.nil?
|
37
|
-
|
38
|
-
options = {
|
39
|
-
email: payment.order.email,
|
40
|
-
login: preferred_login
|
41
|
-
}.merge! address_for(payment)
|
42
|
-
|
43
|
-
response = provider.store(payment.source, options)
|
44
|
-
if response.success?
|
45
|
-
payment.source.update_attributes!({
|
46
|
-
:gateway_customer_profile_id => response.params['id'],
|
47
|
-
:gateway_payment_profile_id => response.params['default_card']
|
48
|
-
})
|
49
|
-
else
|
50
|
-
payment.send(:gateway_error, response.message)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
private
|
55
|
-
|
56
|
-
def options_for_purchase_or_auth(money, creditcard, gateway_options)
|
57
|
-
options = {}
|
58
|
-
options[:description] = "Spree Order ID: #{gateway_options[:order_id]}"
|
59
|
-
options[:currency] = gateway_options[:currency]
|
60
|
-
|
61
|
-
if customer = creditcard.gateway_customer_profile_id
|
62
|
-
options[:customer] = customer
|
63
|
-
end
|
64
|
-
if token_or_card_id = creditcard.gateway_payment_profile_id
|
65
|
-
# The Stripe ActiveMerchant gateway supports passing the token directly as the creditcard parameter
|
66
|
-
# The Stripe ActiveMerchant gateway supports passing the customer_id and credit_card id
|
67
|
-
# https://github.com/Shopify/active_merchant/issues/770
|
68
|
-
creditcard = token_or_card_id
|
69
|
-
end
|
70
|
-
return money, creditcard, options
|
71
|
-
end
|
72
|
-
|
73
|
-
def address_for(payment)
|
74
|
-
{}.tap do |options|
|
75
|
-
if address = payment.order.bill_address
|
76
|
-
options.merge!(address: {
|
77
|
-
address1: address.address1,
|
78
|
-
address2: address.address2,
|
79
|
-
city: address.city,
|
80
|
-
zip: address.zipcode
|
81
|
-
})
|
82
|
-
|
83
|
-
if country = address.country
|
84
|
-
options[:address].merge!(country: country.name)
|
85
|
-
end
|
86
|
-
|
87
|
-
if state = address.state
|
88
|
-
options[:address].merge!(state: state.name)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
@@ -1,96 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
class Gateway::Worldpay < Gateway
|
3
|
-
preference :login, :string
|
4
|
-
preference :password, :string
|
5
|
-
preference :currency, :string, :default => 'GBP'
|
6
|
-
preference :installation_id, :string
|
7
|
-
|
8
|
-
preference :american_express_login, :string
|
9
|
-
preference :discover_login, :string
|
10
|
-
preference :jcb_login, :string
|
11
|
-
preference :mastercard_login, :string
|
12
|
-
preference :maestro_login, :string
|
13
|
-
preference :visa_login, :string
|
14
|
-
|
15
|
-
attr_accessible :preferred_login, :preferred_password, :preferred_currency,
|
16
|
-
:preferred_installation_id, :preferred_american_express_login,
|
17
|
-
:preferred_discover_login, :preferred_jcb_login, :preferred_maestro_login,
|
18
|
-
:preferred_mastercard_login, :preferred_visa_login
|
19
|
-
|
20
|
-
def provider_class
|
21
|
-
ActiveMerchant::Billing::WorldpayGateway
|
22
|
-
end
|
23
|
-
|
24
|
-
def purchase(money, credit_card, options = {})
|
25
|
-
provider = credit_card_provider(credit_card, options)
|
26
|
-
provider.purchase(money, credit_card, options)
|
27
|
-
end
|
28
|
-
|
29
|
-
def authorize(money, credit_card, options = {})
|
30
|
-
provider = credit_card_provider(credit_card, options)
|
31
|
-
provider.authorize(money, credit_card, options)
|
32
|
-
end
|
33
|
-
|
34
|
-
def capture(money, authorization, options = {})
|
35
|
-
provider = credit_card_provider(auth_credit_card(authorization), options)
|
36
|
-
provider.capture(money, authorization, options)
|
37
|
-
end
|
38
|
-
|
39
|
-
def refund(money, authorization, options = {})
|
40
|
-
provider = credit_card_provider(auth_credit_card(authorization), options)
|
41
|
-
provider.refund(money, authorization, options)
|
42
|
-
end
|
43
|
-
|
44
|
-
def credit(money, authorization, options = {})
|
45
|
-
refund(money, authorization, options)
|
46
|
-
end
|
47
|
-
|
48
|
-
def void(authorization, options = {})
|
49
|
-
provider = credit_card_provider(auth_credit_card(authorization), options)
|
50
|
-
provider.void(authorization, options)
|
51
|
-
end
|
52
|
-
|
53
|
-
private
|
54
|
-
|
55
|
-
def options_for_card(credit_card, options)
|
56
|
-
options[:login] = login_for_card(credit_card)
|
57
|
-
options = options().merge( options )
|
58
|
-
end
|
59
|
-
|
60
|
-
def auth_credit_card(authorization)
|
61
|
-
Spree::Payment.find_by_response_code(authorization).source
|
62
|
-
end
|
63
|
-
|
64
|
-
def credit_card_provider(credit_card, options = {})
|
65
|
-
gateway_options = options_for_card(credit_card, options)
|
66
|
-
gateway_options.delete :login if gateway_options.has_key?(:login) and gateway_options[:login].nil?
|
67
|
-
gateway_options[:currency] = self.preferred_currency
|
68
|
-
gateway_options[:inst_id] = self.preferred_installation_id
|
69
|
-
ActiveMerchant::Billing::Base.gateway_mode = gateway_options[:server].to_sym
|
70
|
-
@provider = provider_class.new(gateway_options)
|
71
|
-
end
|
72
|
-
|
73
|
-
def login_for_card(card)
|
74
|
-
case card.brand
|
75
|
-
when 'american_express'
|
76
|
-
choose_login preferred_american_express_login
|
77
|
-
when 'discover'
|
78
|
-
choose_login preferred_discover_login
|
79
|
-
when 'jcb'
|
80
|
-
choose_login preferred_jcb_login
|
81
|
-
when 'maestro'
|
82
|
-
choose_login preferred_maestro_login
|
83
|
-
when 'master'
|
84
|
-
choose_login preferred_mastercard_login
|
85
|
-
when 'visa'
|
86
|
-
choose_login preferred_visa_login
|
87
|
-
else
|
88
|
-
preferred_login
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
def choose_login(login)
|
93
|
-
return login ? login : preferred_login
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
class SkrillTransaction < ActiveRecord::Base
|
3
|
-
has_many :payments, :as => :source
|
4
|
-
|
5
|
-
attr_accessible :email , :amount , :currency , :transaction_id , :customer_id, :payment_type
|
6
|
-
|
7
|
-
def actions
|
8
|
-
[]
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.create_from_postback(params)
|
12
|
-
SkrillTransaction.create(:email => params[:pay_from_email],
|
13
|
-
:amount => params[:mb_amount],
|
14
|
-
:currency => params[:mb_currency],
|
15
|
-
:transaction_id => params[:mb_transaction_id],
|
16
|
-
:customer_id => params[:customer_id],
|
17
|
-
:payment_type => params[:payment_type])
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
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.token,
|
8
|
-
:payment_method_id => payment_method.id)
|
9
|
-
opts[:cancel_url] = skrill_cancel_order_checkout_url(@order, :token => @order.token)
|
10
|
-
opts[:status_url] = skrill_status_update_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>
|
data/config/locales/bg.yml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
---
|
2
|
-
bg:
|
3
|
-
spree:
|
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
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
---
|
2
|
-
de:
|
3
|
-
spree:
|
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
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
---
|
2
|
-
en:
|
3
|
-
spree:
|
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
|
data/config/locales/sv.yml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
---
|
2
|
-
sv:
|
3
|
-
spree:
|
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
|
data/config/routes.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Spree::Core::Engine.routes.draw do
|
2
|
-
# Add your extension routes here
|
3
|
-
resources :orders 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
|
-
match '/skrill' => 'skrill_status#update', :via => :post, :as => :skrill_status_update
|
13
|
-
end
|
@@ -1,14 +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
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class UpdateBraintreePaymentMethodType < ActiveRecord::Migration
|
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 < ActiveRecord::Migration
|
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 < ActiveRecord::Migration
|
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 < ActiveRecord::Migration
|
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,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,28 +0,0 @@
|
|
1
|
-
module SpreeGateway
|
2
|
-
module Generators
|
3
|
-
class InstallGenerator < Rails::Generators::Base
|
4
|
-
class_option :auto_run_migrations, type: :boolean, default: false
|
5
|
-
|
6
|
-
def add_migrations
|
7
|
-
run 'bundle exec rake railties:install:migrations FROM=spree_gateway'
|
8
|
-
end
|
9
|
-
|
10
|
-
def run_migrations
|
11
|
-
if running_migrations?
|
12
|
-
run 'bundle exec rake db:migrate'
|
13
|
-
else
|
14
|
-
puts "Skiping rake db:migrate, don't forget to run it!"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
def running_migrations?
|
21
|
-
options.auto_run_migrations? || begin
|
22
|
-
response = ask 'Would you like to run the migrations now? [Y/n]'
|
23
|
-
['', 'y'].include? response.downcase
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
data/lib/spree_gateway/engine.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
module SpreeGateway
|
2
|
-
class Engine < Rails::Engine
|
3
|
-
engine_name 'spree_gateway'
|
4
|
-
|
5
|
-
config.autoload_paths += %W(#{config.root}/lib)
|
6
|
-
|
7
|
-
# use rspec for tests
|
8
|
-
config.generators do |g|
|
9
|
-
g.test_framework :rspec
|
10
|
-
end
|
11
|
-
|
12
|
-
initializer "spree.gateway.payment_methods", :after => "spree.register.payment_methods" do |app|
|
13
|
-
app.config.spree.payment_methods << Spree::Gateway::AuthorizeNetCim
|
14
|
-
app.config.spree.payment_methods << Spree::Gateway::AuthorizeNet
|
15
|
-
app.config.spree.payment_methods << Spree::Gateway::CardSave
|
16
|
-
app.config.spree.payment_methods << Spree::Gateway::Eway
|
17
|
-
app.config.spree.payment_methods << Spree::Gateway::Fatzebra
|
18
|
-
app.config.spree.payment_methods << Spree::Gateway::Linkpoint
|
19
|
-
app.config.spree.payment_methods << Spree::Gateway::Moneris
|
20
|
-
app.config.spree.payment_methods << Spree::Gateway::PayJunction
|
21
|
-
app.config.spree.payment_methods << Spree::Gateway::PayPalGateway
|
22
|
-
app.config.spree.payment_methods << Spree::Gateway::SagePay
|
23
|
-
app.config.spree.payment_methods << Spree::Gateway::Beanstream
|
24
|
-
app.config.spree.payment_methods << Spree::Gateway::BraintreeGateway
|
25
|
-
app.config.spree.payment_methods << Spree::Gateway::StripeGateway
|
26
|
-
app.config.spree.payment_methods << Spree::Gateway::Samurai
|
27
|
-
app.config.spree.payment_methods << Spree::Gateway::Worldpay
|
28
|
-
app.config.spree.payment_methods << Spree::Gateway::Banwire
|
29
|
-
app.config.spree.payment_methods << Spree::Gateway::UsaEpay
|
30
|
-
app.config.spree.payment_methods << Spree::BillingIntegration::Skrill::QuickCheckout
|
31
|
-
app.config.spree.payment_methods << Spree::Gateway::BalancedGateway
|
32
|
-
app.config.spree.payment_methods << Spree::Gateway::DataCash
|
33
|
-
app.config.spree.payment_methods << Spree::Gateway::UsaEpay
|
34
|
-
app.config.spree.payment_methods << Spree::Gateway::PinGateway
|
35
|
-
app.config.spree.payment_methods << Spree::Gateway::Paymill
|
36
|
-
app.config.spree.payment_methods << Spree::Gateway::PayflowPro
|
37
|
-
app.config.spree.payment_methods << Spree::Gateway::SecurePayAU
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
data/lib/spree_gateway.rb
DELETED
data/script/rails
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::Gateway::AuthorizeNetCim do
|
4
|
-
let (:gateway) { Spree::Gateway::AuthorizeNetCim.new }
|
5
|
-
|
6
|
-
describe "options" do
|
7
|
-
it "should include :test => true when :test_mode is true" do
|
8
|
-
gateway.preferred_test_mode = true
|
9
|
-
gateway.options[:test].should == true
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should not include :test when :test_mode is false" do
|
13
|
-
gateway.preferred_test_mode = false
|
14
|
-
gateway.options[:test].should be_nil
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::Gateway::AuthorizeNet do
|
4
|
-
let (:gateway) { Spree::Gateway::AuthorizeNet.create!(:name => "Authorize.net") }
|
5
|
-
|
6
|
-
describe "options" do
|
7
|
-
it "should include :test => true when :test_mode is true" do
|
8
|
-
gateway.preferred_test_mode = true
|
9
|
-
gateway.options[:test].should == true
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should not include :test when test_mode is false" do
|
13
|
-
gateway.preferred_test_mode = false
|
14
|
-
gateway.options[:test].should == false
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Spree::Gateway::BalancedGateway do
|
4
|
-
let(:gateway) { Spree::Gateway::BalancedGateway.create!(:name => "Balanced") }
|
5
|
-
|
6
|
-
it "should be Balanced gateway" do
|
7
|
-
gateway.provider_class.should == ::ActiveMerchant::Billing::BalancedGateway
|
8
|
-
end
|
9
|
-
end
|