Skip to content

Commit d61f90a

Browse files
authored
Merge pull request #77 from unzerdev/release/3.2.5
Added Direct Bank Transfer
2 parents a74431a + 4218e4f commit d61f90a

File tree

17 files changed

+206
-3
lines changed

17 files changed

+206
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
55

6+
## [3.2.5](https://github.com/unzerdev/magento2/compare/3.2.4..3.2.5)
7+
### Added
8+
* Direct Bank Transfer
9+
610
## [3.2.4](https://github.com/unzerdev/magento2/compare/3.2.3..3.2.4)
711
### Changed
812
* Updated CSP Whitelist
@@ -109,6 +113,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/) a
109113
* "pending" order status with payment methods, which use redirects to external pages, like PayPal. The Status "pending_payment" is now set before the redirect happens, so Magento can cancel abandoned orders automatically
110114
* problems with bundle products and how discounts are transferred to the Unzer servers. Previously discounts for cart items would have been transferred to the Unzer Servers per item. Now only the sum of all discounts for the whole cart is transferred, otherwise we would end up with rounding errors.
111115

116+
## [2.2.1](https://github.com/unzerdev/magento2/compare/2.2.0..2.2.1)
117+
### Fixed
118+
* bank name not needed anymore for eps payment method
119+
112120
## [2.2.0](https://github.com/unzerdev/magento2/compare/2.1.1..2.2.0)
113121

114122
### Added

Model/Config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class Config extends \Magento\Payment\Gateway\Config\Config
5858
public const METHOD_APPLEPAYV2 = 'unzer_applepayv2';
5959
public const METHOD_GOOGLEPAY = 'unzer_googlepay';
6060
public const METHOD_TWINT = 'unzer_twint';
61+
public const METHOD_OPEN_BANKING = 'unzer_open_banking';
6162

6263
/**
6364
* @var DebugHandler

Model/Config/Provider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class Provider implements ConfigProviderInterface
4747
Config::METHOD_APPLEPAYV2,
4848
Config::METHOD_GOOGLEPAY,
4949
Config::METHOD_TWINT,
50+
Config::METHOD_OPEN_BANKING,
5051
];
5152

5253
/**

Model/Method/OpenBanking.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace Unzer\PAPI\Model\Method;
5+
6+
/**
7+
* Unzer Open Banking payment method
8+
*
9+
* @link https://docs.unzer.com/
10+
*/
11+
class OpenBanking extends Base
12+
{
13+
/**
14+
* @inheritDoc
15+
*/
16+
public function hasRedirect(): bool
17+
{
18+
return true;
19+
}
20+
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"name": "unzerdev/magento2",
33
"description": "This extension for Magento 2 provides a direct integration of the Unzer payment types to your Magento 2 shop via the Unzer Payment API (PAPI).",
44
"type": "magento2-module",
5-
"version": "3.2.4",
5+
"version": "3.2.5",
66
"license": "Apache-2.0",
77
"require": {
88
"php": "~7.4.0|~8.1.0|~8.2.0|~8.3.0",
9-
"unzerdev/php-sdk": "^3.5.0",
9+
"unzerdev/php-sdk": "^3.11.0",
1010
"ext-json": "*",
1111
"magento/framework": "*",
1212
"magento/module-backend": "*",

etc/adminhtml/system.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
<include path="Unzer_PAPI::system/applepayv2.xml"/>
7474
<include path="Unzer_PAPI::system/googlepay.xml"/>
7575
<include path="Unzer_PAPI::system/twint.xml"/>
76+
<include path="Unzer_PAPI::system/open_banking.xml"/>
7677
</group>
7778
</section>
7879
</system>

etc/adminhtml/system/open_banking.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0"?>
2+
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
3+
<group id="unzer_open_banking" translate="label" type="text" sortOrder="30" showInDefault="1"
4+
showInWebsite="1" showInStore="1">
5+
<label>UNZER_OPEN_BANKING</label>
6+
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1"
7+
showInWebsite="1" showInStore="1">
8+
<label>Enabled</label>
9+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
10+
<config_path>payment/unzer_open_banking/active</config_path>
11+
</field>
12+
<field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1"
13+
showInStore="1">
14+
<label>Title</label>
15+
<config_path>payment/unzer_open_banking/title</config_path>
16+
</field>
17+
<field id="min_order_total" translate="label" type="text" sortOrder="50" showInDefault="1"
18+
showInWebsite="1" showInStore="1">
19+
<label>Minimum Order Total</label>
20+
<config_path>payment/unzer_open_banking/min_order_total</config_path>
21+
</field>
22+
<field id="max_order_total" translate="label" type="text" sortOrder="60" showInDefault="1"
23+
showInWebsite="1" showInStore="1">
24+
<label>Maximum Order Total</label>
25+
<config_path>payment/unzer_open_banking/max_order_total</config_path>
26+
<comment>Insert 0 to disable limit.</comment>
27+
</field>
28+
<field id="sort_order" translate="label" type="text" sortOrder="70" showInDefault="1"
29+
showInWebsite="1" showInStore="1">
30+
<label>Sort Order</label>
31+
<config_path>payment/unzer_open_banking/sort_order</config_path>
32+
</field>
33+
</group>
34+
</include>

etc/config.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,23 @@
458458
<currency_restrictions>CHF</currency_restrictions>
459459
<model>Unzer\PAPI\Model\Method\Twint</model>
460460
</unzer_twint>
461+
<unzer_open_banking>
462+
<active>0</active>
463+
<payment_action>order</payment_action>
464+
<order_payment_action>authorize_capture</order_payment_action>
465+
<title><![CDATA[Direct Bank Transfer]]></title>
466+
<allowspecific>0</allowspecific>
467+
<min_order_total>0</min_order_total>
468+
<max_order_total>0</max_order_total>
469+
<country_restrictions>AT,DE</country_restrictions>
470+
<can_authorize>0</can_authorize>
471+
<can_capture>1</can_capture>
472+
<can_order>1</can_order>
473+
<can_void>1</can_void>
474+
<can_use_checkout>1</can_use_checkout>
475+
<can_use_internal>0</can_use_internal>
476+
<model>Unzer\PAPI\Model\Method\OpenBanking</model>
477+
</unzer_open_banking>
461478
</payment>
462479
</default>
463480
</config>

etc/di.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,4 +1539,55 @@
15391539
<argument name="commandPool" xsi:type="object">UnzerAuthorizeAndCaptureCommandPool</argument>
15401540
</arguments>
15411541
</type>
1542+
1543+
<!-- Define types for Open Banking payment method-->
1544+
<virtualType name="UnzerOpenBankingConfig" type="Unzer\PAPI\Model\Config">
1545+
<arguments>
1546+
<argument name="methodCode" xsi:type="const">Unzer\PAPI\Model\Config::METHOD_OPEN_BANKING</argument>
1547+
</arguments>
1548+
</virtualType>
1549+
1550+
<virtualType name="UnzerOpenBankingConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
1551+
<arguments>
1552+
<argument name="configInterface" xsi:type="object">UnzerOpenBankingConfig</argument>
1553+
</arguments>
1554+
</virtualType>
1555+
1556+
<virtualType name="UnzerOpenBankingValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
1557+
<arguments>
1558+
<argument name="handlers" xsi:type="array">
1559+
<item name="default" xsi:type="string">UnzerOpenBankingConfigValueHandler</item>
1560+
<item name="can_cancel" xsi:type="string">Unzer\PAPI\Model\Config\CanCancelHandler</item>
1561+
<item name="can_refund" xsi:type="string">Unzer\PAPI\Model\Config\CanRefundHandler</item>
1562+
<item name="can_refund_partial_per_invoice" xsi:type="string">Unzer\PAPI\Model\Config\CanRefundHandler
1563+
</item>
1564+
<item name="can_void" xsi:type="string">Unzer\PAPI\Model\Config\CanVoidHandler</item>
1565+
</argument>
1566+
</arguments>
1567+
</virtualType>
1568+
1569+
<virtualType name="UnzerOpenBankingValidatorCountry" type="Unzer\PAPI\Model\Validator\CountryRestrictionValidator">
1570+
<arguments>
1571+
<argument name="config" xsi:type="object">UnzerOpenBankingConfig</argument>
1572+
</arguments>
1573+
</virtualType>
1574+
1575+
<virtualType name="UnzerOpenBankingValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
1576+
<arguments>
1577+
<argument name="validators" xsi:type="array">
1578+
<item name="country" xsi:type="string">UnzerOpenBankingValidatorCountry</item>
1579+
</argument>
1580+
</arguments>
1581+
</virtualType>
1582+
1583+
<type name="Unzer\PAPI\Model\Method\OpenBanking">
1584+
<arguments>
1585+
<argument name="code" xsi:type="const">Unzer\PAPI\Model\Config::METHOD_OPEN_BANKING</argument>
1586+
<argument name="formBlockType" xsi:type="string">Magento\Payment\Block\Form</argument>
1587+
<argument name="infoBlockType" xsi:type="string">Magento\Payment\Block\Info</argument>
1588+
<argument name="valueHandlerPool" xsi:type="object">UnzerOpenBankingValueHandlerPool</argument>
1589+
<argument name="validatorPool" xsi:type="object">UnzerOpenBankingValidatorPool</argument>
1590+
<argument name="commandPool" xsi:type="object">UnzerCaptureCommandPool</argument>
1591+
</arguments>
1592+
</type>
15421593
</config>

etc/events.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,7 @@
7575
<event name="payment_method_assign_data_unzer_twint">
7676
<observer name="unzer_twint_data_assign" instance="Unzer\PAPI\Model\Method\Observer\BaseDataAssignObserver" />
7777
</event>
78+
<event name="payment_method_assign_data_unzer_open_banking">
79+
<observer name="unzer_open_banking_data_assign" instance="Unzer\PAPI\Model\Method\Observer\BaseDataAssignObserver" />
80+
</event>
7881
</config>

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
4-
<module name="Unzer_PAPI" setup_version="3.2.4">
4+
<module name="Unzer_PAPI" setup_version="3.2.5">
55
<sequence>
66
<module name="Magento_Checkout"/>
77
<module name="Magento_Config" />

0 commit comments

Comments
 (0)