Skip to content

Commit

Permalink
Merge pull request #103 from paynl/feature/PLUG-1855
Browse files Browse the repository at this point in the history
PLUG-1855 - Make Finish page for Pending optional with setting
  • Loading branch information
woutse authored Mar 27, 2023
2 parents e6caac6 + 27a3929 commit a11c681
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Controller/Checkout/Finish.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,13 @@ public function execute()
}
$this->deactivateCart($order, $payOrderId);
} elseif ($bPending) {
$resultRedirect->setPath(Config::PENDING_PAY);
$successUrl = Config::FINISH_STANDARD;
if ($this->config->getPendingPage()) {
$successUrl = Config::PENDING_PAY;
} elseif ($this->config->sendEcommerceAnalytics()) {
$successUrl = Config::FINISH_PAY;
}
$resultRedirect->setPath($successUrl, ['_query' => ['utm_nooverride' => '1']]);
$this->deactivateCart($order, $payOrderId);
} else {
$cancelMessage = $bDenied ? __('Payment denied') : __('Payment canceled');
Expand Down
8 changes: 8 additions & 0 deletions Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,14 @@ public function sendEcommerceAnalytics()
return $this->store->getConfig('payment/paynl/google_analytics_ecommerce') == 1;
}

/**
* @return boolean
*/
public function getPendingPage()
{
return $this->store->getConfig('payment/paynl/pay_pending_page') == 1;
}

/**
* @param string $methodCode
* @return string
Expand Down
8 changes: 7 additions & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<frontend_model>Paynl\Payment\Block\Adminhtml\Render\Credentials</frontend_model>
</field>
<field id="tokencode" translate="label, comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Tokencode</label>
<label>Token code</label>
<comment>
<![CDATA[Get your AT-code <a target='_blank' href='https://admin.pay.nl/company/tokens'>here</a>. Not registered at PAY? Sign up <a target='_blank' href='https://www.pay.nl/en?register'>here</a>!]]>
</comment>
Expand Down Expand Up @@ -190,6 +190,12 @@
<source_model>Paynl\Payment\Model\Config\Source\GoogleAnalytics</source_model>
<config_path>payment/paynl/google_analytics_ecommerce</config_path>
</field>
<field id="pay_pending_page" translate="label,comment" type="select" sortOrder="109" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Pending page</label>
<comment><![CDATA[Select whether you want to use the PAY. thank you page when transaction is pending.]]></comment>
<source_model>Paynl\Payment\Model\Config\Source\OffOn</source_model>
<config_path>payment/paynl/pay_pending_page</config_path>
</field>
</group>
</section>
<section id="payment">
Expand Down
1 change: 1 addition & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<discount_tax>1</discount_tax>
<pay_style_checkout>1</pay_style_checkout>
<order_description_prefix>Order </order_description_prefix>
<pay_pending_page>1</pay_pending_page>
</paynl>
<paynl_payment_paylink>
<active>0</active>
Expand Down
1 change: 1 addition & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,4 @@
"You are up to date with the latest version","You are up to date with the latest version"
"There is a new version available (","There is a new version available ("
"PAY. - This payment has been flagged as possibly fraudulent. Please verify this transaction in the Pay. portal.","PAY. - This payment has been flagged as possibly fraudulent. Please verify this transaction in the Pay. portal."
"Select whether you want to use the PAY. thank you page when transaction is pending.","Select whether you want to use the PAY. thank you page when transaction is pending."
1 change: 1 addition & 0 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,4 @@
"You are up to date with the latest version","U bent up to date met de laatste versie"
"There is a new version available (","Er is een nieuwe versie beschikbaar ("
"PAY. - This payment has been flagged as possibly fraudulent. Please verify this transaction in the Pay. portal.","PAY. - Deze betaling is gemarkeerd als mogelijk frauduleus. Controleer deze transactie in het Pay. portaal."
"Select whether you want to use the PAY. thank you page when transaction is pending.","Selecteer of u gebruik wilt maken van de PAY. bedankpagina wanneer de transactie in behandeling is."

0 comments on commit a11c681

Please sign in to comment.