Sylius / PayPalPlugin

Official integration with PayPal Commerce Platform
36 stars 54 forks source link

[Bug] Partial refund on the same day lead to error #264

Open jcgdjob opened 1 year ago

jcgdjob commented 1 year ago

SyliusPayPalPlugin version affected: 1.x.y Any Description
Error: Invoice ID was previously used to refund a capture occur when partial refund on the same order twice on the same day.

Steps to reproduce
1) partial refund an item 2) partial refund another item 3) error: Invoice ID was previously used to refund a capture

Possible Solution
src/Provider/PaymentReferenceNumberProvider.php Add the time on the ref no. as well: return ((string) $payment->getId()) . '-' . (new \DateTime())->format('d-m-Y H:i:s');