Commit d01ee55a authored by Daniel Kazior's avatar Daniel Kazior
Browse files

Merge branch 'magento_2_4_support' into 'develop'

Magento 2 4 support

See merge request !20
parents f98da83e b35731bc
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Api;
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Exception\StateException;
use Trilix\CrefoPay\Api\Data\CrefoPayMnsInterface;
use Trilix\CrefoPay\Api\Data\CrefoPayMnsSearchResultInterface;
......@@ -9,45 +15,45 @@ interface CrefoPayMnsRepositoryInterface
/**
* Retrieve all MNS events for search criteria
*
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
* @param SearchCriteriaInterface $searchCriteria
* @return CrefoPayMnsSearchResultInterface
*/
public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
public function getList(SearchCriteriaInterface $searchCriteria): CrefoPayMnsSearchResultInterface;
/**
* Retrieve specific MNS event
*
* @param int $id
* @return CrefoPayMnsInterface
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @throws NoSuchEntityException
*/
public function get($id);
public function get($id): CrefoPayMnsInterface;
/**
* Create MNS event
*
* @param CrefoPayMnsInterface $mnsEvent
* @return CrefoPayMnsInterface
* @throws \Magento\Framework\Exception\StateException
* @throws StateException
*/
public function save(CrefoPayMnsInterface $mnsEvent);
public function save(CrefoPayMnsInterface $mnsEvent): CrefoPayMnsInterface;
/**
* Delete MNS event
*
* @param CrefoPayMnsInterface $mnsEvent
* @return void
* @throws \Magento\Framework\Exception\StateException
* @throws StateException
*/
public function delete(CrefoPayMnsInterface $mnsEvent);
public function delete(CrefoPayMnsInterface $mnsEvent): void;
/**
* Delete MNS event by ID
*
* @param int $id
* @return void
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @throws \Magento\Framework\Exception\StateException
* @throws NoSuchEntityException
* @throws StateException
*/
public function deleteById($id);
}
\ No newline at end of file
public function deleteById($id): void;
}
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Api;
use Trilix\CrefoPay\Api\Data\CrefoPayTransactionInterface;
......@@ -16,5 +18,5 @@ interface CrefoPayTransactionRepositoryInterface
* @param $quoteId
* @return CrefoPayTransactionInterface
*/
public function getByQuoteId($quoteId): CrefoPayTransactionInterface ;
public function getByQuoteId($quoteId): CrefoPayTransactionInterface;
}
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Api\Data;
interface CrefoPayMnsInterface
{
const MERCHANT_ID = 'merchant_id';
const STORE_ID = 'store_id';
const ORDER_INCREMENT_ID = 'order_increment_id';
const CAPTURE_ID = 'capture_id';
const MERCHANT_REFERENCE = 'merchant_reference';
const PAYMENT_REFERENCE = 'payment_reference';
const USER_ID = 'user_id';
const AMOUNT = 'amount';
const CURRENCY = 'currency';
const TRANSACTION_STATUS = 'transaction_status';
const CAPTURE_STATUS = 'capture_status';
const CREATED_AT = 'created_at';
const MNS_STATUS = 'mns_status'; // See STATUS_* constants
const PROCESSED_AT = 'processed_at';
const ERROR_DETAILS = 'error_details'; // If mns_status is 'failed'
public const MERCHANT_ID = 'merchant_id';
public const STORE_ID = 'store_id';
public const ORDER_INCREMENT_ID = 'order_increment_id';
public const CAPTURE_ID = 'capture_id';
public const MERCHANT_REFERENCE = 'merchant_reference';
public const PAYMENT_REFERENCE = 'payment_reference';
public const USER_ID = 'user_id';
public const AMOUNT = 'amount';
public const CURRENCY = 'currency';
public const TRANSACTION_STATUS = 'transaction_status';
public const CAPTURE_STATUS = 'capture_status';
public const CREATED_AT = 'created_at';
public const MNS_STATUS = 'mns_status'; // See STATUS_* constants
public const PROCESSED_AT = 'processed_at';
public const ERROR_DETAILS = 'error_details'; // If mns_status is 'failed'
/**
* MNS statuses
*/
const STATUS_ACK = 'ack'; // Notification has been received and recorded for future processing
const STATUS_CONSUMED = 'consumed'; // Notification has been successfully processed
const STATUS_FAILED = 'failed'; // There was an error processing the notification
public const STATUS_ACK = 'ack'; // Notification has been received and recorded for future processing
public const STATUS_CONSUMED = 'consumed'; // Notification has been successfully processed
public const STATUS_FAILED = 'failed'; // There was an error processing the notification
/**
* Set CrefoPay Merchant ID
......@@ -265,4 +268,4 @@ interface CrefoPayMnsInterface
* @return string|null
*/
public function getErrorDetails();
}
\ No newline at end of file
}
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Api\Data;
use Magento\Framework\Api\SearchResultsInterface;
......@@ -6,14 +9,14 @@ use Magento\Framework\Api\SearchResultsInterface;
interface CrefoPayMnsSearchResultInterface extends SearchResultsInterface
{
/**
* @return \Trilix\CrefoPay\Api\Data\CrefoPayMnsInterface[]
* @return CrefoPayMnsInterface[]
*/
public function getItems();
/**
* @param \Trilix\CrefoPay\Api\Data\CrefoPayMnsInterface[] $items
* @param CrefoPayMnsInterface[] $items
*
* @return void
*/
public function setItems(array $items);
}
\ No newline at end of file
}
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Api\Data;
interface CrefoPayTransactionInterface
......@@ -28,7 +30,7 @@ interface CrefoPayTransactionInterface
* @param $quoteId
* @return void
*/
public function setQuoteId($quoteId);
public function setQuoteId($quoteId): void;
/**
* @param string $paymentMethods
......
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Block\Adminhtml\System\Config\Form\Field;
use Magento\Backend\Block\Template;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Data\Form\Element\Renderer\RendererInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Ui\Model\UiComponentGenerator;
use Magento\Backend\Block\Template\Context;
class Categories extends \Magento\Backend\Block\Template
implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface
class Categories extends Template
implements RendererInterface
{
private $context;
/** @var UiComponentGenerator */
private $uiComponentGenerator;
......@@ -19,21 +24,19 @@ class Categories extends \Magento\Backend\Block\Template
{
parent::__construct($context, $data);
$this->uiComponentGenerator = $uiComponentGenerator;
$this->context = $context;
}
/**
* Get the UI component HTML as a form field.
*
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
* @param AbstractElement $element
*
* @return string
* @throws LocalizedException
*/
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
public function render(AbstractElement $element)
{
$uiComponent = $this->uiComponentGenerator->generateUiComponent('category_multiselect', $this->_layout);
$html = $uiComponent->render();
return $html;
return $uiComponent->render();
}
}
\ No newline at end of file
}
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Block\Callback;
class Failure extends \Magento\Checkout\Block\Onepage\Failure
......
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Block\Customer;
use Magento\Vault\Api\Data\PaymentTokenInterface;
......
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Block\Customer;
use Magento\Vault\Block\AbstractTokenRenderer;
......
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Block\Customer;
use Magento\Vault\Block\Customer\PaymentTokens;
......
......@@ -10,9 +10,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Auto-Fill function from some browser put salutation data into company name
- Checkout button will not be disabled while redirect is loading
## [Unreleased]
## [1.1.3] - 2020-09-04
-
### Fixed in [1.1.3]
- Error during order placement when module is disabled
## [1.1.2] - 2020-07-08
### Added in [1.1.2]
- Support for CrefoPay config for multiple Websites in Magento admin
## [1.1.1] - 2020-06-18
### Added in [1.1.1]
- Possibility to install module via composer
## [1.1.0] - 2020-05-15
......
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Client;
use Upg\Library\Config as CrefoPayConfig;
use Magento\Framework\App\Filesystem\DirectoryList;
use Trilix\CrefoPay\Gateway\Config\Config as GatewayConfig;
class ConfigFactory
......@@ -12,13 +15,20 @@ class ConfigFactory
*/
private $gatewayConfig;
/**
* @var GatewayConfig
*/
private $directoryList;
/**
* ConfigFactory constructor.
* @param GatewayConfig $gatewayConfig
* @param DirectoryList $directoryList
*/
public function __construct(GatewayConfig $gatewayConfig)
public function __construct(GatewayConfig $gatewayConfig, DirectoryList $directoryList)
{
$this->gatewayConfig = $gatewayConfig;
$this->directoryList = $directoryList;
}
/**
......@@ -32,7 +42,8 @@ class ConfigFactory
'storeID' => $this->gatewayConfig->getStoreId(),
'baseUrl' => $this->gatewayConfig->getBaseUrl(),
'logEnabled' => true,
'logLocationRequest' => 'var/log/crefopay.log',
'logLocationRequest' => $this->directoryList->getPath('var') .
DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR . 'crefopay.log',
'logLevel' => 100,
]);
}
......
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Client;
class Constants
......@@ -6,27 +9,27 @@ class Constants
/**
* Transaction statuses
*/
const TX_NEW = 'NEW';
const TX_ACK = 'ACKNOWLEDGEPENDING';
const TX_FRAUD = 'FRAUDPENDING';
const TX_FRAUD_CANCEL = 'FRAUDCANCELLED';
const TX_CIA = 'CIAPENDING';
const TX_MERCHANT = 'MERCHANTPENDING';
const TX_CANCELLED = 'CANCELLED';
const TX_EXPIRED = 'EXPIRED';
const TX_IN_PROGRESS = 'INPROGRESS';
const TX_DONE = 'DONE';
public const TX_NEW = 'NEW';
public const TX_ACK = 'ACKNOWLEDGEPENDING';
public const TX_FRAUD = 'FRAUDPENDING';
public const TX_FRAUD_CANCEL = 'FRAUDCANCELLED';
public const TX_CIA = 'CIAPENDING';
public const TX_MERCHANT = 'MERCHANTPENDING';
public const TX_CANCELLED = 'CANCELLED';
public const TX_EXPIRED = 'EXPIRED';
public const TX_IN_PROGRESS = 'INPROGRESS';
public const TX_DONE = 'DONE';
/**
* Order statuses
*/
const O_PENDING = 'PAYPENDING';
const O_PAID = 'PAID';
const O_CLEARED = 'CLEARED';
const O_FAILED = 'PAYMENTFAILED';
const O_CHARGEBACK = 'CHARGEBACK';
const O_INDUNNING = 'INDUNNING';
const O_COLLECTION = 'IN_COLLECTION';
public const O_PENDING = 'PAYPENDING';
public const O_PAID = 'PAID';
public const O_CLEARED = 'CLEARED';
public const O_FAILED = 'PAYMENTFAILED';
public const O_CHARGEBACK = 'CHARGEBACK';
public const O_INDUNNING = 'INDUNNING';
public const O_COLLECTION = 'IN_COLLECTION';
/**
* @return array
......@@ -93,4 +96,4 @@ class Constants
{
return in_array($orderStatus, self::getAllOrderStatuses());
}
}
\ No newline at end of file
}
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Client\Request;
use Trilix\CrefoPay\Client\ConfigFactory;
......
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Client\Request;
use Upg\Library\Request\Cancel;
......@@ -17,4 +20,4 @@ class CancelRequestFactory extends AbstractRequestFactory
return $cancelRequest;
}
}
\ No newline at end of file
}
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Client\Request;
use Magento\Framework\Exception\LocalizedException;
......@@ -58,4 +61,4 @@ class CaptureRequestFactory extends AbstractRequestFactory
return sprintf('%s:%s', $orderId, $captureIdx);
}
}
\ No newline at end of file
}
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Client\Request;
use Upg\Library\Request\DeleteUserPaymentInstrument as CrefoPayDeleteUserPaymentInstrument;
......
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Client\Request;
use Upg\Library\Request\Finish;
......@@ -18,4 +21,4 @@ class FinishRequestFactory extends AbstractRequestFactory
return $refundRequest;
}
}
\ No newline at end of file
}
<?php
declare(strict_types=1);
namespace Trilix\CrefoPay\Client\Request;
use Upg\Library\Request\GetUserPaymentInstrument;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment