coopcycle / coopcycle-web

Logistics & marketplace platform. Only for worker-owned business.
https://coopcycle.org
Other
571 stars 130 forks source link

Implement multiple payments for Edenred #4614

Closed alexsegura closed 1 month ago

alexsegura commented 2 months ago

Fixes #4537

This pull request changes the behavior when selecting the Edenred payment method, by creating 2 payments, one for Edenred with the max amount possible, and the rest to be completed by credit card.

Also, in most of the rest of the code, it makes a loop on payments, instead of relying on the getLastPayment method.

Atala commented 2 months ago

crash 1 :

-> crash

AppBundle\Entity\Sylius\Payment::addRefund(): Argument #1 ($amount) must be of type int, null given, called in /var/www/html/src/Payment/Gateway/Edenred.php on line 29

crash-refund-1

alexsegura commented 2 months ago

The refund problem is fixed in f74674c9c7706cac381f29d8fc471d7420a45d4f, and will also fix #4341 & #4608