Skip to content

Commit e17578d

Browse files
author
root
committed
Release 2.1.5
1 parent 8d1ddd3 commit e17578d

File tree

96 files changed

+1145
-1126
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1145
-1126
lines changed

Api/OrderRepositoryInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function getOrderByIncrementId($incrementId);
3131
/**
3232
* Get order by Id
3333
*
34-
* @param $id
34+
* @param string $id
3535
* @return OrderInterface|null
3636
*/
3737
public function getOrderById($id);

Api/PaymentMethodConfigurationManagementInterface.php

+2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ interface PaymentMethodConfigurationManagementInterface
2020

2121
/**
2222
* Synchronizes the payment method configurations from PostFinance Checkout.
23+
* @return void
2324
*/
2425
public function synchronize();
2526

2627
/**
2728
* Updates the payment method configuration information.
2829
*
2930
* @param \PostFinanceCheckout\Sdk\Model\PaymentMethodConfiguration $configuration
31+
* @return void
3032
*/
3133
public function update(\PostFinanceCheckout\Sdk\Model\PaymentMethodConfiguration $configuration);
3234
}

Api/TokenInfoManagementInterface.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
namespace PostFinanceCheckout\Payment\Api;
1212

13-
use PostFinanceCheckout\Payment\Model\TokenInfo;
13+
use PostFinanceCheckout\Payment\Api\Data\TokenInfoInterface;
1414

1515
/**
1616
* Token info management interface.
@@ -25,6 +25,7 @@ interface TokenInfoManagementInterface
2525
*
2626
* @param int $spaceId
2727
* @param int $tokenVersionId
28+
* @return void
2829
*/
2930
public function updateTokenVersion($spaceId, $tokenVersionId);
3031

@@ -33,13 +34,15 @@ public function updateTokenVersion($spaceId, $tokenVersionId);
3334
*
3435
* @param int $spaceId
3536
* @param int $tokenId
37+
* @return void
3638
*/
3739
public function updateToken($spaceId, $tokenId);
3840

3941
/**
4042
* Deletes the token on PostFinance Checkout.
4143
*
42-
* @param Data\TokenInfoInterface $token
44+
* @param TokenInfoInterface $token
45+
* @return void
4346
*/
44-
public function deleteToken(TokenInfo $token);
47+
public function deleteToken(TokenInfoInterface $token);
4548
}

Block/Adminhtml/Sales/Order/Invoice/View.php

+1-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Magento\Backend\Block\Template\Context;
1515
use Magento\Framework\Registry;
1616
use Magento\Sales\Model\Order\Invoice;
17-
use PostFinanceCheckout\Payment\Api\RefundJobRepositoryInterface;
1817

1918
/**
2019
* Block to inform about a pending capture on the backend invoice view.
@@ -28,25 +27,16 @@ class View extends Template
2827
*/
2928
private $coreRegistry;
3029

31-
/**
32-
*
33-
* @var RefundJobRepositoryInterface
34-
*/
35-
private $refundJobRepository;
36-
3730
/**
3831
*
3932
* @param Context $context
4033
* @param Registry $coreRegistry
41-
* @param RefundJobRepositoryInterface $refundJobRepository
4234
* @param array $data
4335
*/
44-
public function __construct(Context $context, Registry $coreRegistry,
45-
RefundJobRepositoryInterface $refundJobRepository, array $data = [])
36+
public function __construct(Context $context, Registry $coreRegistry, array $data = [])
4637
{
4738
parent::__construct($context, $data);
4839
$this->coreRegistry = $coreRegistry;
49-
$this->refundJobRepository = $refundJobRepository;
5040
}
5141

5242
/**

Block/DeviceSession.php

+1-21
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
namespace PostFinanceCheckout\Payment\Block;
1212

1313
use Magento\Framework\App\Config\ScopeConfigInterface;
14-
use Magento\Framework\Stdlib\CookieManagerInterface;
15-
use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory;
1614
use Magento\Framework\View\Element\Template\Context;
1715
use Magento\Store\Model\ScopeInterface;
1816

@@ -25,34 +23,16 @@ class DeviceSession extends \Magento\Framework\View\Element\Template
2523
*/
2624
private $scopeConfig;
2725

28-
/**
29-
*
30-
* @var CookieManagerInterface
31-
*/
32-
private $cookieManager;
33-
34-
/**
35-
*
36-
* @var CookieMetadataFactory
37-
*/
38-
private $cookieMetadataFactory;
39-
4026
/**
4127
*
4228
* @param Context $context
4329
* @param ScopeConfigInterface $scopeConfig
44-
* @param CookieManagerInterface $cookieManager
45-
* @param CookieMetadataFactory $cookieMetadataFactory
4630
* @param array $data
4731
*/
48-
public function __construct(Context $context, ScopeConfigInterface $scopeConfig,
49-
CookieManagerInterface $cookieManager, CookieMetadataFactory $cookieMetadataFactory,
50-
array $data = [])
32+
public function __construct(Context $context, ScopeConfigInterface $scopeConfig, array $data = [])
5133
{
5234
parent::__construct($context, $data);
5335
$this->scopeConfig = $scopeConfig;
54-
$this->cookieManager = $cookieManager;
55-
$this->cookieMetadataFactory = $cookieMetadataFactory;
5636
}
5737

5838
/**

Block/Method/Info.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Framework\View\Element\Template\Context;
1717
use Magento\Sales\Model\Order\Payment;
1818
use Magento\Backend\Helper\Data as urlBackendHelper;
19+
use PostFinanceCheckout\Payment\Api\Data\TransactionInfoInterface;
1920
use PostFinanceCheckout\Payment\Api\TransactionInfoRepositoryInterface;
2021
use PostFinanceCheckout\Payment\Helper\Data as Helper;
2122
use PostFinanceCheckout\Payment\Helper\Document as DocumentHelper;
@@ -93,7 +94,7 @@ class Info extends \Magento\Payment\Block\Info
9394

9495
/**
9596
*
96-
* @var \PostFinanceCheckout\Payment\Model\TransactionInfo
97+
* @var TransactionInfoInterface|bool
9798
*/
9899
private $transaction;
99100

@@ -266,7 +267,7 @@ public function getCustomerUrl()
266267
/**
267268
* Gets the transaction info or false if not available.
268269
*
269-
* @return \PostFinanceCheckout\Payment\Model\TransactionInfo|false
270+
* @return TransactionInfoInterface|bool
270271
*/
271272
#[\ReturnTypeWillChange]
272273
public function getTransaction()

Controller/Transaction/Success.php

+1-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Magento\Framework\App\Action\Context;
1717
use Magento\Sales\Api\OrderRepositoryInterface;
1818
use Magento\Sales\Model\Order;
19-
use PostFinanceCheckout\Payment\Model\Service\Order\TransactionService;
2019
use PostFinanceCheckout\Sdk\Model\TransactionState;
2120

2221
/**
@@ -36,27 +35,19 @@ class Success extends \PostFinanceCheckout\Payment\Controller\Transaction
3635
*/
3736
private $successValidator;
3837

39-
/**
40-
*
41-
* @var TransactionService
42-
*/
43-
private $transactionService;
44-
4538
/**
4639
*
4740
* @param Context $context
4841
* @param OrderRepositoryInterface $orderRepository
4942
* @param CheckoutSession $checkoutSession
5043
* @param SuccessValidator $successValidator
51-
* @param TransactionService $transactionService
5244
*/
5345
public function __construct(Context $context, OrderRepositoryInterface $orderRepository,
54-
CheckoutSession $checkoutSession, SuccessValidator $successValidator, TransactionService $transactionService)
46+
CheckoutSession $checkoutSession, SuccessValidator $successValidator)
5547
{
5648
parent::__construct($context, $orderRepository);
5749
$this->checkoutSession = $checkoutSession;
5850
$this->successValidator = $successValidator;
59-
$this->transactionService = $transactionService;
6051
}
6152

6253
public function execute()

Cron/Refund.php

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ public function __construct(LoggerInterface $logger, RefundJobRepositoryInterfac
6262
$this->apiClient = $apiClient;
6363
}
6464

65+
/**
66+
* @return void
67+
* @throws \Magento\Framework\Exception\InputException
68+
* @throws \Magento\Framework\Exception\LocalizedException
69+
* @throws \Magento\Framework\Exception\StateException
70+
*/
6571
public function execute()
6672
{
6773
$searchCriteria = $this->searchCriteriaBuilder->setPageSize(100)->create();

Gateway/Command/InitializeCommand.php

+6-10
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Magento\Sales\Model\Order;
1919
use PostFinanceCheckout\Payment\Api\TokenInfoRepositoryInterface;
2020
use PostFinanceCheckout\Payment\Helper\Data as Helper;
21-
use PostFinanceCheckout\Payment\Model\Service\Order\TransactionService;
2221
use PostFinanceCheckout\Sdk\Model\Token;
2322

2423
/**
@@ -45,12 +44,6 @@ class InitializeCommand implements CommandInterface
4544
*/
4645
private $helper;
4746

48-
/**
49-
*
50-
* @var TransactionService
51-
*/
52-
private $transactionService;
53-
5447
/**
5548
*
5649
* @var TokenInfoRepositoryInterface
@@ -62,16 +55,14 @@ class InitializeCommand implements CommandInterface
6255
* @param CartRepositoryInterface $quoteRepository
6356
* @param Random $random
6457
* @param Helper $helper
65-
* @param TransactionService $transactionService
6658
* @param TokenInfoRepositoryInterface $tokenInfoRepository
6759
*/
6860
public function __construct(CartRepositoryInterface $quoteRepository, Random $random, Helper $helper,
69-
TransactionService $transactionService, TokenInfoRepositoryInterface $tokenInfoRepository)
61+
TokenInfoRepositoryInterface $tokenInfoRepository)
7062
{
7163
$this->quoteRepository = $quoteRepository;
7264
$this->random = $random;
7365
$this->helper = $helper;
74-
$this->transactionService = $transactionService;
7566
$this->tokenInfoRepository = $tokenInfoRepository;
7667
}
7768

@@ -123,6 +114,11 @@ public function execute(array $commandSubject)
123114
}
124115
}
125116

117+
/**
118+
* @param Quote $quote
119+
* @return void|Token
120+
* @throws \Magento\Framework\Exception\NoSuchEntityException
121+
*/
126122
private function getToken(Quote $quote)
127123
{
128124
if ($this->helper->isAdminArea()) {

Gateway/Command/RefundCommand.php

-19
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
use PostFinanceCheckout\Payment\Api\RefundJobRepositoryInterface;
1818
use PostFinanceCheckout\Payment\Helper\Locale as LocaleHelper;
1919
use PostFinanceCheckout\Payment\Model\ApiClient;
20-
use PostFinanceCheckout\Payment\Model\RefundJobFactory;
21-
use PostFinanceCheckout\Payment\Model\Service\LineItemReductionService;
2220
use PostFinanceCheckout\Payment\Model\Service\RefundService;
2321
use PostFinanceCheckout\Sdk\Model\RefundState;
2422
use PostFinanceCheckout\Sdk\Service\RefundService as ApiRefundService;
@@ -41,18 +39,6 @@ class RefundCommand implements CommandInterface
4139
*/
4240
private $localeHelper;
4341

44-
/**
45-
*
46-
* @var LineItemReductionService
47-
*/
48-
private $lineItemReductionService;
49-
50-
/**
51-
*
52-
* @var RefundJobFactory
53-
*/
54-
private $refundJobFactory;
55-
5642
/**
5743
*
5844
* @var RefundJobRepositoryInterface
@@ -75,20 +61,15 @@ class RefundCommand implements CommandInterface
7561
*
7662
* @param LoggerInterface $logger
7763
* @param LocaleHelper $localeHelper
78-
* @param LineItemReductionService $lineItemReductionService
79-
* @param RefundJobFactory $refundJobFactory
8064
* @param RefundJobRepositoryInterface $refundJobRepository
8165
* @param RefundService $refundService
8266
* @param ApiClient $apiClient
8367
*/
8468
public function __construct(LoggerInterface $logger, LocaleHelper $localeHelper,
85-
LineItemReductionService $lineItemReductionService, RefundJobFactory $refundJobFactory,
8669
RefundJobRepositoryInterface $refundJobRepository, RefundService $refundService, ApiClient $apiClient)
8770
{
8871
$this->logger = $logger;
8972
$this->localeHelper = $localeHelper;
90-
$this->lineItemReductionService = $lineItemReductionService;
91-
$this->refundJobFactory = $refundJobFactory;
9273
$this->refundJobRepository = $refundJobRepository;
9374
$this->refundService = $refundService;
9475
$this->apiClient = $apiClient;

Helper/LineItem.php

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public function correctLineItems(array $items, $expectedAmount, $currencyCode, $
114114
* @param float $expectedAmount
115115
* @param string $currencyCode
116116
* @param array $taxInfo
117+
* @return void
117118
*/
118119
protected function adjustLineItems(array &$items, $expectedAmount, $currencyCode, array $taxInfo)
119120
{

Helper/LineItemReduction.php

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function __construct(Context $context, Data $helper)
4343
* @param \PostFinanceCheckout\Sdk\Model\LineItem[] $lineItems
4444
* @param \PostFinanceCheckout\Sdk\Model\LineItemReduction[] $reductions
4545
* @param string $currency
46+
* @return float
4647
*/
4748
public function getReducedAmount(array $lineItems, array $reductions, $currency)
4849
{

Model/ApiClient.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ApiClient
4141
/**
4242
* List of shared service instances
4343
*
44-
* @var array
44+
* @var array<mixed>
4545
*/
4646
private $sharedInstances = [];
4747

@@ -68,6 +68,8 @@ public function __construct(ScopeConfigInterface $scopeConfig, EncryptorInterfac
6868
* Retrieve cached service instance.
6969
*
7070
* @param string $type
71+
* @return mixed
72+
* @throws ApiClientException
7173
*/
7274
public function getService($type)
7375
{

0 commit comments

Comments
 (0)