using a base class for paypal express

This commit is contained in:
Bounmy Stephane 2012-05-31 08:54:05 +02:00
parent 3d5af5bdaf
commit 26da577090
3 changed files with 21 additions and 34 deletions

View File

@ -1,19 +1,3 @@
class Spree::BillingIntegration::PaypalExpress < Spree::BillingIntegration
preference :login, :string
preference :password, :password
preference :signature, :string
preference :review, :boolean, :default => false
preference :no_shipping, :boolean, :default => false
class Spree::BillingIntegration::PaypalExpress < Spree::BillingIntegration::PaypalExpressBase
preference :currency, :string, :default => 'USD'
preference :allow_guest_checkout, :boolean, :default => false
attr_accessible :preferred_login, :preferred_password, :preferred_signature, :preferred_review, :preferred_no_shipping, :preferred_currency, :preferred_allow_guest_checkout, :preferred_server, :preferred_test_mode
def provider_class
ActiveMerchant::Billing::PaypalExpressGateway
end
def payment_profiles_supported?
!!preferred_review
end
end

View File

@ -0,0 +1,19 @@
class Spree::BillingIntegration::PaypalExpressBase < Spree::BillingIntegration
preference :login, :string
preference :password, :password
preference :signature, :string
preference :review, :boolean, :default => false
preference :no_shipping, :boolean, :default => false
preference :currency, :string, :default => 'USD'
preference :allow_guest_checkout, :boolean, :default => false
attr_accessible :preferred_login, :preferred_password, :preferred_signature, :preferred_review, :preferred_no_shipping, :preferred_currency, :preferred_allow_guest_checkout, :preferred_server, :preferred_test_mode
def provider_class
ActiveMerchant::Billing::PaypalExpressGateway
end
def payment_profiles_supported?
!!preferred_review
end
end

View File

@ -1,19 +1,3 @@
class Spree::BillingIntegration::PaypalExpressUk < Spree::BillingIntegration
preference :login, :string
preference :password, :password
preference :signature, :string
preference :review, :boolean, :default => false
preference :no_shipping, :boolean, :default => false
class Spree::BillingIntegration::PaypalExpressUk < Spree::BillingIntegration::PaypalExpressBase
preference :currency, :string, :default => 'GBP'
preference :allow_guest_checkout, :boolean, :default => false
attr_accessible :preferred_login, :preferred_password, :preferred_signature, :preferred_review, :preferred_currency, :preferred_no_shipping, :preferred_server, :preferred_test_mode
def provider_class
ActiveMerchant::Billing::PaypalExpressGateway
end
def payment_profiles_supported?
!!preferred_review
end
end