According to the PrestaShop documentation, there is no guideline that indicates that a Payment Module (PaymentModule object) should register a single payment option (PaymentOption object). On the contrary, the fact that an array must be returned from the hookPaymentOptions supports the tacit idea that multiple payment options are accepted:
https://devdocs.prestashop.com/1.7/modules/payment/
For those cases in which multiple payment options are registered by a single payment module, the behavior of PrestaShop is inconsistent, and the possibility of having conflicts with third parties modules, or even with core features, increase.
Consider the following case:
A payment module (Module X), register two payment options (Payment option A and B).
After that is possible select any of those payment options in the checkout. Each one with different behaviors, checkout fields, forms, etc.
However, in BO > Payment > Preferences only payment modules can be configured.
However, in BO > Orders > Pick any order > Register manually a payment. Only payment modules are listed. Why is possible select payment options in the FO and not in the BE?
However, in BO > Orders > Add Order > At the moment is required to select a payment method, only payment modules are listed.
Consider conflicts between third party modules which makes PrestaShop a wild system. For example, most of the fee modules based on payment methods follows the same behavior. Only allows to filter by payment module. But that does not make any sense.
Perhaps I am missing something. Perhaps I am wrong. But I have read and consulted everything possible, from forums, the core code, to the spec repository, several modules, etc and I can't get a clear conclusion about it.
I think this is the right place to ask for guidelines about this. Is that correct?
Could you...
Clear out the ambiguity behind these two concepts: (payment module, and payment options).
Provide clear guidelines about the relation between these two objects, and to know if register more than one payment option per module is disallowed.
Then if is possible an is not explicitly disallowed, maybe is the right place to start defining the specifications about how should work at the future.
Thanks in advanced for consider this request - questions.
Hello.
According to the PrestaShop documentation, there is no guideline that indicates that a Payment Module (PaymentModule object) should register a single payment option (PaymentOption object). On the contrary, the fact that an array must be returned from the hookPaymentOptions supports the tacit idea that multiple payment options are accepted: https://devdocs.prestashop.com/1.7/modules/payment/
The payment module example in PrestaShop repository returns four paymentOptions in one PaymentModule: https://github.com/PrestaShop/paymentexample/blob/master/paymentexample.php
For those cases in which multiple payment options are registered by a single payment module, the behavior of PrestaShop is inconsistent, and the possibility of having conflicts with third parties modules, or even with core features, increase.
Consider the following case:
Perhaps I am missing something. Perhaps I am wrong. But I have read and consulted everything possible, from forums, the core code, to the spec repository, several modules, etc and I can't get a clear conclusion about it.
I think this is the right place to ask for guidelines about this. Is that correct?
Could you...
Then if is possible an is not explicitly disallowed, maybe is the right place to start defining the specifications about how should work at the future.
Thanks in advanced for consider this request - questions.