Skip to content

Commit

Permalink
Merge pull request #197 from paynl/feature/PLUG-3755
Browse files Browse the repository at this point in the history
PLUG-3755 - Update Finish
  • Loading branch information
woutse authored Aug 30, 2024
2 parents 5cbaf2d + fbf10df commit 271f872
Show file tree
Hide file tree
Showing 16 changed files with 87 additions and 13 deletions.
6 changes: 5 additions & 1 deletion Controller/Checkout/Finish.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public function execute()
$bDenied = $orderStatusId === Config::ORDERSTATUS_DENIED;
$bCanceled = $orderStatusId === Config::ORDERSTATUS_CANCELED;
$bVerify = $orderStatusId === Config::ORDERSTATUS_VERIFY;
$bConfirm = $orderStatusId === Config::ORDERSTATUS_CONFIRM;
$isPinTransaction = false;
$multiShipFinish = is_array($orderIds);

Expand Down Expand Up @@ -218,11 +219,14 @@ public function execute()
$bSuccess = ($transaction->isPaid() || $transaction->isAuthorized());
}

if ($bSuccess || $bVerify) {
if ($bSuccess || $bVerify || $bConfirm) {
$successUrl = $this->config->getSuccessPage($payment->getMethod());
if (empty($successUrl)) {
$successUrl = ($payment->getMethod() == 'paynl_payment_paylink' || $this->config->sendEcommerceAnalytics()) ? Config::FINISH_PAY : Config::FINISH_STANDARD;
}
if ($bConfirm) {
$successUrl = Config::CONFIRM_PAY;
}
$this->payHelper->logDebug('Finish succes', [$successUrl, $payOrderId, $bSuccess, $bVerify]);
$resultRedirect->setPath($successUrl, ['_query' => ['utm_nooverride' => '1']]);
if ($isPinTransaction && $pinStatus->getTransactionState() !== 'approved') {
Expand Down
30 changes: 30 additions & 0 deletions Controller/Order/Confirm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Paynl\Payment\Controller\Order;

class Confirm extends \Magento\Framework\App\Action\Action
{
protected $_pageFactory;

/**
* Pending construct
*
* @param \Magento\Framework\App\Action\Context $context
* @param \Magento\Framework\View\Result\PageFactory $pageFactory
*/
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $pageFactory
) {
$this->_pageFactory = $pageFactory;
return parent::__construct($context);
}

/**
* @return object
*/
public function execute()
{
return $this->_pageFactory->create();
}
}
2 changes: 2 additions & 0 deletions Model/Config.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
class Config
{
public const FINISH_PAY = 'paynl/order/finish';
public const CONFIRM_PAY = 'paynl/order/confirm';
public const FINISH_PAY_FC = 'paynl/order/finishfc';
public const PENDING_PAY = 'paynl/order/pending';
public const CANCEL_PAY = 'paynl/order/cancel';
Expand All @@ -23,6 +24,7 @@ class Config
public const ORDERSTATUS_DENIED = -63;
public const ORDERSTATUS_CANCELED = -90;
public const ORDERSTATUS_VERIFY = 85;
public const ORDERSTATUS_CONFIRM = 98;


/** @var Store */
Expand Down
3 changes: 2 additions & 1 deletion i18n/de_AT.csv
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,5 @@ Diese Einstellung wirkt sich nicht auf die Produktseite aus. Wenn der schnelle C
"On - as Optional","Ein - als Optional"
"On - as Required","Ein - nach Bedarf"
"Show notice and abort fast checkout","Hinweis anzeigen und Schnellkasse abbrechen"
"Show intermediate screen to select shipping method","Zwischenbildschirm zur Auswahl der Versandart anzeigen"
"Show intermediate screen to select shipping method","Zwischenbildschirm zur Auswahl der Versandart anzeigen"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Vielen Dank für Ihren Kauf, sobald die Zahlung abgeschlossen ist, erhalten Sie eine E-Mail."
3 changes: 2 additions & 1 deletion i18n/de_CH.csv
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,5 @@ Diese Einstellung wirkt sich nicht auf die Produktseite aus. Wenn der schnelle C
"On - as Optional","Ein - als Optional"
"On - as Required","Ein - nach Bedarf"
"Show notice and abort fast checkout","Hinweis anzeigen und Schnellkasse abbrechen"
"Show intermediate screen to select shipping method","Zwischenbildschirm zur Auswahl der Versandart anzeigen"
"Show intermediate screen to select shipping method","Zwischenbildschirm zur Auswahl der Versandart anzeigen"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Vielen Dank für Ihren Kauf, sobald die Zahlung abgeschlossen ist, erhalten Sie eine E-Mail."
3 changes: 2 additions & 1 deletion i18n/de_DE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,5 @@ Diese Einstellung wirkt sich nicht auf die Produktseite aus. Wenn der schnelle C
"On - as Optional","Ein - als Optional"
"On - as Required","Ein - nach Bedarf"
"Show notice and abort fast checkout","Hinweis anzeigen und Schnellkasse abbrechen"
"Show intermediate screen to select shipping method","Zwischenbildschirm zur Auswahl der Versandart anzeigen"
"Show intermediate screen to select shipping method","Zwischenbildschirm zur Auswahl der Versandart anzeigen"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Vielen Dank für Ihren Kauf, sobald die Zahlung abgeschlossen ist, erhalten Sie eine E-Mail."
3 changes: 2 additions & 1 deletion i18n/de_LU.csv
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,5 @@ Diese Einstellung wirkt sich nicht auf die Produktseite aus. Wenn der schnelle C
"On - as Optional","Ein - als Optional"
"On - as Required","Ein - nach Bedarf"
"Show notice and abort fast checkout","Hinweis anzeigen und Schnellkasse abbrechen"
"Show intermediate screen to select shipping method","Zwischenbildschirm zur Auswahl der Versandart anzeigen"
"Show intermediate screen to select shipping method","Zwischenbildschirm zur Auswahl der Versandart anzeigen"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Vielen Dank für Ihren Kauf, sobald die Zahlung abgeschlossen ist, erhalten Sie eine E-Mail."
3 changes: 2 additions & 1 deletion i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,5 @@ This setting does not effect the product page. If fast checkout is enabled for t
"On - as Optional","On - as Optional"
"On - as Required","On - as Required"
"Show notice and abort fast checkout","Show notice and abort fast checkout"
"Show intermediate screen to select shipping method","Show intermediate screen to select shipping method"
"Show intermediate screen to select shipping method","Show intermediate screen to select shipping method"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Thank you for your purchase, as soon as the payment is completed you will receive an email."
3 changes: 2 additions & 1 deletion i18n/fr_BE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,5 @@ Ce paramètre n'affecte pas la page produit. Si le paiement rapide est activé p
"On - as Optional","Activé - en option"
"On - as Required","Activé - en requis"
"Show notice and abort fast checkout","Afficher un avis et abandonner le fastcheckout"
"Show intermediate screen to select shipping method","Afficher l'écran intermédiaire pour sélectionner la méthode d'expédition"
"Show intermediate screen to select shipping method","Afficher l'écran intermédiaire pour sélectionner la méthode d'expédition"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Nous vous remercions pour votre commande. Dès que le paiement aura été traité, vous recevrez un e-mail."
3 changes: 2 additions & 1 deletion i18n/fr_CA.csv
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,5 @@ Ce paramètre n'affecte pas la page produit. Si le paiement rapide est activé p
"On - as Optional","Activé - en option"
"On - as Required","Activé - en requis"
"Show notice and abort fast checkout","Afficher un avis et abandonner le fastcheckout"
"Show intermediate screen to select shipping method","Afficher l'écran intermédiaire pour sélectionner la méthode d'expédition"
"Show intermediate screen to select shipping method","Afficher l'écran intermédiaire pour sélectionner la méthode d'expédition"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Nous vous remercions pour votre commande. Dès que le paiement aura été traité, vous recevrez un e-mail."
3 changes: 2 additions & 1 deletion i18n/fr_CH.csv
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,5 @@ Ce paramètre n'affecte pas la page produit. Si le paiement rapide est activé p
"On - as Optional","Activé - en option"
"On - as Required","Activé - en requis"
"Show notice and abort fast checkout","Afficher un avis et abandonner le fastcheckout"
"Show intermediate screen to select shipping method","Afficher l'écran intermédiaire pour sélectionner la méthode d'expédition"
"Show intermediate screen to select shipping method","Afficher l'écran intermédiaire pour sélectionner la méthode d'expédition"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Nous vous remercions pour votre commande. Dès que le paiement aura été traité, vous recevrez un e-mail."
3 changes: 2 additions & 1 deletion i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,5 @@ Ce paramètre n'affecte pas la page produit. Si le paiement rapide est activé p
"On - as Optional","Activé - en option"
"On - as Required","Activé - en requis"
"Show notice and abort fast checkout","Afficher un avis et abandonner le fastcheckout"
"Show intermediate screen to select shipping method","Afficher l'écran intermédiaire pour sélectionner la méthode d'expédition"
"Show intermediate screen to select shipping method","Afficher l'écran intermédiaire pour sélectionner la méthode d'expédition"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Nous vous remercions pour votre commande. Dès que le paiement aura été traité, vous recevrez un e-mail."
3 changes: 2 additions & 1 deletion i18n/fr_LU.csv
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,5 @@ Ce paramètre n'affecte pas la page produit. Si le paiement rapide est activé p
"On - as Optional","Activé - en option"
"On - as Required","Activé - en requis"
"Show notice and abort fast checkout","Afficher un avis et abandonner le fastcheckout"
"Show intermediate screen to select shipping method","Afficher l'écran intermédiaire pour sélectionner la méthode d'expédition"
"Show intermediate screen to select shipping method","Afficher l'écran intermédiaire pour sélectionner la méthode d'expédition"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Nous vous remercions pour votre commande. Dès que le paiement aura été traité, vous recevrez un e-mail."
3 changes: 2 additions & 1 deletion i18n/nl_BE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -358,4 +358,5 @@ Deze instelling heeft geen effect op de productpagina. Als snel bestellen is ing
"On - as Optional","Aan - als Optioneel"
"On - as Required","Aan - als Verplicht"
"Show notice and abort fast checkout","Toon melding en annuleer snel bestellen"
"Show intermediate screen to select shipping method","Toon tussenscherm om verzendmethode te selecteren"
"Show intermediate screen to select shipping method","Toon tussenscherm om verzendmethode te selecteren"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Bedankt voor uw bestelling, zodra de betaling afgerond is ontvangt u een email."
3 changes: 2 additions & 1 deletion i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,5 @@ Deze instelling heeft geen effect op de productpagina. Als snel bestellen is ing
"On - as Optional","Aan - als Optioneel"
"On - as Required","Aan - als Verplicht"
"Show notice and abort fast checkout","Toon melding en annuleer snel bestellen"
"Show intermediate screen to select shipping method","Toon tussenscherm om verzendmethode te selecteren"
"Show intermediate screen to select shipping method","Toon tussenscherm om verzendmethode te selecteren"
"Thank you for your purchase, as soon as the payment is completed you will receive an email.","Bedankt voor uw bestelling, zodra de betaling afgerond is ontvangt u een email."
26 changes: 26 additions & 0 deletions view/frontend/layout/paynl_order_confirm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>Success Page</title>
</head>
<body>
<referenceBlock name="page.main.title">
<block class="Paynl\Payment\Block\Page\Finish" name="pay_finish.button" template="Magento_Checkout::button.phtml"/>
<action method="setPageTitle">
<argument translate="true" name="title" xsi:type="string">Thank you for your purchase, as soon as the payment is completed you will receive an email.</argument>
</action>
</referenceBlock>
<referenceContainer name="content">
<block class="Paynl\Payment\Block\Page\Finish" name="pay_finish" template="Paynl_Payment::pay_finish.phtml" cacheable="false">
<container name="order.success.additional.info" label="Order Success Additional Info"/>
</block>
<block class="Magento\Checkout\Block\Registration" name="checkout.registration" template="Magento_Checkout::registration.phtml" cacheable="false"/>
</referenceContainer>
</body>
</page>

0 comments on commit 271f872

Please sign in to comment.