Skip to content

Commit 97e5cc3

Browse files
committed
Release 1.3.19
1 parent f6bcc26 commit 97e5cc3

File tree

17 files changed

+109
-38
lines changed

17 files changed

+109
-38
lines changed

Model/Config/Source/GdprMode.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* PostFinance Checkout Magento 2
4+
*
5+
* This Magento 2 extension enables to process payments with PostFinance Checkout (https://postfinance.ch/en/business/products/e-commerce/postfinance-checkout-all-in-one.html/).
6+
*
7+
* @package PostFinanceCheckout_Payment
8+
* @author wallee AG (http://www.wallee.com/)
9+
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Software License (ASL 2.0)
10+
*/
11+
namespace PostFinanceCheckout\Payment\Model\Config\Source;
12+
13+
/**
14+
* Provides the integration methods as array options.
15+
*/
16+
class GdprMode implements \Magento\Framework\Option\ArrayInterface
17+
{
18+
19+
const ENABLED = 'enabled';
20+
const DISABLED = 'disabled';
21+
22+
public function toOptionArray()
23+
{
24+
return [
25+
[
26+
'value' => self::ENABLED,
27+
'label' => \__('Enabled')
28+
],
29+
[
30+
'value' => self::DISABLED,
31+
'label' => \__('Disabled')
32+
]
33+
];
34+
}
35+
}

Model/Service/Quote/TransactionService.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,17 @@ private function convertQuoteBillingAddress(Quote $quote)
373373
}
374374

375375
$address = $this->convertAddress($quote->getBillingAddress());
376+
377+
$gdprEnabled = $this->scopeConfig->getValue('postfinancecheckout_payment/gdpr/gdpr_enabled',
378+
ScopeInterface::SCOPE_STORE, $quote->getStoreId());
379+
380+
if ($gdprEnabled == 'enabled') {
381+
// removing GDPR sensitive information
382+
$address->setDateOfBirth('');
383+
$address->setFamilyName('');
384+
$address->setGivenName('');
385+
$address->setStreet('');
386+
}
376387
$address->setDateOfBirth($this->getDateOfBirth($quote->getCustomerDob(), $quote->getCustomerId()));
377388
$address->setEmailAddress($this->getCustomerEmailAddress($quote->getCustomerEmail(), $quote->getCustomerId()));
378389
$address->setGender($this->getGender($quote->getCustomerGender(), $quote->getCustomerId()));
@@ -393,6 +404,16 @@ private function convertQuoteShippingAddress(Quote $quote)
393404
}
394405

395406
$address = $this->convertAddress($quote->getShippingAddress());
407+
$gdprEnabled = $this->scopeConfig->getValue('postfinancecheckout_payment/gdpr/gdpr_enabled',
408+
ScopeInterface::SCOPE_STORE, $quote->getStoreId());
409+
410+
if ($gdprEnabled == 'enabled') {
411+
// removing GDPR sensitive information
412+
$address->setDateOfBirth('');
413+
$address->setFamilyName('');
414+
$address->setGivenName('');
415+
$address->setStreet('');
416+
}
396417
$address->setEmailAddress($this->getCustomerEmailAddress($quote->getCustomerEmail(), $quote->getCustomerId()));
397418
return $address;
398419
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This repository contains the Magento 2 extension that enables to process payment
1212

1313
## Documentation
1414

15-
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.18/docs/en/documentation.html)
15+
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.19/docs/en/documentation.html)
1616

1717

1818
## Support
@@ -30,4 +30,4 @@ We do provide special integrations for the following one step checkouts:
3030

3131
## License
3232

33-
Please see the [license file](https://github.com/pfpayments/magento-2/blob/1.3.18/LICENSE) for more information.
33+
Please see the [license file](https://github.com/pfpayments/magento-2/blob/1.3.19/LICENSE) for more information.

Setup/Patch/Data/AddSetupData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static function getDependencies(){
5757
*/
5858

5959
public static function getVersion(){
60-
return '1.3.20';
60+
return '1.3.30';
6161
}
6262

6363
/**

Setup/Patch/Data/UpdateStatusStateData.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
use \Magento\Framework\Setup\Patch\PatchVersionInterface;
55
use \Magento\Framework\Module\Setup\Migration;
66
use \Magento\Framework\Setup\ModuleDataSetupInterface;
7+
use Magento\Framework\App\ResourceConnection;
8+
79

810

911
/**
@@ -13,30 +15,25 @@
1315

1416
class UpdateStatusStateData implements DataPatchInterface, PatchVersionInterface
1517
{
16-
private $status;
17-
1818
/**
19-
*
20-
* @param \PostFinanceCheckout\Payment\Model\Author $status
21-
*/
19+
* @var \Magento\Framework\Setup\ModuleDataSetupInterface
20+
*/
21+
protected $moduleDataSetup;
2222

2323
public function __construct(
24-
\Magento\Sales\Model\Order\Status $status
24+
ModuleDataSetupInterface $moduleDataSetup
2525
) {
26-
$this->status = $status;
26+
$this->moduleDataSetup = $moduleDataSetup;
2727
}
2828

2929
/**
3030
* @details: This updates the status to the correct status
3131
* @return:none
3232
*/
3333
public function apply(){
34-
$object_Manager = \Magento\Framework\App\ObjectManager::getInstance();
35-
$get_resource = $object_Manager->get('Magento\Framework\App\ResourceConnection');
36-
$connection = $get_resource->getConnection(); // get connection
37-
38-
$update_sql = "UPDATE sales_order_status_state SET is_default = 1 WHERE status = 'processing_postfinancecheckout'";
39-
$connection->query($update_sql);
34+
$tableName = $this->moduleDataSetup->getTable('sales_order_status_state');
35+
$updateSql = "UPDATE " . $tableName . " SET is_default = 1 WHERE status = 'processing_postfinancecheckout'";
36+
$this->moduleDataSetup->getConnection()->query($updateSql);
4037
}
4138

4239
/**
@@ -53,7 +50,7 @@ public static function getDependencies(){
5350
*/
5451

5552
public static function getVersion(){
56-
return '1.3.20';
53+
return '1.3.30';
5754
}
5855

5956
/**

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"type" : "magento2-module",
19-
"version" : "1.3.18",
19+
"version" : "1.3.19",
2020
"require" : {
2121
"php" : "~7.1.3||~7.2.0||~7.3.0||~7.4.0||~8.0||~8.1",
2222
"magento/framework" : "^102.0.0||^103.0.0",

docs/en/documentation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
2222
</a>
2323
</li>
2424
<li>
25-
<a href="https://github.com/pfpayments/magento-2/releases/tag/1.3.18/">
25+
<a href="https://github.com/pfpayments/magento-2/releases/tag/1.3.19/">
2626
Source
2727
</a>
2828
</li>

etc/adminhtml/system.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<resource>PostFinanceCheckout_Payment::config</resource>
1919
<group id="information" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
2020
<label>Information</label>
21-
<comment><![CDATA[If you need help setting up the PostFinance Checkout extension, check out the <a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.18/docs/en/documentation.html" target="_blank">documentation</a>.]]></comment>
21+
<comment><![CDATA[If you need help setting up the PostFinance Checkout extension, check out the <a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.19/docs/en/documentation.html" target="_blank">documentation</a>.]]></comment>
2222
<field id="version" translate="label" type="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
2323
<label>Module Version</label>
2424
</field>
@@ -66,6 +66,15 @@
6666
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
6767
</field>
6868
</group>
69+
70+
<group id="gdpr" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
71+
<label>GDPR Settings</label>
72+
<field id="gdpr_enabled" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
73+
<label>GDPR Mode</label>
74+
<comment>Enabled: this can impact certain payment methods and slow down the payment process</comment>
75+
<source_model>PostFinanceCheckout\Payment\Model\Config\Source\GdprMode</source_model>
76+
</field>
77+
</group>
6978
<group id="document" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
7079
<label>Document</label>
7180
<field id="customer_download_invoice" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">

etc/config.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<default>
1515
<postfinancecheckout_payment>
1616
<information>
17-
<version>1.3.18</version>
17+
<version>1.3.19</version>
1818
<sdk_version>3.1.2</sdk_version>
1919
</information>
2020
<general>
@@ -28,6 +28,9 @@
2828
<email>
2929
<order>1</order>
3030
</email>
31+
<gdpr>
32+
<gdpr_enabled>disabled</gdpr_enabled>
33+
</gdpr>
3134
<document>
3235
<customer_download_invoice>1</customer_download_invoice>
3336
<customer_download_packing_slip>1</customer_download_packing_slip>

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
-->
1313
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
14-
<module name="PostFinanceCheckout_Payment" setup_version="1.3.18">
14+
<module name="PostFinanceCheckout_Payment" setup_version="1.3.19">
1515
<sequence>
1616
<module name="Magento_Sales"/>
1717
<module name="Magento_Payment"/>

0 commit comments

Comments
 (0)