magento2
magento2 copied to clipboard
Place order with disabled Payment method working
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
setPaymentMethodOnCartmutation
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 :tada:
Expected result
When saving the payment method and placeOrder, the following error should be reported: The requested Payment Method is not available.
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"
}
}
Release note
No response
Triage and priority
- [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- [X] 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”.
Hi @dimitriBouteille. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance- upcoming 2.4.x release- For more details, review the Magento Contributor Assistant documentation.
- Add a comment to assign the issue:
@magento I am working on this - To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
- [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
- [ ] 3. Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to. - [ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! - [ ] 5. Add label
Issue: Confirmedonce verification is complete. - [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
@magento give me 2.4-develop instance
Hi @dimitriBouteille. Thank you for your request. I'm working on Magento instance for you.
Hi @dimitriBouteille, here is your Magento Instance: https://a1fe3ae8511747381cac27ce90793387.instances-prod.magento-community.engineering Admin access: https://a1fe3ae8511747381cac27ce90793387.instances-prod.magento-community.engineering/admin_028a Login: ef78aade Password: a4c76a83165f
Hi @dimitriBouteille,
Thank you for reporting and collaboration.
Verified the issue on Magento 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.
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
- 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 🎉
We have disabled checkmo method and checkmo method is not available
While Set payment method with setPaymentMethodOnCart mutation we are getting error The requested Payment Method is not available
We are not able to place the order with the Place order with placeOrder mutation.
Kindly recheck the behaviour on Magento 2.4-develop instance and elaborate steps to reproduce if the issue is still reproducible.
Thanks.
@magento give me 2.4-develop instance
Hi @dimitriBouteille. Thank you for your request. I'm working on Magento instance for you.
Hi @dimitriBouteille, here is your Magento Instance: https://a1fe3ae8511747381cac27ce90793387.instances-prod.magento-community.engineering Admin access: https://a1fe3ae8511747381cac27ce90793387.instances-prod.magento-community.engineering/admin_d02e Login: 2ab30941 Password: 93001eca67fc
Hi @engcom-Bravo
I just regaled the code a bit and actually I found this error message here \Magento\AsyncOrderGraphQl\Model\Cart\PlaceOrderAsync::execute() which comes from the Magento_AsyncOrderGraphQl module.
In my case, this module is not activated because no need. If you test disabled this module, you will reproduce the bug.
Hello @engcom-Bravo
Any news ?
Hi @dimitriBouteille,
Thanks for your update.
In our local instance also we don't have Magento_AsyncOrderGraphQl module.
We are not able to reproduce the issue.Is there any other way to reproduce the issue could you please elaborate the steps.
it might be possible the issue is resolved in the latest 2.4-develop branch. I request you to please try to reproduce the issue in the latest development branch.
Thanks.
@magento give me 2.4-develop instance
Hi @dimitriBouteille. Thank you for your request. I'm working on Magento instance for you.
Hi @dimitriBouteille, here is your Magento Instance: https://a1fe3ae8511747381cac27ce90793387.instances-prod.magento-community.engineering Admin access: https://a1fe3ae8511747381cac27ce90793387.instances-prod.magento-community.engineering/admin_2d05 Login: dd553271 Password: 40d8bb6926ea
Hi @engcom-Bravo,
I tried to reproduce the bug directly on the test env (https://github.com/magento/magento2/issues/37983#issuecomment-1733733696) and I managed to reproduce the bug again.
To reproduce the bug, you must execute the mutations setPaymentMethodOnCart and placeOrder at the same time! Here is an example of a graphql mutation that reproduces the bug:
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"
}
}
Hi @dimitriBouteille,
Thanks for your update.
Verified the issue on Magento 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.
Even though the payment method checkmo is not available for setting up the payment method but when we execute mutations setPaymentMethodOnCart and placeOrder at the same time the order is placed successfully without setting the payment method.
Hence confirming the issue.
Thanks.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-9605 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi @engcom-Bravo
Some news ?
can't duplicate in 2.4-develop:
can't duplicate in 2.4-develop:
The bug is reproducible again. Line 23 I can see the order_number with good increment ID. The placeOrder request should be return The requested Payment Method is not available.
@magento I am working on this
Hi @dimitriBouteille,
Adobe Commerce Engineering team started working on this issue. We will reach out to you if we need more information and you will get notified once the issue is fixed. Please leave comments for any further questions.
Thank you!
Hello,
As I can see this issue got fixed in the scope of the internal Jira ticket AC-9605 by the internal team Related commits:https://github.com/search?q=repo%3Amagento%2Fmagento2+AC-9605&type=commits
Based on the Jira ticket, the target version is 2.4.9-beta1.
Thanks
