This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 76
Conversation
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
MinasMazar
force-pushed
the
mm/fix-helpers
branch
3 times, most recently
from
March 6, 2020 17:58
7ef9e2e
to
bde273c
Compare
elia
suggested changes
Mar 13, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nit
if SolidusSupport.frontend_available? | ||
Spree::CheckoutController.helper :braintree_checkout | ||
Spree::OrdersController.helper :braintree_checkout | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you deal with this in a separate PR?
Maybe check if the backend helper above can also be removed. 🙏
@MinasMazar Would you have some time to finish this PR? I'm starting to work on this repo a bit, and this is definitely a big issue! If not, just let me know - I can take over the excellent work done here. Thanks! |
MinasMazar
force-pushed
the
mm/fix-helpers
branch
2 times, most recently
from
October 9, 2020 17:38
43ab3c5
to
776d244
Compare
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
As for the frontend helper methods in the previous commit, using `Spree::Admin::PaymentsController.helper` in `config/initializers/braintree.rb` does not work: at `checkout/payement` step an exception is raised. ``` ActionView::Template::Error (undefined method `braintree_transaction_link`) ``` This commit firstly move the helper module in the appropriate namespace (i.e. `SolidusPaypalBraintree`), then inject into the controller via a custom decorator. This way the exception is no longer raised.
MinasMazar
force-pushed
the
mm/fix-helpers
branch
from
October 15, 2020 12:58
776d244
to
69923ed
Compare
kennyadsl
approved these changes
Oct 15, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should fix #251
Using
Spree::CheckoutController.helper
andSpree::OrdersController.helper
inconfig/initializers/braintree.rb
to include helper modules does not work: atcheckout/payement
step an exception is raisedThis commit move
paypal_button_preferences
(introduced in #236) in the already presentSolidusPaypalBraintree::BraintreeCheckoutHelper
module.The same is fix is done for the
BraintreeAdminHelper
module, which was affected by the same bug.