- 🇮🇱Israel jsacksick
Can we get an MR that applies to 3.x so we can see if the tests are green? The latest patch includes unrelated changes to the CartManager too.
- 🇧🇦Bosnia and Herzegovina nno
Here is the patch for 3.x without changes to the CartManager.
- @nno opened merge request.
- First commit to issue fork.
- 🇳🇴Norway zaporylie
I rebased the MR, reviewed it, and provided necessary updates, including fixes to code and tests. The current test actually revealed an issue with the owner check, which is now corrected.
- 🇮🇱Israel jsacksick
I left a quick comment for a minor change with the controller. (using $commerce_payment_method directly).
Also any idea why the tests are failing?
- 🇮🇱Israel jsacksick
Ok... tests aren't passing...
The following code looks wrong to me:
elseif (count($storage->loadMultipleByUser($this->getOwner())) == 1) { // Set as default if it is the only payment method for the user. $this->setDefault(TRUE); $this->save(); }
This doesn't belong to the postSave() method, as this will resave a payment method that was just saved, this should be moved to the presave().
- 🇳🇴Norway zaporylie
Added test coverage for the PaymentOptionsBuilder.
There are 2 things that should likely be addressed:
1) non-reusable payment methods should never be set as default.
2) deleting default payment method should make the next eligible payment method defaultBoth these points can be done as follow-up(s) and need some extra considerations.
-
jsacksick →
committed ed78537c on 3.x authored by
nno →
[#2790533] feat: Add the ability to set a default payment method By:...
-
jsacksick →
committed ed78537c on 3.x authored by
nno →
Now that this issue is closed, please review the contribution record.
As a contributor, attribute any organization helped you, or if you volunteered your own time.
Maintainers, please credit people who helped resolve this issue.
- Issue was unassigned.
- Status changed to Fixed
19 days ago 12:49pm 18 September 2025