diff --git a/app/models/spree/billing_integration/paypal_express.rb b/app/models/spree/billing_integration/paypal_express.rb index 389e162..572f19e 100644 --- a/app/models/spree/billing_integration/paypal_express.rb +++ b/app/models/spree/billing_integration/paypal_express.rb @@ -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 diff --git a/app/models/spree/billing_integration/paypal_express_base.rb b/app/models/spree/billing_integration/paypal_express_base.rb new file mode 100644 index 0000000..4a81256 --- /dev/null +++ b/app/models/spree/billing_integration/paypal_express_base.rb @@ -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 \ No newline at end of file diff --git a/app/models/spree/billing_integration/paypal_express_uk.rb b/app/models/spree/billing_integration/paypal_express_uk.rb index 2c18503..3dc9a79 100644 --- a/app/models/spree/billing_integration/paypal_express_uk.rb +++ b/app/models/spree/billing_integration/paypal_express_uk.rb @@ -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