Reduce permitted attributes for cart update - #6636
Merged
jarednorman merged 1 commit intoSep 18, 2026
Merged
jarednorman merged 1 commit into
jarednorman merged 1 commit into
Conversation
The storefront cart controller was using the permitted_order_attributes which allow for editing address, delivery, payment, confirm, and line item attributes. However, the cart endpoint is only actively used to update line item quantities. Furthermore, some of the attributes that it permits aren't actually usable by this endpoint. For example, passing payment attributes is entirely useless outside of creating new check payments. All other payment methods require a source and it's not possible to pass through source_attributes in this method because it doesn't make use of the PaymentCreate object that handles setting up the source from the attributes. (And you can't modify existing payments because ID is not a valid attribute.) The only allowed attributes moving forward are: - Customer metadata - Email (our specs establish this as a valid attribute, so I've left it in.) - Line item attributes (the primary use-case) If an app still needs or wants to use the cart controller for updating other attributes, they can easily add more to the permitted_cart_attributes method.
adammathys
force-pushed
the
bug/reduce-permitted-attributes-cart-update
branch
from
September 17, 2026 22:39
9a7f6a8 to
1030aaa
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6636 +/- ##
=======================================
Coverage 92.33% 92.33%
=======================================
Files 1050 1050
Lines 21367 21369 +2
=======================================
+ Hits 19729 19731 +2
Misses 1638 1638 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jarednorman
approved these changes
Sep 18, 2026
tvdeyen
approved these changes
Sep 18, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The storefront cart controller was using the
permitted_order_attributeswhich allow for editing address, delivery, payment, confirm, and line item attributes. However, the cart endpoint is only actively used to update line item quantities.Furthermore, some of the attributes that it permits aren't actually usable by this endpoint. For example, passing payment attributes is entirely useless outside of creating new check payments. All other payment methods require a source and it's not possible to pass through
source_attributesin this method because it doesn't make use of thePaymentCreateobject that handles setting up the source from the attributes. (And you can't modify existing payments because ID is not a valid attribute.)The only allowed attributes moving forward are:
If an app still needs or wants to use the cart controller for updating other attributes, they can easily add more to the
permitted_cart_attributesmethod.Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs: