benmorganio
06/14/2022, 8:37 PMJared Norman
Rasmus Styrk
06/17/2022, 7:06 AMRasmus Styrk
06/17/2022, 7:07 AMdiff --git a/app/controllers/spree/checkout_controller.rb b/app/controllers/spree/checkout_controller.rb
index dcfee9c..05654d8 100644
--- a/app/controllers/spree/checkout_controller.rb
+++ b/app/controllers/spree/checkout_controller.rb
@@ -189,11 +189,11 @@ module Spree
end
def setup_for_current_state
- method_name = :"before_#{@order.state}"
+ method_name = :"before_#{@order.state}_test"
send(method_name) if respond_to?(method_name, true)
end
- def before_address
+ def before_address_test
@order.assign_default_user_addresses
# If the user has a default address, the previous method call takes care
# of setting that; but if he doesn't, we need to build an empty one here
@@ -201,14 +201,14 @@ module Spree
@order.ship_address ||= Spree::Address.build_default if @order.checkout_steps.include?('delivery')
end
- def before_delivery
+ def before_delivery_test
return if params[:order].present?
packages = @order.shipments.map(&:to_package)
@differentiator = Spree::Stock::Differentiator.new(@order, packages)
end
- def before_payment
+ def before_payment_test
if @order.checkout_steps.include? "delivery"
packages = @order.shipments.map(&:to_package)
@differentiator = Spree::Stock::Differentiator.new(@order, packages)
juan
06/17/2022, 3:46 PMTyler Kocheff
06/17/2022, 6:58 PMKevin I
06/17/2022, 9:28 PMAlexander V
06/21/2022, 8:43 AMRasmus Styrk
06/21/2022, 7:01 PMclass ManagerPermissions < ::Spree::PermissionSets::Base
def activate!
can :manage, :all
cannot :manage, :reports
cannot :manage, :general_settings
cannot [:read, :admin], Spree::TaxCategory
cannot [:read, :admin], Spree::TaxRate
cannot [:read, :admin], Spree::Zone
cannot [:read, :admin], Spree::Country
cannot [:read, :admin], Spree::State
cannot [:read, :admin], Spree::PaymentMethod
cannot [:read, :admin], Spree::Taxonomy
cannot [:read, :admin], Spree::ShippingMethod
cannot [:read, :admin], Spree::ShippingCategory
cannot [:read, :admin], Spree::StockLocation
cannot [:read, :admin], Spree::StockMovement
cannot [:read, :admin], Spree::RefundReason
cannot [:read, :admin], Spree::ReimbursementType
cannot [:read, :admin], Spree::ReturnReason
cannot [:read, :admin], Spree::Refund
cannot [:read, :admin], Spree::Store
cannot [:read, :admin], Spree::StockItem
cannot [:read, :admin], Spree::StockLocation
end
end
But for some reason Settings and Refunds and returns is still visibleRasmus Styrk
06/21/2022, 7:01 PMAlexander V
06/21/2022, 9:03 PMAlexander V
06/22/2022, 12:24 PMAlexander V
06/22/2022, 12:28 PMAlexander V
06/22/2022, 4:59 PMconfig.assets.debug = false
setting this to false makes no difference in page load speed.Georg Keferböck
06/23/2022, 4:14 PMJonathan Zisser
06/23/2022, 8:47 PMsolidus_paypal_braintree
here? It concerns the “What’s This?” link under the Card Code field. It seems to link to a route in my app that doesn’t exist. It routes to /content/cvv.jakemumu
06/27/2022, 4:29 PMPrabu
06/28/2022, 11:39 AMRajeswari
06/28/2022, 1:33 PMgerritwessels
06/30/2022, 6:31 PMgerritwessels
06/30/2022, 6:32 PMGiven Reed
07/01/2022, 2:24 PMDirk Coetzer
07/04/2022, 9:32 AMOleksandr Pozniak
07/04/2022, 2:31 PMCuneyt Ergun
07/05/2022, 11:18 AMCuneyt Ergun
07/05/2022, 11:20 AMbubbaspaarx
07/05/2022, 11:27 AMGiven Reed
07/06/2022, 2:45 PMorder_serializer
to add in the new data when it's a braintree order.
The problem I'm running into is that I can't seem to get my test code to fire.
I've got a decorator for the order_serializer
already making some changes to some things, so I know that the decorator works.
To try to do some debugging I've updated order_concerns.rb
from
included do
Spree::Order.state_machine.after_transition to: :complete, unless: :approved? do |order, transition|
if order.send_to_signifyd?
SolidusSignifyd.create_case(order_number: order.number)
else
SolidusSignifyd.approve(order: order)
end
end
has_one :signifyd_order_score, class_name: "SolidusSignifyd::OrderScore"
prepend(InstanceMethods)
end
to
included do
<http://Rails.logger.info|Rails.logger.info> "included"
Spree::Order.state_machine.after_transition to: :complete do |order, transition|
<http://Rails.logger.info|Rails.logger.info> "Send to Signifyd? (#{order.number})"
if order.approved?
<http://Rails.logger.info|Rails.logger.info> "#{order.number} already approved"
elsif order.send_to_signifyd?
SolidusSignifyd.create_case(order_number: order.number)
else
SolidusSignifyd.approve(order: order)
end
end
has_one :signifyd_order_score, class_name: "SolidusSignifyd::OrderScore"
prepend(InstanceMethods)
end
I see "included" in the logs, but nothing else. The orders get into the "complete" state, I see "Order R686426609 transitioned from confirm to complete via complete" in the logs and all that, but it doesn't seem to trigger any of the "after_transition" code in that file.
I'm sure there's something I'm missing about concerns or the state_machine, but I'm at a loss as to what it could be. Any pointers would be greatly appreciated!Zachary Jones
07/06/2022, 6:52 PMshipments.select(&:can_transition_to_shipped?).each(&:shipped!)
Zachary Jones
07/06/2022, 6:53 PM