Skip to content

Commit

Permalink
Merge pull request #318 from Invertus/MOLIM-374/credit-card-error-fix
Browse files Browse the repository at this point in the history
Molim 374/credit card error fix
  • Loading branch information
margud authored Sep 1, 2022
2 parents 7ad84bc + a07d5f8 commit c93210c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Changelog #
## Changes in release 5.4.0 ##
+ Removed reference variables from translations.
+ Fixed issue where credit card components would throw error even taught order was created.

## Changes in release 5.3.0 ##
+ Added PS8.0.0+ compatibility
Expand Down
7 changes: 6 additions & 1 deletion controllers/front/payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public function initContent()
$transactionService = $this->module->getMollieContainer(PaymentMethodService::class);
/** @var MollieOrderCreationService $mollieOrderCreationService */
$mollieOrderCreationService = $this->module->getMollieContainer(MollieOrderCreationService::class);
/** @var PaymentMethodRepositoryInterface $paymentMethodRepository */
$paymentMethodRepository = $this->module->getMollieContainer(PaymentMethodRepositoryInterface::class);

$environment = (int) Configuration::get(Mollie\Config\Config::MOLLIE_ENVIRONMENT);
$paymentMethodId = $paymentMethodRepo->getPaymentMethodIdByMethodId($method, $environment);
Expand Down Expand Up @@ -153,7 +155,10 @@ public function initContent()
$order->reference
);
} else {
$mollieOrderCreationService->createMolliePayment($apiPayment, $cart->id, $orderNumber);
$paymentMethod = $paymentMethodRepository->getPaymentBy('transaction_id', $apiPayment->id);
if (!$paymentMethod) {
$mollieOrderCreationService->createMolliePayment($apiPayment, $cart->id, $orderNumber);
}
}
} catch (Exception $e) {
$this->setTemplate('error.tpl');
Expand Down

0 comments on commit c93210c

Please sign in to comment.