Skip to content

Added Direct Bank Transfer #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

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).

## [3.2.5](https://github.com/unzerdev/magento2/compare/3.2.4..3.2.5)
### Added
* Direct Bank Transfer

## [3.2.4](https://github.com/unzerdev/magento2/compare/3.2.3..3.2.4)
### Changed
* Updated CSP Whitelist
Expand Down Expand Up @@ -109,6 +113,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/) a
* "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
* 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.

## [2.2.1](https://github.com/unzerdev/magento2/compare/2.2.0..2.2.1)
### Fixed
* bank name not needed anymore for eps payment method

## [2.2.0](https://github.com/unzerdev/magento2/compare/2.1.1..2.2.0)

### Added
Expand Down
1 change: 1 addition & 0 deletions Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class Config extends \Magento\Payment\Gateway\Config\Config
public const METHOD_APPLEPAYV2 = 'unzer_applepayv2';
public const METHOD_GOOGLEPAY = 'unzer_googlepay';
public const METHOD_TWINT = 'unzer_twint';
public const METHOD_OPEN_BANKING = 'unzer_open_banking';

/**
* @var DebugHandler
Expand Down
1 change: 1 addition & 0 deletions Model/Config/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Provider implements ConfigProviderInterface
Config::METHOD_APPLEPAYV2,
Config::METHOD_GOOGLEPAY,
Config::METHOD_TWINT,
Config::METHOD_OPEN_BANKING,
];

/**
Expand Down
20 changes: 20 additions & 0 deletions Model/Method/OpenBanking.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);

namespace Unzer\PAPI\Model\Method;

/**
* Unzer Open Banking payment method
*
* @link https://docs.unzer.com/
*/
class OpenBanking extends Base
{
/**
* @inheritDoc
*/
public function hasRedirect(): bool
{
return true;
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "unzerdev/magento2",
"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).",
"type": "magento2-module",
"version": "3.2.4",
"version": "3.2.5",
"license": "Apache-2.0",
"require": {
"php": "~7.4.0|~8.1.0|~8.2.0|~8.3.0",
"unzerdev/php-sdk": "^3.5.0",
"unzerdev/php-sdk": "^3.11.0",
"ext-json": "*",
"magento/framework": "*",
"magento/module-backend": "*",
Expand Down
1 change: 1 addition & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<include path="Unzer_PAPI::system/applepayv2.xml"/>
<include path="Unzer_PAPI::system/googlepay.xml"/>
<include path="Unzer_PAPI::system/twint.xml"/>
<include path="Unzer_PAPI::system/open_banking.xml"/>
</group>
</section>
</system>
Expand Down
34 changes: 34 additions & 0 deletions etc/adminhtml/system/open_banking.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="unzer_open_banking" translate="label" type="text" sortOrder="30" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>UNZER_OPEN_BANKING</label>
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Enabled</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/unzer_open_banking/active</config_path>
</field>
<field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>Title</label>
<config_path>payment/unzer_open_banking/title</config_path>
</field>
<field id="min_order_total" translate="label" type="text" sortOrder="50" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Minimum Order Total</label>
<config_path>payment/unzer_open_banking/min_order_total</config_path>
</field>
<field id="max_order_total" translate="label" type="text" sortOrder="60" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Maximum Order Total</label>
<config_path>payment/unzer_open_banking/max_order_total</config_path>
<comment>Insert 0 to disable limit.</comment>
</field>
<field id="sort_order" translate="label" type="text" sortOrder="70" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Sort Order</label>
<config_path>payment/unzer_open_banking/sort_order</config_path>
</field>
</group>
</include>
17 changes: 17 additions & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,23 @@
<currency_restrictions>CHF</currency_restrictions>
<model>Unzer\PAPI\Model\Method\Twint</model>
</unzer_twint>
<unzer_open_banking>
<active>0</active>
<payment_action>order</payment_action>
<order_payment_action>authorize_capture</order_payment_action>
<title><![CDATA[Direct Bank Transfer]]></title>
<allowspecific>0</allowspecific>
<min_order_total>0</min_order_total>
<max_order_total>0</max_order_total>
<country_restrictions>AT,DE</country_restrictions>
<can_authorize>0</can_authorize>
<can_capture>1</can_capture>
<can_order>1</can_order>
<can_void>1</can_void>
<can_use_checkout>1</can_use_checkout>
<can_use_internal>0</can_use_internal>
<model>Unzer\PAPI\Model\Method\OpenBanking</model>
</unzer_open_banking>
</payment>
</default>
</config>
51 changes: 51 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1539,4 +1539,55 @@
<argument name="commandPool" xsi:type="object">UnzerAuthorizeAndCaptureCommandPool</argument>
</arguments>
</type>

<!-- Define types for Open Banking payment method-->
<virtualType name="UnzerOpenBankingConfig" type="Unzer\PAPI\Model\Config">
<arguments>
<argument name="methodCode" xsi:type="const">Unzer\PAPI\Model\Config::METHOD_OPEN_BANKING</argument>
</arguments>
</virtualType>

<virtualType name="UnzerOpenBankingConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler">
<arguments>
<argument name="configInterface" xsi:type="object">UnzerOpenBankingConfig</argument>
</arguments>
</virtualType>

<virtualType name="UnzerOpenBankingValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">
<arguments>
<argument name="handlers" xsi:type="array">
<item name="default" xsi:type="string">UnzerOpenBankingConfigValueHandler</item>
<item name="can_cancel" xsi:type="string">Unzer\PAPI\Model\Config\CanCancelHandler</item>
<item name="can_refund" xsi:type="string">Unzer\PAPI\Model\Config\CanRefundHandler</item>
<item name="can_refund_partial_per_invoice" xsi:type="string">Unzer\PAPI\Model\Config\CanRefundHandler
</item>
<item name="can_void" xsi:type="string">Unzer\PAPI\Model\Config\CanVoidHandler</item>
</argument>
</arguments>
</virtualType>

<virtualType name="UnzerOpenBankingValidatorCountry" type="Unzer\PAPI\Model\Validator\CountryRestrictionValidator">
<arguments>
<argument name="config" xsi:type="object">UnzerOpenBankingConfig</argument>
</arguments>
</virtualType>

<virtualType name="UnzerOpenBankingValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool">
<arguments>
<argument name="validators" xsi:type="array">
<item name="country" xsi:type="string">UnzerOpenBankingValidatorCountry</item>
</argument>
</arguments>
</virtualType>

<type name="Unzer\PAPI\Model\Method\OpenBanking">
<arguments>
<argument name="code" xsi:type="const">Unzer\PAPI\Model\Config::METHOD_OPEN_BANKING</argument>
<argument name="formBlockType" xsi:type="string">Magento\Payment\Block\Form</argument>
<argument name="infoBlockType" xsi:type="string">Magento\Payment\Block\Info</argument>
<argument name="valueHandlerPool" xsi:type="object">UnzerOpenBankingValueHandlerPool</argument>
<argument name="validatorPool" xsi:type="object">UnzerOpenBankingValidatorPool</argument>
<argument name="commandPool" xsi:type="object">UnzerCaptureCommandPool</argument>
</arguments>
</type>
</config>
3 changes: 3 additions & 0 deletions etc/events.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@
<event name="payment_method_assign_data_unzer_twint">
<observer name="unzer_twint_data_assign" instance="Unzer\PAPI\Model\Method\Observer\BaseDataAssignObserver" />
</event>
<event name="payment_method_assign_data_unzer_open_banking">
<observer name="unzer_open_banking_data_assign" instance="Unzer\PAPI\Model\Method\Observer\BaseDataAssignObserver" />
</event>
</config>
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Unzer_PAPI" setup_version="3.2.4">
<module name="Unzer_PAPI" setup_version="3.2.5">
<sequence>
<module name="Magento_Checkout"/>
<module name="Magento_Config" />
Expand Down
Loading