Skip to content

Commit

Permalink
Merge pull request #443 from Invertus/order-refund-fix
Browse files Browse the repository at this point in the history
fixed transaction refund issue with multiple mollie payments
  • Loading branch information
margud authored Oct 20, 2021
2 parents 80bf0a6 + 09c4988 commit b727107
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Service/TransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ public function processTransaction($transaction)
break;
}
if ($apiPayment->hasRefunds() || $apiPayment->hasChargebacks()) {
if (strpos($apiPayment->description, OrderNumberUtility::ORDER_NUMBER_PREFIX) === 0) {
return $transactionNotUsedMessage;
}
if (isset($apiPayment->settlementAmount->value, $apiPayment->amountRefunded->value)
&& NumberUtility::isLowerOrEqualThan($apiPayment->settlementAmount->value, $apiPayment->amountRefunded->value)
) {
Expand All @@ -153,7 +156,7 @@ public function processTransaction($transaction)
$payment = $this->module->api->payments->get($apiPayment->id);
$payment->description = $order->reference;
$payment->update();
} elseif (strpos($apiPayment->orderNumber, OrderNumberUtility::ORDER_NUMBER_PREFIX) === 0) {
} elseif (strpos($apiPayment->description, OrderNumberUtility::ORDER_NUMBER_PREFIX) === 0) {
return $transactionNotUsedMessage;
} else {
$this->orderStatusService->setOrderStatus($orderId, $apiPayment->status);
Expand Down

0 comments on commit b727107

Please sign in to comment.