Skip to content

Commit

Permalink
Merge pull request #67 from paynl/feature/PLUG-1326
Browse files Browse the repository at this point in the history
feature/PLUG-1326 - Testmode extra explanation
  • Loading branch information
woutse authored Nov 1, 2022
2 parents e711321 + 5b07d35 commit b4003d4
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
38 changes: 38 additions & 0 deletions Model/Config/Source/TestMode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace Paynl\Payment\Model\Config\Source;

use \Magento\Framework\Option\ArrayInterface;

class TestMode implements ArrayInterface
{

/**
* Options getter
*
* @return array
*/
public function toOptionArray()
{
$arrOptions = $this->toArray();

$arrResult = [];
foreach ($arrOptions as $value => $label) {
$arrResult[] = ['value' => $value, 'label' => $label];
}
return $arrResult;
}

/**
* Get options in "key-value" format
*
* @return array
*/
public function toArray()
{
return [
'0' => __('No - live transactions enabled'),
'1' => __('Yes - test mode enabled'),
];
}
}
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</field>
<field id="testmode" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Testmode</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<source_model>Paynl\Payment\Model\Config\Source\TestMode</source_model>
<config_path>payment/paynl/testmode</config_path>
</field>
</group>
Expand Down
2 changes: 2 additions & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,5 @@
"Set which product data to use as product ID in the PAY. backend.","Set which product data to use as product ID in the PAY. backend."
"Leave shipping address unchanged (Default)","Leave shipping address unchanged (Default)"
"Use billing address as shipping address","Use billing address as shipping address"
"Yes - test mode enabled", "Yes - test mode enabled"
"No - live transactions enabled", "No - live transactions enabled"
2 changes: 2 additions & 0 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@
"Service-ID, API-Token or Tokencode invalid","Service-ID, API-Token of Tokencode zijn onjuist"
"Service-ID is invalid.","Service-ID is onjuist"
"Service-ID / API-Token combination is invalid.","Service-ID / API-Token combinatie is onjuist"
"Yes - test mode enabled", "Ja - test modus aan"
"No - live transactions enabled", "Nee - live transacties aan"
"No logging","Geen logging"
"Only Critical errors are logged","Alleen kritieke fouten worden gelogd"
"Only Critical errors and Notices are logged","Alleen kritieke fouten en waarschuwingen worden gelogd"
Expand Down

0 comments on commit b4003d4

Please sign in to comment.