forked from solidusio/solidus_paypal_braintree
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
paypal_button_preference
helper method
Ref. solidusio#251 Using `Spree::CheckoutController.helper` and `Spree::OrdersController.helper` in `config/initializers/braintree.rb` to include helper modules does not work: at `checkout/payement` step an exception is raised ``` ActionView::Template::Error (undefined method `paypal_button_preference`) ``` This commit move `paypal_button_preferences` (introduced with [1]) in the already present `SolidusPaypalBraintree::BraintreeCheckoutHelper` module, and adds the same helper method to the `Spree::OrdersController` (in the same way done here [2]) to enable the button also in the cart page. [1] solidusio#236 [2] solidusio@28d0de9
- Loading branch information
Flavio Auciello
committed
Oct 15, 2020
1 parent
a00774c
commit a6e44bd
Showing
4 changed files
with
13 additions
and
10 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
app/controllers/solidus_paypal_braintree/orders_controller_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module SolidusPaypalBraintree | ||
module OrdersControllerDecorator | ||
|
||
def self.prepended(base) | ||
base.helper ::SolidusPaypalBraintree::BraintreeCheckoutHelper | ||
end | ||
|
||
::Spree::OrdersController.prepend(self) | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
if SolidusSupport.backend_available? | ||
Spree::Admin::PaymentsController.helper :braintree_admin | ||
end | ||
|
||
if SolidusSupport.frontend_available? | ||
Spree::CheckoutController.helper :braintree_checkout | ||
Spree::OrdersController.helper :braintree_checkout | ||
end |