hipay / hipay-fullservice-sdk-magento2

Official repository of the HiPay Fullservice extension for Magento v2.
https://developer.hipay.com/doc/hipay-fullservice-sdk-magento2/
Apache License 2.0
10 stars 16 forks source link

Credit cards sorting #124

Closed GuillaumeBrook closed 4 years ago

GuillaumeBrook commented 4 years ago

Hello,

I would like to know if we can sort credit cards type in the payment method "HiPay Enterprise Hosted Page". For example, I want to put AMEX last and not first. There is no such configuration to order the credits cards in the M2 module (in was present in the M1 module though), do you confirm ?

As I can see in the module "hipay-fullservice-sdk-php", there is some json with an attribute "priority" for each payment methods. This priorities work if I change the return isOverridePaymentProductSorting() return true in vendor/hipay/hipay-fullservice-sdk-magento2/Model/Config.php (Last thing : I changed the priority directly in vendor, I don't know how to override vendor/hipay/hipay-fullservice-sdk-php/lib/HiPay/Fullservice/PaymentConfigFiles/visa.json right now)

It is not ideal though because I can't order for each methods and for each stores. Should I create my own config data field to address the issue ?

jprotin commented 4 years ago

Hi @GuillaumeBrook

Currently, Magento2 doesn't have a system to configure the credit cards sorting via a configuration's screen. The SDK PHP is developed with a payment sorting but in Magento2, you need to activate the system by the code.

Go to the HiPay extension > Model > config.php and in the line 800 update isOverridePaymentProductSorting

When the system is activated, the payment sorting is automatic by the SDK PHP.

Below, the position of payment methods :

Carte Bancaire (CB) VISA MasterCard PayPal American Express 4x Carte Bancaire sans frais SEPA Direct Debit 3x Carte Bancaire sans frais Maestro Sofort Überweisung Przelewy24 Carte Cadeau BNP Paribas Personal Finance 4xCb Bancontact Mix Payment BNP Paribas Personal Finance 3xCb Credit Long iDEAL Belfius Direct Net 3x Carte Bancaire Sisal ING Home'Pay Giropay Postfinance Card 4x Carte Bancaire MB Multibanco MyBank Yandex SEPA Credit Transfer Bancontact Mobile Postfinance E-finance

Later the Magento 2 extension will optimized to manage that via a configuration's screen.

Many thanks

All the best.

GuillaumeBrook commented 4 years ago

Actually you already did a sortable source_model for another payment method. I used it, thank you.