Skip to content

Commit

Permalink
[MP2-6][MP2-5] Add country and IP checks
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k3lm committed Feb 18, 2019
1 parent 89af14b commit 1b9f23c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"minimum-stability": "stable",
"require": {
"sequra/magento2-core": "~2.1"
"sequra/magento2-core": "~2.2"
},
"autoload": {
"files": [
Expand Down
32 changes: 14 additions & 18 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@
-->

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<!-- Payment Method Facade configuration -->
<virtualType name="SequraPartpaymentsConfig" type="Sequra\Core\Model\Config">
<arguments>
<argument name="methodCode" xsi:type="const">\Sequra\Partpayments\Model\Ui\ConfigProvider::CODE</argument>
</arguments>
</virtualType>
<type name="Sequra\Partpayments\Block\Widget\Teaser">
<arguments>
<argument name="config" xsi:type="object">SequraPartpaymentsConfig</argument>
</arguments>
</type>

<!-- Payment Method Facade configuration -->
<virtualType name="SequraPartpaymentsGatewayFacade" type="Magento\Payment\Model\Method\Adapter">
<arguments>
Expand All @@ -31,7 +19,7 @@
</virtualType>

<!-- Configuration reader -->
<virtualType name="SequraPartpaymentsGatewayConfig" type="Magento\Payment\Gateway\Config\Config">
<virtualType name="SequraPartpaymentsGatewayConfig" type="Sequra\Core\Model\Config">
<arguments>
<argument name="methodCode" xsi:type="const">\Sequra\Partpayments\Model\Ui\ConfigProvider::CODE</argument>
</arguments>
Expand All @@ -50,22 +38,30 @@
</arguments>
</virtualType>

<virtualType name="SequraPartpaymentsCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
<arguments>
<argument name="config" xsi:type="object">SequraPartpaymentsGatewayConfig</argument>
</arguments>
</virtualType>
<virtualType name="SequraPartpaymentsValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
<arguments>
<argument name="validators" xsi:type="array">
<item name="country" xsi:type="string">SequraPartpaymentsCountryValidator</item>
<!--Core validator -->
<item name="currency" xsi:type="string">SequraGatewayCurrencyValidator</item>
</argument>
</arguments>
</virtualType>
<virtualType name="SequraPartpaymentsCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator">
<arguments>
<argument name="config" xsi:type="object">SequraPartpaymentsGatewayConfig</argument>
</arguments>
</virtualType>

<type name="Sequra\Partpayments\Block\Info">
<arguments>
<argument name="config" xsi:type="object">SequraPartpaymentsGatewayConfig</argument>
</arguments>
</type>

<type name="Sequra\Partpayments\Block\Widget\Teaser">
<arguments>
<argument name="config" xsi:type="object">SequraPartpaymentsGatewayConfig</argument>
</arguments>
</type>
</config>

0 comments on commit 1b9f23c

Please sign in to comment.