Skip to content

Commit 5d2ae5e

Browse files
committed
Don't validate private key if empty
1 parent 3707297 commit 5d2ae5e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Model/Config/PrivateKey.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ public function __construct(
4848

4949
public function beforeSave()
5050
{
51+
if (empty($this->getValue())) {
52+
return parent::beforeSave();
53+
}
54+
5155
$label = $this->getData('field_config/label');
5256

5357
$client = new Client(

src/etc/adminhtml/system.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<field id="private_api_key" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
2323
<label>Private API Key</label>
2424
<backend_model>Aplazame\Payment\Model\Config\PrivateKey</backend_model>
25-
<validate>required-entry</validate>
2625
</field>
2726

2827
<field id="product_widget_enabled" translate="label" type="select" sortOrder="35" showInDefault="1" showInWebsite="1" showInStore="0">
@@ -38,7 +37,6 @@
3837

3938
<field id="payment_button" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
4039
<label>Aplazame Button CSS Selector</label>
41-
<validate>required-entry</validate>
4240
</field>
4341

4442
<field id="allowspecific" translate="label" type="allowspecific" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">

0 commit comments

Comments
 (0)