Remove Spree::Order#add_default_payment_from_wallet checkout transition - #4185
Remove Spree::Order#add_default_payment_from_wallet checkout transition#4185danielpuglisi wants to merge 2 commits into
Conversation
|
This is related to #2680. |
adammathys
left a comment
There was a problem hiding this comment.
This generally seems reasonable to me. (Removing the add_default_payment_from_wallet method.) I can't see any reason why we would ever want that extra invalid payment and we're always going to create a new one during the payment step of checkout.
I think we should probably start by deprecating the method instead of outright removing it. (Along with maybe deprecating the Spree::Config.default_payment_builder_class config option and corresponding class.) Just in case there's anyone out there relying on this behaviour for some reason.
Then we could add a new configuration option to skip this callback step for everyone ready to remove this functionality ahead of it being removed in a future release. e.g.:
unless Spree::Config.disable_adding_default_payment_to_order
before_transition to: :payment, do: :add_default_payment_from_wallet
end|
@adammathys makes sense. If there are no other concerns, I'll gladly put something together. |
|
Thanks @danielpuglisi (and @adammathys), that would be great! |
ec4bdf3 to
e53cc37
Compare
…heckout transition
…default_payment_from_wallet deprecation warnings
a90bbe9 to
053acba
Compare
|
Finally got the time to take a jab at this. Added the deprecation preference and warnings based on @adammathys suggestion. The current default preference although creates a lot of noise when running the specs. What is the preferred way to handle this? |
|
We appreciate your contribution, @danielpuglisi. After talking with @kennyadsl, we decided to put it on hold for the meantime. It looks like a legit change, although it's entirely possible it'd break some extensions. We feel we need to define a clear path for the evolution of the payment system before introducing more changes. |
|
I understand. Let me know if I can be of any help in the future. |
|
Hey @danielpuglisi, first of all thanks for the PR and sorry for taking so long to come back on this. We'd love to move this forward because this is annoying on all levels (Admin UX and for the developer). We have a couple of things left to do before we can merge this:
Please let us know if you have time to take care of these last things otherwise, we will happily take over this work as soon as we have some availability. Thanks again! 🙏 |
|
Hey @kennyadsl. I'm a bit flooded right now. Feel free to take over if you get the time and I haven't done anything. |
|
I'm closing this in favour of #6564. @adammathys is working on broadly improving how payments are handled and this approach is incompatible with his, (besides being suuuuper stale). With payment reuse, we don't need to remove |
This PR is still work in progress.
I'm currently building a shop with solidus and found some logic that seems unnecessary that originated from a 7 year old PR from before the fork: spree/spree#5148
The current behaviour is this:
deliverytopaymentstateconfirmstateMy expectations would be one of the following:
I started this PR by removing
Spree::Order#add_default_payment_from_walletto see what breaks. So far only the spec removed in this commit have been affected but it seems to me that these are directly tied to the creation of the default payment source and have no further use. The only spec I'm unsure about is the one about assigning a billing address if none exists yet, but I can't think of a scenario where this should be the case.Another thing the removal of
Spree::Order#add_default_payment_from_walletwould affect is that it makes Spree::Wallet::DefaultPaymentBuilder obsolete. So I guess there is a concern about breaking compatibility with existing shops that rely on that one. Although I'm not sure what a use case could be.Checklist: