forked from mcspronko/liqpay-magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create remaining configuration settings mcspronko#16
- Loading branch information
1 parent
5d05bfd
commit 1b9d21b
Showing
7 changed files
with
141 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* Copyright © Pronko Consulting (https://www.pronkoconsulting.com) | ||
* See LICENSE for the license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Pronko\LiqPayAdmin\Source; | ||
|
||
use Magento\Framework\Data\OptionSourceInterface; | ||
|
||
/** | ||
* Class ConnectionType | ||
*/ | ||
class Currencies implements OptionSourceInterface | ||
{ | ||
const USD = 'USD'; | ||
const EUR = 'EUR'; | ||
const RUB = 'RUB'; | ||
const UAH = 'UAH'; | ||
|
||
/** | ||
* Return array of options as value-label pairs | ||
* | ||
* @return array Format: array(array('value' => '<value>', 'label' => '<label>'), ...) | ||
*/ | ||
public function toOptionArray() | ||
{ | ||
return [ | ||
['value' => self::USD, 'label' => __(self::USD)], | ||
['value' => self::EUR, 'label' => __(self::EUR)], | ||
['value' => self::RUB, 'label' => __(self::RUB)], | ||
['value' => self::UAH, 'label' => __(self::UAH)] | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0"?> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> | ||
<default> | ||
<payment> | ||
<pronko_liqpay_section> | ||
<pronko_liqpay> | ||
<pronko_liqpay_general> | ||
<payment_action> | ||
<payment_action>authorize</payment_action> | ||
</payment_action> | ||
</pronko_liqpay_general> | ||
<pronko_liqpay_advanced> | ||
<order_status>processing</order_status> | ||
<accepted_currencies>USD</accepted_currencies> | ||
</pronko_liqpay_advanced> | ||
</pronko_liqpay> | ||
</pronko_liqpay_section> | ||
</payment> | ||
</default> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* Copyright © Pronko Consulting (https://www.pronkoconsulting.com) | ||
* See LICENSE for the license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Pronko\LiqPayCardAdmin\Model\Source; | ||
|
||
use Magento\Payment\Model\Source\Cctype as PaymentCctype; | ||
|
||
class Cctype extends PaymentCctype | ||
{ | ||
/** | ||
* Return all supported credit card types | ||
* | ||
* @return string[] | ||
*/ | ||
public function getAllowedTypes() | ||
{ | ||
return ['VI', 'MC', 'AE', 'DI', 'JCB', 'DN']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0"?> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> | ||
<system> | ||
<section id="payment"> | ||
<group id="pronko_liqpay_section" sortOrder="6" showInDefault="1" showInWebsite="1" showInStore="1"> | ||
<group id="pronko_liqpay" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1"> | ||
<label>LiqPay</label> | ||
<fieldset_css>complex</fieldset_css> | ||
<attribute type="displayIn">other_payment_methods</attribute> | ||
<group id="pronko_liqpay_card_payment" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="5"> | ||
<label>Card Payment</label> | ||
<attribute type="expanded">1</attribute> | ||
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model> | ||
<field id="cctypes" translate="label" type="multiselect" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> | ||
<label>Credit Card Types</label> | ||
<source_model>Pronko\LiqPayCardAdmin\Model\Source\Cctype</source_model> | ||
</field> | ||
</group> | ||
</group> | ||
</group> | ||
</section> | ||
</system> | ||
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters