Skip to content

Commit

Permalink
Merge pull request #195 from OXID-eSales/PSAPC-273_CorrectReturnTypes
Browse files Browse the repository at this point in the history
returntypes must be compatible with CORE
  • Loading branch information
mariolorenz authored Nov 22, 2024
2 parents 8b4c2d2 + ab238b2 commit 7c44355
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 21 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [2.1.7] - 2024-??-??

- [0007715](https://bugs.oxid-esales.com/view.php?id=7715): Fix wrong HTML-Code-Output
- [0007718](https://bugs.oxid-esales.com/view.php?id=7718): Fix compatibility-Issue with Core (Method-Return-Values must be compatible with CORE)

## [2.1.6] - 2024-08-15

- [0007654](https://bugs.oxid-esales.com/view.php?id=7654): Fix Capture type is incorrectly evaluated
Expand Down
2 changes: 1 addition & 1 deletion metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
'en' => 'Use of the online payment service from amazon.com'
],
'thumbnail' => 'out/img/amazon-pay-logo.png',
'version' => '2.1.6',
'version' => '2.1.7-rc.1',
'author' => 'OXID eSales AG',
'url' => 'https://www.oxid-esales.com',
'email' => '[email protected]',
Expand Down
13 changes: 5 additions & 8 deletions src/Controller/Admin/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@
*/
class ConfigController extends AdminController
{
public function __construct()
{
parent::__construct();

$this->_sThisTemplate = 'amazonpay/amazonconfig.tpl';
}
protected $_sThisTemplate = 'amazonpay/amazonconfig.tpl';

/**
* @inheritDoc
*
* @return string
*
*/
public function render()
{
Expand Down Expand Up @@ -134,13 +132,12 @@ protected function saveConfig(array $conf, int $shopId)
* Handles checkboxes/dropdowns
*
* @param array $conf
*
* @return array
*/
protected function handleSpecialFields(array $conf): array
{
$config = new Config();
$conf['blAmazonPaySandboxMode'] = $conf['blAmazonPaySandboxMode'] === 'sandbox' ? true : false;
$conf['blAmazonPaySandboxMode'] = $conf['blAmazonPaySandboxMode'] === 'sandbox';

// remove FakePrivateKeys before save
if ($conf['sAmazonPayPrivKey'] === '' || $conf['sAmazonPayPrivKey'] === $config->getFakePrivateKey()) {
Expand Down
7 changes: 7 additions & 0 deletions src/Controller/Admin/DeliverySetMain.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
*/
class DeliverySetMain extends DeliverySetMain_parent
{

/**
* @inheritDoc
*
* @return string
*
*/
public function render()
{
$amazonCarriers = AmazonCarrier::getAllCarriers();
Expand Down
24 changes: 19 additions & 5 deletions src/Controller/Admin/OrderArticle.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,29 @@

class OrderArticle extends OrderArticle_parent
{
public function deleteThisArticle(): void
/**
* @inheritDoc
*
* @return void
*
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function deleteThisArticle()
{
$this->refundAmazon();
parent::deleteThisArticle();
}

public function storno(): void
/**
* @inheritDoc
*
* @return void
*
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
public function storno()
{
$this->refundAmazon();
parent::storno();
Expand All @@ -33,10 +49,8 @@ public function storno(): void
/**
* @throws DatabaseErrorException
* @throws DatabaseConnectionException
*
* @return void
*/
private function refundAmazon()
private function refundAmazon(): void
{
$config = new Config();
if (!$config->automatedRefundActivated()) {
Expand Down
3 changes: 3 additions & 0 deletions src/Controller/Admin/OrderList.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
class OrderList extends OrderList_parent
{
/**
* @inheritDoc
*
* @return void
*
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
Expand Down
9 changes: 2 additions & 7 deletions src/Controller/Admin/OrderOverview.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class OrderOverview extends OrderOverview_parent
/**
* @inheritDoc
*
* @return string
*
* @throws DatabaseErrorException
* @throws DatabaseConnectionException
*/
Expand Down Expand Up @@ -125,7 +127,6 @@ public function render()
}

/**
* @return string
* @throws DatabaseConnectionException
* @throws DatabaseErrorException
*/
Expand Down Expand Up @@ -155,19 +156,13 @@ public function getAmazonAPIOrderStatus(): string
return $this->captureStatus;
}

/**
* @return string
*/
public function getAmazonMaximalRefundAmount(): string
{
return PhpHelper::getMoneyValue(
OxidServiceProvider::getAmazonService()->getMaximalRefundAmount($this->getEditObjectId())
);
}

/**
* @return string
*/
public function getAmazonMaximalCaptureAmount(): string
{
$order = new Order();
Expand Down

0 comments on commit 7c44355

Please sign in to comment.