Skip to content

Commit 1f192e6

Browse files
author
Simon Schurter
committed
Release 1.0.22
1 parent 70a542a commit 1f192e6

12 files changed

+40
-21
lines changed

Model/Service/AbstractTransactionService.php

+17-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
namespace PostFinanceCheckout\Payment\Model\Service;
1212

1313
use Magento\Customer\Model\CustomerRegistry;
14+
use Magento\Framework\App\ResourceConnection;
1415
use Magento\Framework\App\Config\ScopeConfigInterface;
1516
use Magento\Quote\Api\CartRepositoryInterface;
1617
use Magento\Quote\Model\Quote;
@@ -27,6 +28,12 @@
2728
abstract class AbstractTransactionService
2829
{
2930

31+
/**
32+
*
33+
* @var ResourceConnection
34+
*/
35+
protected $_resource;
36+
3037
/**
3138
*
3239
* @var Helper
@@ -65,17 +72,19 @@ abstract class AbstractTransactionService
6572

6673
/**
6774
*
75+
* @param ResourceConnection $resource
6876
* @param Helper $helper
6977
* @param ScopeConfigInterface $scopeConfig
7078
* @param CustomerRegistry $customerRegistry
7179
* @param CartRepositoryInterface $quoteRepository
7280
* @param PaymentMethodConfigurationManagementInterface $paymentMethodConfigurationManagement
7381
* @param ApiClient $apiClient
7482
*/
75-
public function __construct(Helper $helper, ScopeConfigInterface $scopeConfig, CustomerRegistry $customerRegistry,
83+
public function __construct(ResourceConnection $resource, Helper $helper, ScopeConfigInterface $scopeConfig, CustomerRegistry $customerRegistry,
7684
CartRepositoryInterface $quoteRepository,
7785
PaymentMethodConfigurationManagementInterface $paymentMethodConfigurationManagement, ApiClient $apiClient)
7886
{
87+
$this->_resource = $resource;
7988
$this->_helper = $helper;
8089
$this->_scopeConfig = $scopeConfig;
8190
$this->_customerRegistry = $customerRegistry;
@@ -116,9 +125,13 @@ public function getTransaction($spaceId, $transactionId)
116125
*/
117126
protected function updateQuote(Quote $quote, Transaction $transaction)
118127
{
119-
$quote->setPostfinancecheckoutSpaceId($transaction->getLinkedSpaceId());
120-
$quote->setPostfinancecheckoutTransactionId($transaction->getId());
121-
$this->_quoteRepository->save($quote);
128+
$this->_resource->getConnection()->update($this->_resource->getTableName('quote'),
129+
[
130+
'postfinancecheckout_space_id' => $transaction->getLinkedSpaceId(),
131+
'postfinancecheckout_transaction_id' => $transaction->getId(),
132+
], [
133+
'entity_id = ?' => $quote->getId()
134+
]);
122135
}
123136

124137
/**

Model/Service/Invoice/TransactionService.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
namespace PostFinanceCheckout\Payment\Model\Service\Invoice;
1212

1313
use Magento\Customer\Model\CustomerRegistry;
14+
use Magento\Framework\App\ResourceConnection;
1415
use Magento\Framework\App\Config\ScopeConfigInterface;
1516
use Magento\Framework\Exception\NoSuchEntityException;
1617
use Magento\Quote\Api\CartRepositoryInterface;
@@ -63,6 +64,7 @@ class TransactionService extends AbstractTransactionService
6364

6465
/**
6566
*
67+
* @param ResourceConnection $resource
6668
* @param Helper $helper
6769
* @param ScopeConfigInterface $scopeConfig
6870
* @param CustomerRegistry $customerRegistry
@@ -74,13 +76,13 @@ class TransactionService extends AbstractTransactionService
7476
* @param TransactionInfoRepositoryInterface $transactionInfoRepository
7577
* @param OrderTransactionService $orderTransactionService
7678
*/
77-
public function __construct(Helper $helper, ScopeConfigInterface $scopeConfig, CustomerRegistry $customerRegistry,
79+
public function __construct(ResourceConnection $resource, Helper $helper, ScopeConfigInterface $scopeConfig, CustomerRegistry $customerRegistry,
7880
CartRepositoryInterface $quoteRepository,
7981
PaymentMethodConfigurationManagementInterface $paymentMethodConfigurationManagement, ApiClient $apiClient,
8082
LocaleHelper $localeHelper, LineItemService $lineItemService,
8183
TransactionInfoRepositoryInterface $transactionInfoRepository, OrderTransactionService $orderTransactionService)
8284
{
83-
parent::__construct($helper, $scopeConfig, $customerRegistry, $quoteRepository,
85+
parent::__construct($resource, $helper, $scopeConfig, $customerRegistry, $quoteRepository,
8486
$paymentMethodConfigurationManagement, $apiClient);
8587
$this->_localeHelper = $localeHelper;
8688
$this->_lineItemService = $lineItemService;

Model/Service/Order/TransactionService.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
namespace PostFinanceCheckout\Payment\Model\Service\Order;
1212

1313
use Magento\Customer\Model\CustomerRegistry;
14+
use Magento\Framework\App\ResourceConnection;
1415
use Magento\Framework\App\Config\ScopeConfigInterface;
1516
use Magento\Framework\Exception\NoSuchEntityException;
1617
use Magento\Quote\Api\CartRepositoryInterface;
@@ -65,6 +66,7 @@ class TransactionService extends AbstractTransactionService
6566

6667
/**
6768
*
69+
* @param ResourceConnection $resource
6870
* @param Helper $helper
6971
* @param ScopeConfigInterface $scopeConfig
7072
* @param CustomerRegistry $customerRegistry
@@ -74,12 +76,12 @@ class TransactionService extends AbstractTransactionService
7476
* @param LineItemService $lineItemService
7577
* @param TransactionInfoRepositoryInterface $transactionInfoRepository
7678
*/
77-
public function __construct(Helper $helper, ScopeConfigInterface $scopeConfig, CustomerRegistry $customerRegistry,
79+
public function __construct(ResourceConnection $resource, Helper $helper, ScopeConfigInterface $scopeConfig, CustomerRegistry $customerRegistry,
7880
CartRepositoryInterface $quoteRepository,
7981
PaymentMethodConfigurationManagementInterface $paymentMethodConfigurationManagement, ApiClient $apiClient,
8082
LineItemService $lineItemService, TransactionInfoRepositoryInterface $transactionInfoRepository)
8183
{
82-
parent::__construct($helper, $scopeConfig, $customerRegistry, $quoteRepository,
84+
parent::__construct($resource, $helper, $scopeConfig, $customerRegistry, $quoteRepository,
8385
$paymentMethodConfigurationManagement, $apiClient);
8486
$this->_lineItemService = $lineItemService;
8587
$this->_transactionInfoRepository = $transactionInfoRepository;

Model/Service/Quote/TransactionService.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
namespace PostFinanceCheckout\Payment\Model\Service\Quote;
1212

1313
use Magento\Customer\Model\CustomerRegistry;
14+
use Magento\Framework\App\ResourceConnection;
1415
use Magento\Framework\App\Config\ScopeConfigInterface;
1516
use Magento\Quote\Api\CartRepositoryInterface;
1617
use Magento\Quote\Model\Quote;
@@ -57,6 +58,7 @@ class TransactionService extends AbstractTransactionService
5758

5859
/**
5960
*
61+
* @param ResourceConnection $resource
6062
* @param Helper $helper
6163
* @param ScopeConfigInterface $scopeConfig
6264
* @param CustomerRegistry $customerRegistry
@@ -65,12 +67,12 @@ class TransactionService extends AbstractTransactionService
6567
* @param ApiClient $apiClient
6668
* @param LineItemService $lineItemService
6769
*/
68-
public function __construct(Helper $helper, ScopeConfigInterface $scopeConfig, CustomerRegistry $customerRegistry,
70+
public function __construct(ResourceConnection $resource, Helper $helper, ScopeConfigInterface $scopeConfig, CustomerRegistry $customerRegistry,
6971
CartRepositoryInterface $quoteRepository,
7072
PaymentMethodConfigurationManagementInterface $paymentMethodConfigurationManagement, ApiClient $apiClient,
7173
LineItemService $lineItemService)
7274
{
73-
parent::__construct($helper, $scopeConfig, $customerRegistry, $quoteRepository,
75+
parent::__construct($resource, $helper, $scopeConfig, $customerRegistry, $quoteRepository,
7476
$paymentMethodConfigurationManagement, $apiClient);
7577
$this->_lineItemService = $lineItemService;
7678
}
@@ -109,7 +111,7 @@ public function getPaymentPageUrl(Quote $quote)
109111
*/
110112
public function getPossiblePaymentMethods(Quote $quote)
111113
{
112-
if (! array_key_exists($quote->getId(), $this->possiblePaymentMethodCache) ||
114+
if (! \array_key_exists($quote->getId(), $this->possiblePaymentMethodCache) ||
113115
$this->possiblePaymentMethodCache[$quote->getId()] == null) {
114116
$transaction = $this->getTransactionByQuote($quote);
115117
try {
@@ -135,7 +137,7 @@ public function getPossiblePaymentMethods(Quote $quote)
135137
*/
136138
public function getTransactionByQuote(Quote $quote)
137139
{
138-
if (! array_key_exists($quote->getId(), $this->transactionCache) ||
140+
if (! \array_key_exists($quote->getId(), $this->transactionCache) ||
139141
$this->transactionCache[$quote->getId()] == null) {
140142
$transactionId = $quote->getPostfinancecheckoutTransactionId();
141143
if (empty($transactionId)) {

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ This repository contains the Magento 2.3 extension that enables to process payme
1010

1111
## Documentation
1212

13-
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.3/1.0.21/docs/en/documentation.html)
13+
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.3/1.0.22/docs/en/documentation.html)
1414

1515
## License
1616

17-
Please see the [license file](https://github.com/pfpayments/magento-2.3/blob/1.0.21/LICENSE) for more information.
17+
Please see the [license file](https://github.com/pfpayments/magento-2.3/blob/1.0.22/LICENSE) for more information.

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919
],
2020
"type" : "magento2-module",
21-
"version" : "1.0.21",
21+
"version" : "1.0.22",
2222
"require" : {
2323
"php": "~7.1.3||~7.2.0",
2424
"magento/framework" : "^102.0.0",

docs/en/documentation.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h2>Documentation</h2> </div>
2121
</a>
2222
</li>
2323
<li>
24-
<a href="https://github.com/pfpayments/magento-2.3/releases/tag/1.0.21/">
24+
<a href="https://github.com/pfpayments/magento-2.3/releases/tag/1.0.22/">
2525
Source
2626
</a>
2727
</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.3/1.0.21/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.3/1.0.22/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.0.21</version>
17+
<version>1.0.22</version>
1818
<sdk_version>1.1.9</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.0.21">
14+
<module name="PostFinanceCheckout_Payment" setup_version="1.0.22">
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
@@ -42,7 +42,7 @@
4242
"General","Allgemein"
4343
"Hold Delivery","Lieferung halten"
4444
"ID required","ID erforderlich"
45-
"If you need help setting up the PostFinance Checkout extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.3/1.0.21/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.3/1.0.21/docs/en/documentation.html"" target=""_blank"">Dokumentation</a> an."
45+
"If you need help setting up the PostFinance Checkout extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.3/1.0.22/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.3/1.0.22/docs/en/documentation.html"" target=""_blank"">Dokumentation</a> an."
4646
"Inactive","Inaktiv"
4747
"Information","Informationen"
4848
"Invoice","Rechnung"

i18n/en_US.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"General","General"
4343
"Hold Delivery","Hold Delivery"
4444
"ID required","ID required"
45-
"If you need help setting up the PostFinance Checkout extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.3/1.0.21/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.3/1.0.21/docs/en/documentation.html"" target=""_blank"">documentation</a>."
45+
"If you need help setting up the PostFinance Checkout extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.3/1.0.22/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.3/1.0.22/docs/en/documentation.html"" target=""_blank"">documentation</a>."
4646
"Inactive","Inactive"
4747
"Information","Information"
4848
"Invoice","Invoice"

0 commit comments

Comments
 (0)