From 361a31ea76b8d6a899badfca4b6f5d59d2356729 Mon Sep 17 00:00:00 2001 From: Frederic Jean Date: Wed, 1 Oct 2014 11:40:09 -0600 Subject: [PATCH] Creating a no_shipping preference to give the store developer a say in whether to send the shipping address. In reference to #113 --- app/controllers/spree/paypal_controller.rb | 2 +- app/models/spree/gateway/pay_pal_express.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/spree/paypal_controller.rb b/app/controllers/spree/paypal_controller.rb index aef1d921..405d45bb 100644 --- a/app/controllers/spree/paypal_controller.rb +++ b/app/controllers/spree/paypal_controller.rb @@ -95,7 +95,7 @@ def express_checkout_request_details order, items :SolutionType => payment_method.preferred_solution.present? ? payment_method.preferred_solution : "Mark", :LandingPage => payment_method.preferred_landing_page.present? ? payment_method.preferred_landing_page : "Billing", :cppheaderimage => payment_method.preferred_logourl.present? ? payment_method.preferred_logourl : "", - :NoShipping => 1, + :NoShipping => payment_method.preferred_no_shipping.present? ? (payment_method.preferred_no_shipping ? 1 : 0) : 1, :PaymentDetails => [payment_details(items)] }} end diff --git a/app/models/spree/gateway/pay_pal_express.rb b/app/models/spree/gateway/pay_pal_express.rb index f9086cb6..003436bd 100644 --- a/app/models/spree/gateway/pay_pal_express.rb +++ b/app/models/spree/gateway/pay_pal_express.rb @@ -8,6 +8,7 @@ class Gateway::PayPalExpress < Gateway preference :solution, :string, default: 'Mark' preference :landing_page, :string, default: 'Billing' preference :logourl, :string, default: '' + preference :no_shipping, :boolean, default: true def supports?(source) true