PrestaShop / prestashop-specs

Project specifications for PrestaShop's Core features and native modules
https://build.prestashop-project.org/prestashop-specs/
Other
32 stars 26 forks source link

Inconsistencies related to PaymentModule and PaymentOptions in BO and FO. #348

Open danielcivit opened 2 years ago

danielcivit commented 2 years ago

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.

danielcivit commented 2 years ago

The following is a PrestaShop core GitHub issue related:

https://github.com/PrestaShop/PrestaShop/issues/18307

NeOMakinG commented 2 years ago

I guess it's a topic for our beloved @PrestaShop/product-team