diff --git a/Controller/Payment/Callback.php b/Controller/Payment/Callback.php
index b38c81e6..03d60372 100755
--- a/Controller/Payment/Callback.php
+++ b/Controller/Payment/Callback.php
@@ -32,7 +32,7 @@
use Vipps\Payment\Gateway\Command\PaymentDetailsProvider;
use Vipps\Payment\Model\Gdpr\Compliance;
use Vipps\Payment\Model\TransactionProcessor;
-use Zend\Http\Response as ZendResponse;
+use Laminas\Http\Response as Response;
/**
* Class Callback
@@ -122,15 +122,15 @@ public function execute()
$this->transactionProcessor->process($this->getVippsQuote($requestData), $transaction);
/** @var Json $result */
- $result->setHttpResponseCode(ZendResponse::STATUS_CODE_200);
- $result->setData(['status' => ZendResponse::STATUS_CODE_200, 'message' => 'success']);
+ $result->setHttpResponseCode(Response::STATUS_CODE_200);
+ $result->setData(['status' => Response::STATUS_CODE_200, 'message' => 'success']);
} catch (\Exception $e) {
$orderId = $requestData['orderId'] ?? 'Missing';
$message = 'OrderID: ' . $orderId . ' . Exception message: ' . $e->getMessage();
$this->logger->critical($message);
- $result->setHttpResponseCode(ZendResponse::STATUS_CODE_500);
+ $result->setHttpResponseCode(Response::STATUS_CODE_500);
$result->setData([
- 'status' => ZendResponse::STATUS_CODE_500,
+ 'status' => Response::STATUS_CODE_500,
'message' => $message
]);
} finally {
diff --git a/Controller/Payment/ConsentRemoval.php b/Controller/Payment/ConsentRemoval.php
index 520f9582..1f931db7 100644
--- a/Controller/Payment/ConsentRemoval.php
+++ b/Controller/Payment/ConsentRemoval.php
@@ -21,7 +21,7 @@
use Magento\Framework\Controller\Result\Json;
use Magento\Framework\Controller\ResultFactory;
use Magento\Framework\Controller\ResultInterface;
-use Zend\Http\Response as ZendResponse;
+use Laminas\Http\Response;
/**
* Class ConsentRemoval
@@ -38,7 +38,7 @@ public function execute()
{
$result = $this->resultFactory->create(ResultFactory::TYPE_JSON);
/** @var Json $result */
- $result->setHttpResponseCode(ZendResponse::STATUS_CODE_200);
+ $result->setHttpResponseCode(Response::STATUS_CODE_200);
return $result;
}
diff --git a/Controller/Payment/ShippingDetails.php b/Controller/Payment/ShippingDetails.php
index 7343306b..6fd7e2c4 100644
--- a/Controller/Payment/ShippingDetails.php
+++ b/Controller/Payment/ShippingDetails.php
@@ -37,7 +37,7 @@
use Vipps\Payment\Model\Quote\AddressUpdater;
use Vipps\Payment\Model\QuoteLocator;
use Vipps\Payment\Model\Quote\ShippingMethodValidator;
-use Zend\Http\Response as ZendResponse;
+use Laminas\Http\Response;
/**
* Class ShippingDetails
@@ -177,20 +177,20 @@ public function execute()
'shippingMethodId' => $methodFullCode,
];
}
- $result->setHttpResponseCode(ZendResponse::STATUS_CODE_200);
+ $result->setHttpResponseCode(Response::STATUS_CODE_200);
$result->setData($responseData);
} catch (LocalizedException $e) {
$this->logger->critical($this->enlargeMessage($e));
- $result->setHttpResponseCode(ZendResponse::STATUS_CODE_500);
+ $result->setHttpResponseCode(Response::STATUS_CODE_500);
$result->setData([
- 'status' => ZendResponse::STATUS_CODE_500,
+ 'status' => Response::STATUS_CODE_500,
'message' => $e->getMessage()
]);
} catch (\Exception $e) {
$this->logger->critical($this->enlargeMessage($e));
- $result->setHttpResponseCode(ZendResponse::STATUS_CODE_500);
+ $result->setHttpResponseCode(Response::STATUS_CODE_500);
$result->setData([
- 'status' => ZendResponse::STATUS_CODE_500,
+ 'status' => Response::STATUS_CODE_500,
'message' => __('An error occurred during Shipping Details processing.')
]);
} finally {
@@ -265,4 +265,4 @@ public function validateForCsrf(RequestInterface $request): ?bool //@codingStand
{
return true;
}
-}
\ No newline at end of file
+}
diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md
index 9a222801..2646865a 100644
--- a/DOCUMENTATION.md
+++ b/DOCUMENTATION.md
@@ -89,7 +89,7 @@ Vipps Payments configuration is divided by sections. It helps to quickly find an
![Screenshot of Vipps Settings](docs/images/vipps_method.png)
-Please ensure you check all configuration settings prior to using Vipps Payment. Pay attention to the Vipps Basic Settings section, namely `Saleunit Serial Number`, `Client ID`, `Client Secret`, `Subscription Key 1`, `Subscription Key 2`.
+Please ensure you check all configuration settings prior to using Vipps Payment. Pay attention to the Vipps Basic Settings section, namely `Saleunit Serial Number`, `Client ID`, `Client Secret`, `Subscription Key`.
For information about how to find the above values, see the [Vipps Developer Portal documentation](https://github.com/vippsas/vipps-developers/blob/master/vipps-developer-portal-getting-started.md).
diff --git a/Gateway/Command/GatewayCommand.php b/Gateway/Command/GatewayCommand.php
index 2e280ee1..a3ead9f5 100755
--- a/Gateway/Command/GatewayCommand.php
+++ b/Gateway/Command/GatewayCommand.php
@@ -32,7 +32,7 @@
use Vipps\Payment\Gateway\Exception\ExceptionFactory;
use Vipps\Payment\Gateway\Exception\VippsException;
use Vipps\Payment\Model\Profiling\ProfilerInterface;
-use Zend\Http\Response as ZendResponse;
+use Laminas\Http\Response;
use Psr\Log\LoggerInterface;
/**
@@ -143,7 +143,7 @@ public function execute(array $commandSubject)
$result = $this->client->placeRequest($transfer);
- /** @var ZendResponse $response */
+ /** @var Response $response */
$response = $result['response'];
$responseBody = $this->jsonDecoder->decode($response->getContent());
diff --git a/Gateway/Config/CanVoidHandler.php b/Gateway/Config/CanVoidHandler.php
deleted file mode 100644
index e69180f3..00000000
--- a/Gateway/Config/CanVoidHandler.php
+++ /dev/null
@@ -1,85 +0,0 @@
-gatewayConfig = $gatewayConfig;
- $this->paymentDetailsProvider = $paymentDetailsProvider;
- $this->transactionBuilder = $transactionBuilder;
- }
-
- /**
- * Disable partial online void
- *
- * @param array $subject
- * @param null $storeId
- *
- * @return bool
- * @throws NoSuchEntityException
- * @throws VippsException
- */
- public function handle(array $subject, $storeId = null): bool
- {
- $response = $this->paymentDetailsProvider->get($subject);
- $transaction = $this->transactionBuilder->setData($response)->build();
- if ($transaction->getTransactionSummary()->getCapturedAmount() > 0) {
- return false;
- }
-
- return (bool)$this->gatewayConfig->getValue(SubjectReader::readField($subject), $storeId);
- }
-}
diff --git a/Gateway/Http/Client/Curl.php b/Gateway/Http/Client/Curl.php
index 81ef61d5..3b09b92a 100644
--- a/Gateway/Http/Client/Curl.php
+++ b/Gateway/Http/Client/Curl.php
@@ -22,8 +22,8 @@
use Magento\Payment\Gateway\Http\TransferInterface;
use Vipps\Payment\Gateway\Exception\AuthenticationException;
use Vipps\Payment\Model\TokenProviderInterface;
-use Zend\Http\Request;
-use Zend\Http\Response as ZendResponse;
+use Laminas\Http\Request;
+use Laminas\Http\Response;
use Psr\Log\LoggerInterface;
use Vipps\Payment\Model\ModuleMetadataInterface;
@@ -101,7 +101,7 @@ public function placeRequest(TransferInterface $transfer)
{
try {
$response = $this->place($transfer);
- if ($response->getStatusCode() == ZendResponse::STATUS_CODE_401) {
+ if ($response->getStatusCode() == Response::STATUS_CODE_401) {
$this->tokenProvider->regenerate();
$response = $this->place($transfer);
}
@@ -116,7 +116,7 @@ public function placeRequest(TransferInterface $transfer)
/**
* @param TransferInterface $transfer
*
- * @return ZendResponse
+ * @return Response
* @throws AuthenticationException
*/
private function place(TransferInterface $transfer)
@@ -146,10 +146,8 @@ private function place(TransferInterface $transfer)
$requestHeaders,
$this->jsonEncoder->encode($transfer->getBody())
);
- $responseSting = $adapter->read();
- $response = ZendResponse::fromString($responseSting);
- return $response;
+ return Response::fromString($adapter->read());
} finally {
$adapter ? $adapter->close() : null;
}
@@ -170,7 +168,7 @@ private function getHeaders($headers)
self::HEADER_PARAM_X_REQUEST_ID => '',
self::HEADER_PARAM_X_SOURCE_ADDRESS => '',
self::HEADER_PARAM_X_TIMESTAMP => '',
- self::HEADER_PARAM_SUBSCRIPTION_KEY => $this->config->getValue('subscription_key2'),
+ self::HEADER_PARAM_SUBSCRIPTION_KEY => $this->config->getValue('subscription_key1'),
],
$headers
);
diff --git a/INSTALL.md b/INSTALL.md
index e5564ce4..ed40d167 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -59,7 +59,7 @@ Vipps Payments configuration is divided by sections. It helps to quickly find an
![Screenshot of Vipps Settings](docs/images/vipps_method.png)
-Please ensure you check all configuration settings prior to using Vipps Payment. Pay attention to the Vipps Basic Settings section, namely `Saleunit Serial Number`, `Client ID`, `Client Secret`, `Subscription Key 1`, `Subscription Key 2`.
+Please ensure you check all configuration settings prior to using Vipps Payment. Pay attention to the Vipps Basic Settings section, namely `Saleunit Serial Number`, `Client ID`, `Client Secret`, `Subscription Key`.
For information about how to find the above values, see the [Vipps Developer Portal documentation](https://github.com/vippsas/vipps-developers/blob/master/vipps-developer-portal-getting-started.md).
diff --git a/Model/Profiling/Profiler.php b/Model/Profiling/Profiler.php
index 549fa3a9..1072d5d5 100644
--- a/Model/Profiling/Profiler.php
+++ b/Model/Profiling/Profiler.php
@@ -22,7 +22,7 @@
use Vipps\Payment\Api\Profiling\Data\ItemInterfaceFactory;
use Vipps\Payment\Api\Profiling\ItemRepositoryInterface;
-use Zend\Http\Response;
+use Laminas\Http\Response;
use Magento\Framework\Json\DecoderInterface;
use Vipps\Payment\Model\Gdpr\Compliance;
diff --git a/Model/Profiling/ProfilerInterface.php b/Model/Profiling/ProfilerInterface.php
index 355c18f0..80a2f38b 100644
--- a/Model/Profiling/ProfilerInterface.php
+++ b/Model/Profiling/ProfilerInterface.php
@@ -17,7 +17,7 @@
use Magento\Payment\Gateway\Http\TransferInterface;
use Vipps\Payment\Api\Profiling\Data\ItemInterface;
-use Zend\Http\Response;
+use Laminas\Http\Response;
interface ProfilerInterface
{
diff --git a/Model/TokenProvider.php b/Model/TokenProvider.php
index b3b27580..edb2fd9e 100644
--- a/Model/TokenProvider.php
+++ b/Model/TokenProvider.php
@@ -194,6 +194,7 @@ private function readJwt()
$this->logger->critical($e->getMessage());
throw new AuthenticationException(__('Can\'t retrieve access token from Vipps.'));
}
+
return $jwt;
}
diff --git a/Observer/AvailabilityByShippingMethod.php b/Observer/AvailabilityByShippingMethod.php
index 218580ef..34814b30 100644
--- a/Observer/AvailabilityByShippingMethod.php
+++ b/Observer/AvailabilityByShippingMethod.php
@@ -1,6 +1,6 @@
assetRepository = $assetRepository;
- }
-
- /**
- * @param Subject $subject
- * @param array $methods
- *
- * @return mixed
- */
- public function afterGetExternalMethods(Subject $subject, $methods)
- {
- if ($methods) {
- foreach ($methods as &$method) {
- if (strtolower($method['name']) == 'vipps') {
- if (isset($method['image_url'])) {
- $method['image_url'] = $this->assetRepository->getUrl($method['image_url']);
- }
- if (isset($method['image_uri'])) {
- $method['image_uri'] = $this->assetRepository->getUrl($method['image_uri']);
- }
- break;
- }
- }
- }
- return $methods;
- }
-}
diff --git a/Plugin/Sales/Model/Order/Payment.php b/Plugin/Sales/Model/Order/Payment.php
deleted file mode 100644
index 5204185e..00000000
--- a/Plugin/Sales/Model/Order/Payment.php
+++ /dev/null
@@ -1,94 +0,0 @@
-dataObjectFactory = $dataObjectFactory;
- $this->paymentDetailsProvider = $paymentDetailsProvider;
- $this->transactionBuilder = $transactionBuilder;
- $this->config = $config;
- }
-
- /**
- * Throw exception if offline partial void disabled
- *
- * @param MagentoPayment $payment
- *
- * @throws LocalizedException
- * @throws VippsException
- */
- public function beforeCancel(MagentoPayment $payment)
- {
- if ($payment->getMethod() === 'vipps') {
- $paymentDataObject = $this->dataObjectFactory->create($payment);
- $response = $this->paymentDetailsProvider->get(['payment' => $paymentDataObject]);
- $transaction = $this->transactionBuilder->setData($response)->build();
- $offlineVoidEnabled = $this->config->isOfflinePartialVoidEnabled();
- if (!$offlineVoidEnabled && $transaction->getTransactionSummary()->getCapturedAmount() > 0) {
- throw new LocalizedException(__('Can\'t cancel captured transaction.'));
- }
- }
- }
-}
diff --git a/Plugin/Sales/OrderManagement/AfterPlaceOrder.php~HEAD b/Plugin/Sales/OrderManagement/AfterPlaceOrder.php
similarity index 100%
rename from Plugin/Sales/OrderManagement/AfterPlaceOrder.php~HEAD
rename to Plugin/Sales/OrderManagement/AfterPlaceOrder.php
diff --git a/Plugin/Sales/OrderManagement/AfterPlaceOrder.php~origin_master b/Plugin/Sales/OrderManagement/AfterPlaceOrder.php~origin_master
deleted file mode 100644
index 3a496584..00000000
--- a/Plugin/Sales/OrderManagement/AfterPlaceOrder.php~origin_master
+++ /dev/null
@@ -1,43 +0,0 @@
-getPayment()->getMethod()) {
- $order->setCanSendNewEmailFlag(false);
- }
-
- return $order;
- }
-}
diff --git a/README.md b/README.md
index 71b46a83..f9378a00 100644
--- a/README.md
+++ b/README.md
@@ -76,4 +76,4 @@ Please see our [Documentation](DOCUMENTATION.md)
# FAQ
-Please see our [FAQ section](FAQ.md)
\ No newline at end of file
+Please see our [FAQ section](FAQ.md)
diff --git a/Test/Unit/Controller/Payment/ShippingDetailsTest.php b/Test/Unit/Controller/Payment/ShippingDetailsTest.php
index c9d5f325..daa59ba2 100644
--- a/Test/Unit/Controller/Payment/ShippingDetailsTest.php
+++ b/Test/Unit/Controller/Payment/ShippingDetailsTest.php
@@ -39,7 +39,7 @@
use Vipps\Payment\Model\Quote\ShippingMethodValidator;
use Vipps\Payment\Model\QuoteLocator;
use Vipps\Payment\Model\TransactionProcessor;
-use Zend\Http\Response as ZendResponse;
+use Laminas\Http\Response;
/**
* Class ShippingDetailsTest
@@ -266,7 +266,7 @@ public function testExecuteException()
->with('Reserved Order id: ' . $reservedOrderId . ' . Exception message: ' . $errorMessage1)
->willReturnSelf();
- $errorStatus = ZendResponse::STATUS_CODE_500;
+ $errorStatus = Response::STATUS_CODE_500;
$errorMessage2 = __('An error occurred during Shipping Details processing.');
$responseData = [
'status' => $errorStatus,
@@ -318,7 +318,7 @@ public function testExecuteLocalizedException()
->with('Reserved Order id: ' . $reservedOrderId . ' . Exception message: ' . $errorMessage1)
->willReturnSelf();
- $errorStatus = ZendResponse::STATUS_CODE_500;
+ $errorStatus = Response::STATUS_CODE_500;
$responseData = [
'status' => $errorStatus,
'message' => $errorMessage1
@@ -458,7 +458,7 @@ public function testExecute()
];
$this->response->expects(self::once())
->method('setHttpResponseCode')
- ->with(ZendResponse::STATUS_CODE_200)
+ ->with(Response::STATUS_CODE_200)
->willReturnSelf();
$this->response->expects(self::once())
diff --git a/Test/Unit/Gateway/Command/GatewayCommandTest.php b/Test/Unit/Gateway/Command/GatewayCommandTest.php
index 70dbc39e..4434d218 100755
--- a/Test/Unit/Gateway/Command/GatewayCommandTest.php
+++ b/Test/Unit/Gateway/Command/GatewayCommandTest.php
@@ -37,7 +37,7 @@
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit_Framework_MockObject_MockObject as MockObject;
use Psr\Log\LoggerInterface;
-use Zend\Http\Response as ZendResponse;
+use Laminas\Http\Response;
use PHPUnit\Framework\TestCase;
/**
@@ -223,10 +223,10 @@ public function dataProvider()
'failsDescription' => ['error1', 'error2']
]);
$resultFailed = [
- 'response' => ZendResponse::fromString($responseStrFail)
+ 'response' => Response::fromString($responseStrFail)
];
$resultSuccess = [
- 'response' => ZendResponse::fromString($responseStrOk)
+ 'response' => Response::fromString($responseStrOk)
];
$validationResultOk = $this->objectManagerHelper->getObject(
Result::class,
diff --git a/composer.json b/composer.json
index 4e7d23ce..6b5efbbd 100644
--- a/composer.json
+++ b/composer.json
@@ -3,7 +3,7 @@
"type": "magento2-module",
"description": "Vipps Payment Method",
"license": "proprietary",
- "version": "2.4.1",
+ "version": "2.4.2",
"require": {
"magento/framework": "103.0.*",
"magento/module-sales": "103.0.*",
diff --git a/docs/images/vipps_basic.png b/docs/images/vipps_basic.png
index 2324cb16..6e488710 100644
Binary files a/docs/images/vipps_basic.png and b/docs/images/vipps_basic.png differ
diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml
index c0e2e88c..5d2b9d69 100644
--- a/etc/adminhtml/system.xml
+++ b/etc/adminhtml/system.xml
@@ -68,7 +68,7 @@
1
-
+
payment/vipps/merchant_serial_number
Magento\Config\Model\Config\Backend\Encrypted
@@ -83,23 +83,14 @@
Magento\Config\Model\Config\Backend\Encrypted
-
+
-
+
This can be found in User Profile page on Merchant developer portal after merchant account is created.
payment/vipps/subscription_key1
Magento\Config\Model\Config\Backend\Encrypted
-
-
-
-
-
- This can be found in User Profile page on Merchant developer portal after merchant account is created.
- payment/vipps/subscription_key2
- Magento\Config\Model\Config\Backend\Encrypted
-
diff --git a/etc/config.xml b/etc/config.xml
index 7c679cfd..b430605a 100644
--- a/etc/config.xml
+++ b/etc/config.xml
@@ -37,7 +37,6 @@
develop
-
auto
diff --git a/etc/di.xml b/etc/di.xml
index 2ecd3046..e381276b 100644
--- a/etc/di.xml
+++ b/etc/di.xml
@@ -101,7 +101,6 @@
- VippsConfigValueHandler
- - Vipps\Payment\Gateway\Config\CanVoidHandler
diff --git a/i18n/nb_NO.csv b/i18n/nb_NO.csv
index 413133ee..6673015e 100644
--- a/i18n/nb_NO.csv
+++ b/i18n/nb_NO.csv
@@ -105,7 +105,6 @@ Debug,Debug
"Client ID","Client ID"
"Client Secret","Client Secret"
"Subscription Key 1","Subscription Key 1"
-"Subscription Key 2","Subscription Key 2"
"Order Cancellation","Order Cancellation"
"Number of Attempts","Number of Attempts"
"Processing Type","Processing Type"