3BRS / sylius-payment-fee-plugin

Payment Fee Plugin adds possibility to charge the customer for specific payment method e.g. Cash on Delivery.
MIT License
1 stars 5 forks source link

Exclude cancelled/declined payment from charge PaymentChargesProcessor #3

Open Geolim4 opened 1 year ago

Geolim4 commented 1 year ago

Hello @ondrej-kuhnel

i think that it would be great to exclude payments other than "cart, new" from the PaymentChargesProcessor.

https://github.com/3BRS/sylius-payment-fee-plugin/blob/eb2a2052d97a556fad877e75d683a57feb88bc94/src/Model/PaymentChargesProcessor.php#L36

See \Sylius\Component\Payment\Model\PaymentInterface for the list of statuses.

Geolim4 commented 1 year ago

@ondrej-kuhnel can you exclude those statuses of the loop ? In many case of payments declined this can add multiple undesired fees :(

Do you want a PR ?