Skip to content

Commit

Permalink
Create remaining configuration settings mcspronko#16 code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolalardev committed Aug 30, 2019
1 parent 1b9d21b commit 7b1eef9
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 18 deletions.
2 changes: 1 addition & 1 deletion admin/Source/Currencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Magento\Framework\Data\OptionSourceInterface;

/**
* Class ConnectionType
* Class Currencies
*/
class Currencies implements OptionSourceInterface
{
Expand Down
28 changes: 28 additions & 0 deletions admin/Source/PaymentAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* Copyright © Pronko Consulting (https://www.pronkoconsulting.com)
* See LICENSE for the license details.
*/
declare(strict_types = 1);

namespace Pronko\LiqPayAdmin\Source;

class PaymentAction implements \Magento\Framework\Data\OptionSourceInterface
{
/**
* @inheritdoc
*/
public function toOptionArray(): array
{
return [
[
'value' => 'authorize',
'label' => __('Authorize Only'),
],
[
'value' => 'authorize_capture',
'label' => __('Authorize and Capture')
]
];
}
}
14 changes: 7 additions & 7 deletions admin/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
<source_model>Pronko\LiqPayAdmin\Source\ConnectionType</source_model>
<config_path>payment/pronko_liqpay/connection_type</config_path>
</field>
<field id="payment_action" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<field id="payment_action" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Payment Action</label>
<source_model>Magento\AuthorizenetAcceptjs\Model\Adminhtml\Source\PaymentAction</source_model>
<source_model>Pronko\LiqPayAdmin\Source\PaymentAction</source_model>
<config_path>payment/pronko_liqpay/payment_action</config_path>
</field>
</group>
Expand Down Expand Up @@ -85,18 +85,18 @@
<label>Maximum Order Total</label>
<config_path>payment/pronko_liqpay/maximum_order_total</config_path>
</field>
<field id="sort_order" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="sort_total" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Sort Total</label>
<config_path>payment/pronko_liqpay/sort_order</config_path>
<config_path>payment/pronko_liqpay/sort_total</config_path>
</field>
<field id="order_status" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<field id="order_status" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>New Order Status</label>
<source_model>Magento\Sales\Model\Config\Source\Order\Status\Processing</source_model>
<source_model>Magento\Sales\Model\Config\Source\Order\Status</source_model>
</field>
<field id="accepted_currencies" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Accepted Currencies</label>
<source_model>Pronko\LiqPayAdmin\Source\Currencies</source_model>
<config_path>payment/pronko_liqpay/mode</config_path>
<config_path>payment/pronko_liqpay/accepted_currencies</config_path>
</field>
</group>
</group>
Expand Down
2 changes: 1 addition & 1 deletion admin/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
</pronko_liqpay_section>
</payment>
</default>
</config>
</config>
6 changes: 1 addition & 5 deletions admin/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Pronko_LiqPayAdmin">
<sequence>
<module name="Magento_Sales"/>
</sequence>
</module>
<module name="Pronko_LiqPayAdmin" />
</config>
2 changes: 1 addition & 1 deletion card-admin/Model/Source/Cctype.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ class Cctype extends PaymentCctype
*/
public function getAllowedTypes()
{
return ['VI', 'MC', 'AE', 'DI', 'JCB', 'DN'];
return ['VI', 'MC'];
}
}
4 changes: 1 addition & 3 deletions card-admin/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
<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">
<field id="cctypes" translate="label" type="multiselect" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Credit Card Types</label>
<source_model>Pronko\LiqPayCardAdmin\Model\Source\Cctype</source_model>
</field>
Expand Down

0 comments on commit 7b1eef9

Please sign in to comment.