Skip to content

Commit

Permalink
Merge branch 'bugfix/paymentlink-payments-api' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
michielgerritsen committed Oct 23, 2023
2 parents 07659b7 + 9d41e29 commit fe5b265
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions Model/Client/Payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,14 @@ public function processResponse(OrderInterface $order, $payment)
);
}

$status = $this->mollieHelper->getPendingPaymentStatus($order);
$message = __('Customer redirected to Mollie');
if ($order->getPayment()->getMethodInstance()->getCode() == 'mollie_methods_paymentlink') {
$message = __('Created Mollie Checkout Url');
}

$status = $this->mollieHelper->getPendingPaymentStatus($order);
$order->addStatusToHistory($status, $message, false);
$order->setState(Order::STATE_PENDING_PAYMENT);
$order->addStatusToHistory($status, __('Customer redirected to Mollie'), false);
$this->linkTransactionToOrder->execute($payment->id, $order);
$this->orderRepository->save($order);
}
Expand Down
8 changes: 5 additions & 3 deletions view/frontend/templates/info/mollie_paymentlink.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ $title = $block->escapeHtml($block->getMethod()->getTitle());
<?= /* @noEscape */
$title; ?>
</dt>
<?php if (($block->getPaymentStatus() == 'created') && ($paymentUrl = $block->getPaymentLink($block->getMethod()->getStore()))): ?>
<?php
if (in_array($block->getPaymentStatus(), ['created', 'open']) &&
$paymentUrl = $block->getPaymentLink($block->getMethod()->getStore())
): ?>
<dt>
<?= /* @noEscape */
$paymentUrl; ?>
<?= /* @noEscape */ $paymentUrl; ?>
</dt>
<?php endif; ?>
<?php if ($specificInfo): ?>
Expand Down

0 comments on commit fe5b265

Please sign in to comment.