-
Notifications
You must be signed in to change notification settings - Fork 154
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
Support sale
operation by Magento payment provider gateway
#9
Conversation
For the current moment, we have next relations in order payment workflow. | ||
![](sale_payment_operation_img/order_payment_current.png) | ||
|
||
I propose to introduce `SaleOperationInterface` and `Magento\Payment\Model\Method\Adapter` should implement this interface along with `Magento\Payment\Model\MethodInterface`. |
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.
Please describe this interface with methods signatures. For sure it would be similar to canAuthorize/authorize, canCapture/capture methods but it's better to document this explicitly
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.
These methods are visible on diagrams https://github.com/magento-mpi/architecture/blob/b8380eee4248d17be578696f8a6d5af086888a37/design-documents/Sale_Payment_Operation.md, but I will add them in text content also
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.
On the diagram, there are no full methods signatures (input and output types)
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.
Done
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.
- On the
order_payment_current
diagramPaymentAdapter
does not haveorder
method defined, but it is invoked byOrderOperation::order
if I'm not mistaken - On the
order_payment_new
diagramPaymentAdapter
does not haveorder
andauthorize
methods defined, but they are invoked by other classes - It looks like it would be cleaner if we split
MethodInterface
into smaller ones, likeSaleOperationInterface
. At least in 2.3+, which still allows breaking changes. In this case we should deprecate theMethodInterface
and redirect all calls to the new interfaces
|
||
## Backward compatibility | ||
- New @api interface `SaleOperationInterface` should be introduced - **MINOR** change according to SemVer | ||
- Two public methods should be added in `Magento\Payment\Model\Method\Adapter` @api class - *sale()* and *canSale()* |
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.
These methods will have implementation as far as I understand, if so - this will be minor change, otherwise it will be a major change.
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.
The base implementation of sale()
and canSale()
will be in Magento\Payment\Model\Method\Adapter
as it is the main extension point for payment integrations.
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.
Yes, they will
Hi, @paliarush. |
- Corrected diagrams
Hi Alex |
Design for task "Support
sale
operation out of the box" from Payment Improvements organization scope.https://app.zenhub.com/workspace/o/magento/payment-improvements/issues/11