mollie / Sylius

Mollie payment gateway integration for Sylius
MIT License
4 stars 17 forks source link

Mollie assumes to be the only payment method for Sylius #33

Open ofinsterbusch opened 1 week ago

ofinsterbusch commented 1 week ago

When having multiple payment methods for different channels Mollie assumes it will be the main payment method.

This affects the way the SyliusMolliePlugin\Payments\MethodResolver\MolliePaymentMethodResolver class works

The resolvers checks for a Mollie payment method and then for it's parents but using the default payment method resolver and not the ChannelBasedPaymentMethodResolver. This results in showing any payment method that is enabled without considering the customer order channel.

This can be solved decorating the service _sylius_mollie_plugin.payment_resolver.mollie_paymentmethod.inner and pointing it to the ChannelBasedPaymentMethodResolver

But it probably should go through all the methods in the CompositePaymentMethodResolver ignoring the mollie one.

logeecom commented 1 week ago

Hello @ofinsterbusch,

Thank you for reaching out.

We will check this and come back to you as soon as possible.

Thank you,

Kind regards.

logeecom commented 2 days ago

Hello @ofinsterbusch,

Note that our team finished investigating the reported issue.

When Sylius has more than 1 sales channels, all the payment methods from all channels will be shown on checkout for every channel. image-20241120-091701 The issue is caused as our MolliePaymentMethodResolver is being decorated with the default resolver, as already stated by you. Since there is no prebuilt channel-based resolver in Sylius, we fixed the issue by adding the method that filters payment methods per channel. Now, only payment methods that belong to certain channels will be shown for it on checkout. image-20241120-091946 Please note that the changes will be live with the next release (expected at the start of the next week).

Thank you,

Kind regards.

ofinsterbusch commented 2 days ago

That's great, thank you!