-
Notifications
You must be signed in to change notification settings - Fork 9.4k
add missing PaymentMethodInterface #33003
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?
Conversation
Hi @fooman. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento create issue |
I currently don't see how the B2B GrahpQl failure would be related:
In regards to the semantic version failure I believe this to be backwards compatible and fixing an existing issue rather than introducing a new one. |
@magento run WebAPI Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Sorry but I do not see an issue with this, MethodInterface also has same methods defined, so there are no really issue exists. |
getPaymentMethods should return an array of |
@@ -31,7 +32,7 @@ | |||
* @api Use this class as a base for virtual types declaration | |||
* @since 100.0.2 | |||
*/ | |||
class Adapter implements MethodInterface, SaleOperationInterface | |||
class Adapter implements MethodInterface, SaleOperationInterface, PaymentMethodInterface |
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.
There is already such methods duplication in
abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibleModel implements
MethodInterface,
PaymentMethodInterface
is there any real issue observable due to
would technically not be valid due to the missing interface
?
From a quick code review it looks like PaymentMethodInterface
is what Quote
needs to know about payment methods in its bounded context, there is even another similar interface in Payment
module itself \Magento\Payment\Api\Data\PaymentMethodInterface
.
My understanding is that Quote should be aware of Payment and not vice versa.
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.
@orlangur in reply to
is there any real issue observable due to
would technically not be valid due to the missing interface
Yes. I wanted to plug into \Magento\Quote\Api\Data\PaymentMethodInterface to change the title of ALL payment methods however due to the difference between AbstractMethod and Adapter this was not possible.
As Adapter is being pushed as the successor to deprecated AbstractMethod it would be great if the two would fulfil the same interfaces. This PR does this.
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.
My understanding is that Quote should be aware of Payment and not vice versa.
If you want to remove the dependency quote from payment there are a lot of bigger issues to work through. See https://github.com/magento/magento2/blob/2.4.3/app/code/Magento/Payment/Model/Method/Adapter.php#L22
And just to iterate the Interface I am adding
is already implemented here https://github.com/magento/magento2/blob/2.4.3/app/code/Magento/Payment/Model/Method/Adapter.php#L552-L566 and is part of the existing API for the class. |
Description (*)
During checkout payment information details can be requested via
https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Checkout/Model/PaymentInformationManagement.php#L185
which uses
According to https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Checkout/Api/Data/PaymentDetailsInterface.php#L25 this should be an array of
\Magento\Quote\Api\Data\PaymentMethodInterface
Any Payment Methods based on https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Payment/Model/Method/Adapter.php would technically not be valid due to the missing interface. The interface methods are already implemented. As the Adapter class already includes these methods this should not be a breaking change.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)
Resolved issues: