Skip to content

Commit

Permalink
Merge pull request #125 from paynl/feature/PLUG-2072
Browse files Browse the repository at this point in the history
PLUG-2072 - Add configurable exchange URL
  • Loading branch information
woutse authored Jul 11, 2023
2 parents 0d32ad0 + bcf2b59 commit f728560
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,14 @@ public function getDefaultPaymentOption()
return $this->store->getConfig('payment/paynl/default_payment_option');
}

/**
* @return string
*/
public function getCustomExchangeUrl()
{
return $this->store->getConfig('payment/paynl/custom_exchange_url');
}

/**
* @return string
*/
Expand Down
8 changes: 8 additions & 0 deletions Model/PayPaymentCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ public function setFinishURL(string $finishUrl)
public function setExchangeURL(string $exchangeURL)
{
$this->paymentData['exchangeURL'] = $exchangeURL;

$customExchangeURL = $this->payConfig->getCustomExchangeUrl();
$customExchangeURL = is_null($customExchangeURL) ? '' : trim($customExchangeURL);

if (!empty($customExchangeURL)) {
$this->paymentData['exchangeURL'] = $customExchangeURL;
}

return $this;
}

Expand Down
5 changes: 5 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@
<source_model>Paynl\Payment\Model\Config\Source\OffOn</source_model>
<config_path>payment/paynl/pay_pending_page</config_path>
</field>
<field id="custom_exchange_url" translate="label" type="text" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Custom Exchange URL</label>
<comment><![CDATA[Use your own exchange-handler. Example: https://www.yourdomain.nl/exchange_handler?action=#action#&order_id=#order_id#]]></comment>
<config_path>payment/paynl/custom_exchange_url</config_path>
</field>
</group>
</section>
<section id="payment">
Expand Down
1 change: 1 addition & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,4 @@
"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."
"Automatically void authorisation-transactions when cancelling an order.","Automatically void authorisation-transactions when cancelling an order."
"Use your own exchange-handler. Example: https://www.yourdomain.nl/exchange_handler?action=#action#&order_id=#order_id#","Use your own exchange-handler. Example: https://www.yourdomain.nl/exchange_handler?action=#action#&order_id=#order_id#"
1 change: 1 addition & 0 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,4 @@
"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."
"Automatically void authorisation-transactions when cancelling an order.","Authorize-transacties automatisch vrijgeven bij het annuleren van een bestelling."
"Use your own exchange-handler. Example: https://www.yourdomain.nl/exchange_handler?action=#action#&order_id=#order_id#","Gebruik je eigen exchange-handler. Voorbeeld: https://www.yourdomain.nl/exchange_handler?action=#action#&order_id=#order_id#"

0 comments on commit f728560

Please sign in to comment.