Skip to content

Commit

Permalink
[RefundType] Change comparison of refund type
Browse files Browse the repository at this point in the history
  • Loading branch information
GSadee committed Jul 6, 2021
1 parent 38d75ff commit e5e9b15
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Provider/RemainingTotalProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Sylius\Component\Order\Model\AdjustableInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
use Sylius\RefundPlugin\Entity\RefundInterface;
use Sylius\RefundPlugin\Model\RefundType;
use Sylius\RefundPlugin\Model\RefundTypeInterface;
use Webmozart\Assert\Assert;

Expand Down Expand Up @@ -63,7 +62,7 @@ public function getTotalLeftToRefund(int $id, RefundTypeInterface $type): int

private function getRefundUnitTotal(int $id, RefundTypeInterface $refundType): int
{
if ($refundType->equals(RefundType::orderItemUnit())) {
if ($refundType->getValue() === RefundTypeInterface::ORDER_ITEM_UNIT) {
/** @var OrderItemUnitInterface $orderItemUnit */
$orderItemUnit = $this->orderItemUnitRepository->find($id);
Assert::notNull($orderItemUnit);
Expand Down

0 comments on commit e5e9b15

Please sign in to comment.