Skip to content

Commit 304ffee

Browse files
[Refund] Fix partial refunds within same day
1 parent 3153b3c commit 304ffee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spec/Provider/PaymentReferenceNumberProviderSpec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ function it_implements_payment_reference_number_provider_interface(): void
2727
function it_provides_reference_number_based_on_payment_id_and_creation_date(PaymentInterface $payment): void
2828
{
2929
$payment->getId()->willReturn(123);
30-
$payment->getCreatedAt()->willReturn(new \DateTime('10-03-2012'));
30+
$payment->getCreatedAt()->willReturn(new \DateTime('10-03-2012 15:23:45'));
3131

32-
$this->provide($payment)->shouldReturn('123-10-03-2012');
32+
$this->provide($payment)->shouldReturn('123-10-03-2012-15-23-45');
3333
}
3434
}

src/Provider/PaymentReferenceNumberProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ public function provide(PaymentInterface $payment): string
2222
/** @var \DateTime $creationDate */
2323
$creationDate = $payment->getCreatedAt();
2424

25-
return ((string) $payment->getId()) . '-' . $creationDate->format('d-m-Y');
25+
return ((string) $payment->getId()) . '-' . $creationDate->format('d-m-Y-H-i-s');
2626
}
2727
}

0 commit comments

Comments
 (0)