Skip to content

Commit

Permalink
Release 2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Oct 11, 2023
1 parent feb3503 commit 83a4907
Show file tree
Hide file tree
Showing 96 changed files with 1,145 additions and 1,126 deletions.
2 changes: 1 addition & 1 deletion Api/OrderRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function getOrderByIncrementId($incrementId);
/**
* Get order by Id
*
* @param $id
* @param string $id
* @return OrderInterface|null
*/
public function getOrderById($id);
Expand Down
2 changes: 2 additions & 0 deletions Api/PaymentMethodConfigurationManagementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ interface PaymentMethodConfigurationManagementInterface

/**
* Synchronizes the payment method configurations from wallee.
* @return void
*/
public function synchronize();

/**
* Updates the payment method configuration information.
*
* @param \Wallee\Sdk\Model\PaymentMethodConfiguration $configuration
* @return void
*/
public function update(\Wallee\Sdk\Model\PaymentMethodConfiguration $configuration);
}
9 changes: 6 additions & 3 deletions Api/TokenInfoManagementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
namespace Wallee\Payment\Api;

use Wallee\Payment\Model\TokenInfo;
use Wallee\Payment\Api\Data\TokenInfoInterface;

/**
* Token info management interface.
Expand All @@ -25,6 +25,7 @@ interface TokenInfoManagementInterface
*
* @param int $spaceId
* @param int $tokenVersionId
* @return void
*/
public function updateTokenVersion($spaceId, $tokenVersionId);

Expand All @@ -33,13 +34,15 @@ public function updateTokenVersion($spaceId, $tokenVersionId);
*
* @param int $spaceId
* @param int $tokenId
* @return void
*/
public function updateToken($spaceId, $tokenId);

/**
* Deletes the token on wallee.
*
* @param Data\TokenInfoInterface $token
* @param TokenInfoInterface $token
* @return void
*/
public function deleteToken(TokenInfo $token);
public function deleteToken(TokenInfoInterface $token);
}
12 changes: 1 addition & 11 deletions Block/Adminhtml/Sales/Order/Invoice/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Magento\Backend\Block\Template\Context;
use Magento\Framework\Registry;
use Magento\Sales\Model\Order\Invoice;
use Wallee\Payment\Api\RefundJobRepositoryInterface;

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

/**
*
* @var RefundJobRepositoryInterface
*/
private $refundJobRepository;

/**
*
* @param Context $context
* @param Registry $coreRegistry
* @param RefundJobRepositoryInterface $refundJobRepository
* @param array $data
*/
public function __construct(Context $context, Registry $coreRegistry,
RefundJobRepositoryInterface $refundJobRepository, array $data = [])
public function __construct(Context $context, Registry $coreRegistry, array $data = [])
{
parent::__construct($context, $data);
$this->coreRegistry = $coreRegistry;
$this->refundJobRepository = $refundJobRepository;
}

/**
Expand Down
22 changes: 1 addition & 21 deletions Block/DeviceSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
namespace Wallee\Payment\Block;

use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Stdlib\CookieManagerInterface;
use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory;
use Magento\Framework\View\Element\Template\Context;
use Magento\Store\Model\ScopeInterface;

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

/**
*
* @var CookieManagerInterface
*/
private $cookieManager;

/**
*
* @var CookieMetadataFactory
*/
private $cookieMetadataFactory;

/**
*
* @param Context $context
* @param ScopeConfigInterface $scopeConfig
* @param CookieManagerInterface $cookieManager
* @param CookieMetadataFactory $cookieMetadataFactory
* @param array $data
*/
public function __construct(Context $context, ScopeConfigInterface $scopeConfig,
CookieManagerInterface $cookieManager, CookieMetadataFactory $cookieMetadataFactory,
array $data = [])
public function __construct(Context $context, ScopeConfigInterface $scopeConfig, array $data = [])
{
parent::__construct($context, $data);
$this->scopeConfig = $scopeConfig;
$this->cookieManager = $cookieManager;
$this->cookieMetadataFactory = $cookieMetadataFactory;
}

/**
Expand Down
5 changes: 3 additions & 2 deletions Block/Method/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Magento\Framework\View\Element\Template\Context;
use Magento\Sales\Model\Order\Payment;
use Magento\Backend\Helper\Data as urlBackendHelper;
use Wallee\Payment\Api\Data\TransactionInfoInterface;
use Wallee\Payment\Api\TransactionInfoRepositoryInterface;
use Wallee\Payment\Helper\Data as Helper;
use Wallee\Payment\Helper\Document as DocumentHelper;
Expand Down Expand Up @@ -93,7 +94,7 @@ class Info extends \Magento\Payment\Block\Info

/**
*
* @var \Wallee\Payment\Model\TransactionInfo
* @var TransactionInfoInterface|bool
*/
private $transaction;

Expand Down Expand Up @@ -266,7 +267,7 @@ public function getCustomerUrl()
/**
* Gets the transaction info or false if not available.
*
* @return \Wallee\Payment\Model\TransactionInfo|false
* @return TransactionInfoInterface|bool
*/
#[\ReturnTypeWillChange]
public function getTransaction()
Expand Down
11 changes: 1 addition & 10 deletions Controller/Transaction/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Magento\Framework\App\Action\Context;
use Magento\Sales\Api\OrderRepositoryInterface;
use Magento\Sales\Model\Order;
use Wallee\Payment\Model\Service\Order\TransactionService;
use Wallee\Sdk\Model\TransactionState;

/**
Expand All @@ -36,27 +35,19 @@ class Success extends \Wallee\Payment\Controller\Transaction
*/
private $successValidator;

/**
*
* @var TransactionService
*/
private $transactionService;

/**
*
* @param Context $context
* @param OrderRepositoryInterface $orderRepository
* @param CheckoutSession $checkoutSession
* @param SuccessValidator $successValidator
* @param TransactionService $transactionService
*/
public function __construct(Context $context, OrderRepositoryInterface $orderRepository,
CheckoutSession $checkoutSession, SuccessValidator $successValidator, TransactionService $transactionService)
CheckoutSession $checkoutSession, SuccessValidator $successValidator)
{
parent::__construct($context, $orderRepository);
$this->checkoutSession = $checkoutSession;
$this->successValidator = $successValidator;
$this->transactionService = $transactionService;
}

public function execute()
Expand Down
6 changes: 6 additions & 0 deletions Cron/Refund.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public function __construct(LoggerInterface $logger, RefundJobRepositoryInterfac
$this->apiClient = $apiClient;
}

/**
* @return void
* @throws \Magento\Framework\Exception\InputException
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\StateException
*/
public function execute()
{
$searchCriteria = $this->searchCriteriaBuilder->setPageSize(100)->create();
Expand Down
16 changes: 6 additions & 10 deletions Gateway/Command/InitializeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Magento\Sales\Model\Order;
use Wallee\Payment\Api\TokenInfoRepositoryInterface;
use Wallee\Payment\Helper\Data as Helper;
use Wallee\Payment\Model\Service\Order\TransactionService;
use Wallee\Sdk\Model\Token;

/**
Expand All @@ -45,12 +44,6 @@ class InitializeCommand implements CommandInterface
*/
private $helper;

/**
*
* @var TransactionService
*/
private $transactionService;

/**
*
* @var TokenInfoRepositoryInterface
Expand All @@ -62,16 +55,14 @@ class InitializeCommand implements CommandInterface
* @param CartRepositoryInterface $quoteRepository
* @param Random $random
* @param Helper $helper
* @param TransactionService $transactionService
* @param TokenInfoRepositoryInterface $tokenInfoRepository
*/
public function __construct(CartRepositoryInterface $quoteRepository, Random $random, Helper $helper,
TransactionService $transactionService, TokenInfoRepositoryInterface $tokenInfoRepository)
TokenInfoRepositoryInterface $tokenInfoRepository)
{
$this->quoteRepository = $quoteRepository;
$this->random = $random;
$this->helper = $helper;
$this->transactionService = $transactionService;
$this->tokenInfoRepository = $tokenInfoRepository;
}

Expand Down Expand Up @@ -123,6 +114,11 @@ public function execute(array $commandSubject)
}
}

/**
* @param Quote $quote
* @return void|Token
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
private function getToken(Quote $quote)
{
if ($this->helper->isAdminArea()) {
Expand Down
19 changes: 0 additions & 19 deletions Gateway/Command/RefundCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
use Wallee\Payment\Api\RefundJobRepositoryInterface;
use Wallee\Payment\Helper\Locale as LocaleHelper;
use Wallee\Payment\Model\ApiClient;
use Wallee\Payment\Model\RefundJobFactory;
use Wallee\Payment\Model\Service\LineItemReductionService;
use Wallee\Payment\Model\Service\RefundService;
use Wallee\Sdk\Model\RefundState;
use Wallee\Sdk\Service\RefundService as ApiRefundService;
Expand All @@ -41,18 +39,6 @@ class RefundCommand implements CommandInterface
*/
private $localeHelper;

/**
*
* @var LineItemReductionService
*/
private $lineItemReductionService;

/**
*
* @var RefundJobFactory
*/
private $refundJobFactory;

/**
*
* @var RefundJobRepositoryInterface
Expand All @@ -75,20 +61,15 @@ class RefundCommand implements CommandInterface
*
* @param LoggerInterface $logger
* @param LocaleHelper $localeHelper
* @param LineItemReductionService $lineItemReductionService
* @param RefundJobFactory $refundJobFactory
* @param RefundJobRepositoryInterface $refundJobRepository
* @param RefundService $refundService
* @param ApiClient $apiClient
*/
public function __construct(LoggerInterface $logger, LocaleHelper $localeHelper,
LineItemReductionService $lineItemReductionService, RefundJobFactory $refundJobFactory,
RefundJobRepositoryInterface $refundJobRepository, RefundService $refundService, ApiClient $apiClient)
{
$this->logger = $logger;
$this->localeHelper = $localeHelper;
$this->lineItemReductionService = $lineItemReductionService;
$this->refundJobFactory = $refundJobFactory;
$this->refundJobRepository = $refundJobRepository;
$this->refundService = $refundService;
$this->apiClient = $apiClient;
Expand Down
1 change: 1 addition & 0 deletions Helper/LineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public function correctLineItems(array $items, $expectedAmount, $currencyCode, $
* @param float $expectedAmount
* @param string $currencyCode
* @param array $taxInfo
* @return void
*/
protected function adjustLineItems(array &$items, $expectedAmount, $currencyCode, array $taxInfo)
{
Expand Down
1 change: 1 addition & 0 deletions Helper/LineItemReduction.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function __construct(Context $context, Data $helper)
* @param \Wallee\Sdk\Model\LineItem[] $lineItems
* @param \Wallee\Sdk\Model\LineItemReduction[] $reductions
* @param string $currency
* @return float
*/
public function getReducedAmount(array $lineItems, array $reductions, $currency)
{
Expand Down
4 changes: 3 additions & 1 deletion Model/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ApiClient
/**
* List of shared service instances
*
* @var array
* @var array<mixed>
*/
private $sharedInstances = [];

Expand All @@ -68,6 +68,8 @@ public function __construct(ScopeConfigInterface $scopeConfig, EncryptorInterfac
* Retrieve cached service instance.
*
* @param string $type
* @return mixed
* @throws ApiClientException
*/
public function getService($type)
{
Expand Down
Loading

0 comments on commit 83a4907

Please sign in to comment.