Skip to content

Commit 768e8cd

Browse files
committed
Release 1.3.15
1 parent 51ed488 commit 768e8cd

15 files changed

+55
-33
lines changed

Helper/Data.php

+10-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Magento\Framework\App\State as AppState;
1515
use Magento\Framework\App\Helper\AbstractHelper;
1616
use Magento\Framework\App\Helper\Context;
17-
use PostFinanceCheckout\Payment\Model\Provider\CurrencyProvider;
17+
use Magento\Framework\Pricing\Helper\Data as MagentoCurrencyHelper;
1818
use PostFinanceCheckout\Sdk\Model\CriteriaOperator;
1919
use PostFinanceCheckout\Sdk\Model\EntityQueryFilter;
2020
use PostFinanceCheckout\Sdk\Model\EntityQueryFilterType;
@@ -32,24 +32,24 @@ class Data extends AbstractHelper
3232
* @var AppState
3333
*/
3434
private $appState;
35-
35+
3636
/**
3737
*
38-
* @var CurrencyProvider
38+
* @var MagentoCurrencyHelper
3939
*/
40-
private $currencyProvider;
40+
private $magentoCurrencyHelper;
4141

4242
/**
4343
*
4444
* @param Context $context
4545
* @param AppState $appState
46-
* @param CurrencyProvider $currencyProvider
46+
* @param MagentoCurrencyHelper $magentoCurrencyHelper
4747
*/
48-
public function __construct(Context $context, AppState $appState, CurrencyProvider $currencyProvider)
48+
public function __construct(Context $context, AppState $appState, MagentoCurrencyHelper $magentoCurrencyHelper)
4949
{
5050
parent::__construct($context);
5151
$this->appState = $appState;
52-
$this->currencyProvider = $currencyProvider;
52+
$this->magentoCurrencyHelper = $magentoCurrencyHelper;
5353
}
5454

5555
/**
@@ -87,11 +87,12 @@ public function getCurrencyFractionDigits($currencyCode)
8787
*/
8888
public function roundAmount($amount, $currencyCode)
8989
{
90-
return \round($amount, $this->getCurrencyFractionDigits($currencyCode));
90+
$roundedAmount = $this->magentoCurrencyHelper->currency($amount, false, false);
91+
return $roundedAmount;
9192
}
9293

9394
/**
94-
* Compares the given amounts.
95+
* Compares the given amounts.`
9596
*
9697
* @param float $amount1
9798
* @param float $amount2

Model/Service/AbstractLineItemService.php

+22-11
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,15 @@ public function __construct(Helper $helper, LineItemHelper $lineItemHelper, Scop
128128
$this->giftCardAccountManagement = $giftCardAccountManagement;
129129
}
130130

131+
/*
132+
* @return bool
133+
*/
134+
protected function checkIsAdmin() {
135+
$om = \Magento\Framework\App\ObjectManager::getInstance();
136+
$state = $om->get('Magento\Framework\App\State');
137+
return 'adminhtml' === $state->getAreaCode();
138+
}
139+
131140
/**
132141
* Convers the entity's items to line items.
133142
*
@@ -149,19 +158,21 @@ protected function convertLineItems($entity)
149158
$items[] = $shippingLineItems;
150159
}
151160

152-
if ($this->giftCardAccountManagement instanceof \Magento\GiftCardAccount\Model\Service\GiftCardAccountManagement) {
153-
/**
154-
* @var Magento\GiftCardAccount\Model\Giftcardaccount
155-
*/
156-
$giftCardaccount = $this->giftCardAccountManagement->getListByQuoteId($entity->get()['entity_id']);
161+
if (!$this->checkIsAdmin()) {
162+
if ($this->giftCardAccountManagement instanceof \Magento\GiftCardAccount\Model\Service\GiftCardAccountManagement) {
163+
/**
164+
* @var Magento\GiftCardAccount\Model\Giftcardaccount
165+
*/
166+
$giftCardaccount = $this->giftCardAccountManagement->getListByQuoteId($entity->get()['entity_id']);
157167

158-
if ($giftCardaccount instanceof \Magento\GiftCardAccount\Model\Giftcardaccount && count($giftCardaccount->getGiftCards()) > 0) {
159-
$giftCardCode = current($giftCardaccount->getGiftCards());
160-
$ammount = $giftCardaccount->getGiftCardsAmountUsed();
161-
$currencyCode = $this->getCurrencyCode($entity);
168+
if ($giftCardaccount instanceof \Magento\GiftCardAccount\Model\Giftcardaccount && count($giftCardaccount->getGiftCards()) > 0) {
169+
$giftCardCode = current($giftCardaccount->getGiftCards());
170+
$ammount = $giftCardaccount->getGiftCardsAmountUsed();
171+
$currencyCode = $this->getCurrencyCode($entity);
162172

163-
// Builds the LineItem with gift card ammount.
164-
$items[] = $this->lineItemHelper->createGiftCardLineItem($giftCardCode, $ammount, $currencyCode);
173+
// Builds the LineItem with gift card ammount.
174+
$items[] = $this->lineItemHelper->createGiftCardLineItem($giftCardCode, $ammount, $currencyCode);
175+
}
165176
}
166177
}
167178

Model/Service/Quote/TransactionService.php

+10
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@ private function convertQuoteBillingAddress(Quote $quote)
373373
}
374374

375375
$address = $this->convertAddress($quote->getBillingAddress());
376+
// removing GDPR sensitive information
377+
$address->setDateOfBirth('');
378+
$address->setFamilyName('');
379+
$address->setGivenName('');
380+
$address->setStreet('');
376381
$address->setDateOfBirth($this->getDateOfBirth($quote->getCustomerDob(), $quote->getCustomerId()));
377382
$address->setEmailAddress($this->getCustomerEmailAddress($quote->getCustomerEmail(), $quote->getCustomerId()));
378383
$address->setGender($this->getGender($quote->getCustomerGender(), $quote->getCustomerId()));
@@ -393,6 +398,11 @@ private function convertQuoteShippingAddress(Quote $quote)
393398
}
394399

395400
$address = $this->convertAddress($quote->getShippingAddress());
401+
// removing GDPR sensitive information
402+
$address->setDateOfBirth('');
403+
$address->setFamilyName('');
404+
$address->setGivenName('');
405+
$address->setStreet('');
396406
$address->setEmailAddress($this->getCustomerEmailAddress($quote->getCustomerEmail(), $quote->getCustomerId()));
397407
return $address;
398408
}

README.md

+2-2
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.14/docs/en/documentation.html)
15+
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.15/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.14/LICENSE) for more information.
33+
Please see the [license file](https://github.com/pfpayments/magento-2/blob/1.3.15/LICENSE) for more information.

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"type" : "magento2-module",
19-
"version" : "1.3.14",
19+
"version" : "1.3.15",
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

+1-1
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.14/">
25+
<a href="https://github.com/pfpayments/magento-2/releases/tag/1.3.15/">
2626
Source
2727
</a>
2828
</li>

etc/adminhtml/system.xml

+1-1
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.14/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.15/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>

etc/config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<default>
1515
<postfinancecheckout_payment>
1616
<information>
17-
<version>1.3.14</version>
17+
<version>1.3.15</version>
1818
<sdk_version>3.1.2</sdk_version>
1919
</information>
2020
<general>

etc/module.xml

+1-1
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.14">
14+
<module name="PostFinanceCheckout_Payment" setup_version="1.3.15">
1515
<sequence>
1616
<module name="Magento_Sales"/>
1717
<module name="Magento_Payment"/>

i18n/de_DE.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Geschenkverpackung"
5151
"Hold Delivery","Lieferung halten"
5252
"ID required","ID erforderlich"
53-
"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.14/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Falls Sie Hilfe benötigen beim Einrichten der PostFinance Checkout-Erweiterung, sehen Sie sich die <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.14/docs/en/documentation.html"" target=""_blank"">Dokumentation</a> an."
53+
"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.15/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Falls Sie Hilfe benötigen beim Einrichten der PostFinance Checkout-Erweiterung, sehen Sie sich die <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.15/docs/en/documentation.html"" target=""_blank"">Dokumentation</a> an."
5454
"Inactive","Inaktiv"
5555
"Information","Informationen"
5656
"Invoice","Rechnung"

i18n/en_US.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Gift Wrap"
5151
"Hold Delivery","Hold Delivery"
5252
"ID required","ID required"
53-
"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.14/docs/en/documentation.html"" target=""_blank"">documentation</a>.","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.14/docs/en/documentation.html"" target=""_blank"">documentation</a>."
53+
"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.15/docs/en/documentation.html"" target=""_blank"">documentation</a>.","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.15/docs/en/documentation.html"" target=""_blank"">documentation</a>."
5454
"Inactive","Inactive"
5555
"Information","Information"
5656
"Invoice","Invoice"

i18n/fr_CH.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Papier cadeau"
5151
"Hold Delivery","Suspendre la livraison"
5252
"ID required","Pièce d'identité requise"
53-
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.14/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.14/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
53+
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.15/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.15/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
5454
"Inactive","Inactif"
5555
"Information","Information"
5656
"Invoice","Facture"

i18n/fr_FR.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Papier cadeau"
5151
"Hold Delivery","Suspendre la livraison"
5252
"ID required","Pièce d'identité requise"
53-
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.14/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.14/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
53+
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.15/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.15/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
5454
"Inactive","Inactif"
5555
"Information","Information"
5656
"Invoice","Facture"

i18n/it_CH.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Confezione regalo"
5151
"Hold Delivery","Sospendi la consegna"
5252
"ID required","ID richiesto"
53-
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.14/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.14/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
53+
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.15/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.15/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
5454
"Inactive","Inattivo"
5555
"Information","Informazione"
5656
"Invoice","Fattura"

i18n/it_IT.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Confezione regalo"
5151
"Hold Delivery","Sospendi la consegna"
5252
"ID required","ID richiesto"
53-
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.14/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.14/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
53+
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.15/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/1.3.15/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
5454
"Inactive","Inattivo"
5555
"Information","Informazione"
5656
"Invoice","Fattura"

0 commit comments

Comments
 (0)