{"record":{"id":"2dc8d3cf1dd99bec","repo":"spree/spree","slug":"spree-order-collect-frontend-payment-methods-is-d","errorCode":null,"errorMessage":"Spree::Order#collect_frontend_payment_methods is deprecated and will be removed in Spree 6.1. Use #payment_methods instead.","messagePattern":"Spree::Order#collect_frontend_payment_methods is deprecated and will be removed in Spree 6\\.1\\. Use #payment_methods instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"spree/core/app/models/spree/order.rb","lineNumber":142,"sourceCode":"    validates :status, inclusion: { in: STATUSES }\n\n    scope :drafts,         -> { where(status: 'draft') }\n    scope :placed_orders,  -> { where(status: 'placed') }\n    scope :canceled_orders, -> { where(status: 'canceled') }\n\n    acts_as_taggable_on :tags\n    acts_as_taggable_tenant :store_id\n\n    def tags=(tags)\n      self.tag_list = tags\n    end\n\n    ASSOCIATED_CUSTOMER_ATTRIBUTES = [:customer_id, :email, :bill_address_id, :ship_address_id]\n\n    # @deprecated Use {Spree::Purchase::PaymentProcessing#payment_methods};\n    #   removed in 6.1.\n    def collect_frontend_payment_methods\n      Spree::Deprecation.warn('Spree::Order#collect_frontend_payment_methods is deprecated and will be removed in Spree 6.1. Use #payment_methods instead.')\n      payment_methods\n    end\n\n    include Spree::DeprecatedCustomerAlias\n\n    belongs_to :customer, class_name: \"::#{Spree.customer_class}\", optional: true, autosave: true\n    # The cart this order was completed from (unique — the completion\n    # idempotency key). Backoffice draft orders have no cart.\n    belongs_to :cart, class_name: 'Spree::Cart', optional: true, inverse_of: :order\n    # The checkout this order was placed in, when it was placed alongside\n    # others — one per seller on a marketplace. A single-seller or first-party\n    # only checkout produces a bare order and no group.\n    belongs_to :order_group, class_name: 'Spree::OrderGroup', optional: true, inverse_of: :orders\n    # Whose sale this is. Nil on the operator's own goods, including the\n    # first-party child of a mixed marketplace checkout.\n    belongs_to :seller, class_name: 'Spree::Seller', optional: true\n    belongs_to :created_by, class_name: \"::#{Spree.admin_user_class}\", optional: true\n    belongs_to :approver, class_name: \"::#{Spree.admin_user_class}\", optional: true","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/spree/spree/blob/06bf66a8684b9de03210bbb2ddc8c1f5ba522fa2/spree/core/app/models/spree/order.rb#L124-L160","documentation":"collect_frontend_payment_methods comes from the shared Spree::Purchase::PaymentProcessing concern; Spree 6.0 renamed it to payment_methods, which is also where payment-method rules are enforced. The shell warns and returns the same list; it is removed in 6.1.","triggerScenarios":"Storefront checkout code listing payment methods via order.collect_frontend_payment_methods — typical in ported checkout controllers, payment-step serializers, and one-page-checkout extensions.","commonSituations":"Custom storefront checkouts after a 6.0 upgrade; extensions that render the payment method picker and were written against the 5.x method name.","solutions":["Replace order.collect_frontend_payment_methods with order.payment_methods.","Do not pass a store argument — the replacement reads store context; set Spree::Current.store when calling outside a request.","Grep checkout code: rg \"collect_frontend_payment_methods\" app lib and clear every hit.","Verify payment-method rules (channel/market/total) still apply — they gate through the new method."],"exampleFix":"# before\norder.collect_frontend_payment_methods\n\n# after\norder.payment_methods","handlingStrategy":"validation","validationCode":"# Find checkout call sites\n# rg \"collect_frontend_payment_methods\" app lib --type ruby","typeGuard":"# Works across Spree 5.x and 6.x\norder.respond_to?(:payment_methods) ? order.payment_methods : order.collect_frontend_payment_methods","tryCatchPattern":null,"preventionTips":["Do not pass an explicit store after the rename — set Spree::Current.store in jobs instead.","Assert the payment picker still respects payment-method rules after switching method names.","Run the suite with deprecations raising so checkout controller specs fail on the old name."],"tags":["spree","deprecation","ruby","orders","payments","rename"],"backgroundTag":"deprecated-api-usage","analyzedSha":"06bf66a8684b9de03210bbb2ddc8c1f5ba522fa2","analyzedAt":"2026-08-21T14:59:48.125Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}