-
Notifications
You must be signed in to change notification settings - Fork 9.4k
magento/magento2#37983: Place order with disabled Payment method working #39937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.4-develop
Are you sure you want to change the base?
magento/magento2#37983: Place order with disabled Payment method working #39937
Conversation
- prevent order placement with unavailable payment method
Hi @KrasnoshchokBohdan. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
- copyright and static test errors fix
@magento run all tests |
Updated the code to safely handle cases where the cart's payment object might be null. This prevents potential errors when accessing the payment method code for carts without a valid payment set.
@magento run all tests |
@magento run all tests |
@magento run all tests |
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @KrasnoshchokBohdan,
Thanks for the contribution!
Please refer to the below review comment and also please add some automated test in accordance to the DOD.
Thanks
Co-authored-by: Abhinav Pathak <51681618+engcom-Hotel@users.noreply.github.com>
- Add unit tests for PlaceOrder functionality in QuoteGraphQl.
@magento run all tests |
Add logging for disabled payment method attempts in PlaceOrder Extended `PlaceOrder` to log debug information when an unavailable payment method is used. This includes details like the cart ID, user ID, attempted payment method, and available methods, facilitating easier troubleshooting of order placement issues. Updated unit tests to validate the new logging behavior.
@magento run all tests |
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @KrasnoshchokBohdan,
Thanks for updating the PR!
It seems some automated tests are failing due to this PR change. Please fix those also look into the below review comment.
Thanks
*/ | ||
public function __construct( | ||
PaymentMethodManagementInterface $paymentManagement, | ||
CartManagementInterface $cartManagement | ||
CartManagementInterface $cartManagement, | ||
LoggerInterface $logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New Params in Constructor should be null and handle it with ObjectManager
Refactor PlaceOrder to support optional logger dependency Modified the constructor to make LoggerInterface optional by defaulting to ObjectManager resolution. This improves flexibility and ensures compatibility with cases where a logger is not explicitly provided.
@magento run all tests |
@magento run Integration Tests, Unit Tests, Functional Tests CE |
Hello @KrasnoshchokBohdan, It seems you have made the changes according to the review comments, hence we are picking this PR for review. Thank You 😃 |
@magento run Unit Tests, WebAPI Tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KrasnoshchokBohdan Some tests are still failing due to the PR changes. Moving back to Changes Requested
bucket.
Thanks
Description (*)
I will leave here examples of mutations that I used.
createCustomer
generateCustomerToken
createEmptyCart (don't forget about Authentification)
addSimpleProductsToCart
setShippingAddressesOnCart
setBillingAddressOnCart
setShippingMethodsOnCart
setPaymentMethodOnCart + placeOrder
VARIABLES
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)