Skip to content

Place order with disabled Payment method working #37983

Open
@dimitriBouteille

Description

Preconditions and environment

  • Magento Version: 2.4.5-p4
  • PHP Version: 8.1

The bug is testable in graphQl with checkmo. However :

  • In REST there must also be the bug because it is the same classes that are used
  • Reproducible bug with all methods

Steps to reproduce

  • Disable checkmo method
  • Create quote in graphQl
  • Set addresses and shipping method
  • Load payment methods, at this stage the checkmo method is not available
{
    "data": {
        "cart": {
            "available_payment_methods": [
                {
                    "code": "adyen_cc",
                    "title": "Credit or Debit Card"
                },
                {
                    "code": "affirm_gateway",
                    "title": "Affirm"
                }
            ]
        }
    }
}
  • Set payment method with setPaymentMethodOnCart mutation

this mutation return The requested Payment Method is not available. error, but quote_payment.method column is updated with checkmo.

  • Place order with placeOrder mutation
  • Order created 🎉

Expected result

When saving the payment method and placeOrder, the following error should be reported: The requested Payment Method is not available.

Capture d’écran du 2023-09-12 12-26-53

When the setPaymentMethodOnCart mutation is called, there is an error, the quote_payment table should not be updated.

\Magento\Quote\Model\Quote\Payment::importData()

Actual result

The order is created :(

Additional information

mutation setPaymentMethodAndPlaceOrder(
  $cartId: String!
  $paymentMethod: PaymentMethodInput!
) {
  setPaymentMethodOnCart(
    input: { cart_id: $cartId, payment_method: $paymentMethod }
  ) {
    cart {
      selected_payment_method {
        code
        title
      }
    }
  }

  placeOrder(input: { cart_id: $cartId }) {
    order {
      order_number
    }
  }
}
{
    "cartId": "CART_TOKEN",
    "paymentMethod": {
        "code": "checkmo"
    }
}

Capture d’écran du 2023-09-12 15-19-05

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Assignees

No one assigned

    Labels

    Area: OrderComponent: GraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devProject: GraphQLReported on 2.4.5-p4Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions