PayPalPlugin
PayPalPlugin copied to clipboard
[Bug] Partial refund on the same day lead to error
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
- partial refund an item
- partial refund another item
- 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');