Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/oxid-7-dev'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Application/Controller/Admin/FcPayOneAdmin.php
#	Application/Controller/Admin/FcPayOneAdminDetails.php
#	Application/Controller/Admin/FcPayOneAdminList.php
#	Application/Controller/Admin/FcPayOneAdminView.php
#	Application/Controller/Admin/FcPayOneApiLog.php
#	Application/Controller/Admin/FcPayOneApiLogMain.php
#	Application/Controller/Admin/FcPayOneErrorMapping.php
#	Application/Controller/Admin/FcPayOneList.php
#	Application/Controller/Admin/FcPayOneLog.php
#	Application/Controller/Admin/FcPayOneLogList.php
#	Application/Controller/Admin/FcPayOneMain.php
#	Application/Controller/Admin/FcPayOneMainAjax.php
#	Application/Controller/Admin/FcPayOneOrder.php
#	Application/Controller/Admin/FcPayOnePaymentMain.php
#	Application/Controller/Admin/FcPayOneProtocol.php
#	Application/Controller/Admin/FcPayOneRolesBeMain.php
#	Application/Controller/Admin/FcPayOneStatusForwarding.php
#	Application/Controller/Admin/FcPayOneStatusMapping.php
#	Application/Controller/FcPayOneBasketView.php
#	Application/Controller/FcPayOneOrderView.php
#	Application/Controller/FcPayOnePaymentView.php
#	Application/Controller/FcPayOneUserView.php
#	Application/Model/FcPayOneAddress.php
#	Application/Model/FcPayOneBasket.php
#	Application/Model/FcPayOneBasketItem.php
#	Application/Model/FcPayOneOrder.php
#	Application/Model/FcPayOneOrderArticle.php
#	Application/Model/FcPayOnePayment.php
#	Application/Model/FcPayOnePaymentGateway.php
#	Application/Model/FcPayOneUser.php
#	Application/Model/FcPoConfigExport.php
#	Application/Model/FcPoErrorMapping.php
#	Application/Model/FcPoForwarding.php
#	Application/Model/FcPoKlarna.php
#	Application/Model/FcPoMapping.php
#	Application/Model/FcPoPaypal.php
#	Application/Model/FcPoRatePay.php
#	Application/Model/FcPoRequestLog.php
#	Application/Model/FcPoTransactionStatus.php
#	Application/Model/FcPoUserFlag.php
#	Application/translations/de/fcPayOne_lang.php
#	Application/translations/en/fcPayOne_lang.php
#	Application/translations/nl/fcPayOne_lang.php
#	Changelog.txt
#	Core/FcPayOneEvents.php
#	Core/FcPayOneViewConf.php
#	FcCheckChecksum.php
#	Lib/FcPoHelper.php
#	Lib/FcPoRequest.php
#	assets/picture.gif
#	composer.json
#	config.ipwhitelist.php
#	menu.xml
#	metadata.php
#	payoneerrors.xml
#	version.php
#	version.txt
#	views/twig/admin/fcpayone.html.twig
#	views/twig/admin/fcpayone_apilog.html.twig
#	views/twig/admin/fcpayone_apilog_list.html.twig
#	views/twig/admin/fcpayone_apilog_main.html.twig
#	views/twig/admin/fcpayone_error_mapping.html.twig
#	views/twig/admin/fcpayone_list.html.twig
#	views/twig/admin/fcpayone_log.html.twig
#	views/twig/admin/fcpayone_log_list.html.twig
#	views/twig/admin/fcpayone_main.html.twig
#	views/twig/admin/fcpayone_order.html.twig
#	views/twig/admin/fcpayone_protocol.html.twig
#	views/twig/admin/fcpayone_status_forwarding.html.twig
#	views/twig/admin/fcpayone_status_mapping.html.twig
#	views/twig/admin/popups/fcpayone_popup_main.html.twig
#	views/twig/frontend/fcpayoneiframe.html.twig
#	views/twig/frontend/fcpo_payment_creditcard_script.html.twig
#	views/twig/frontend/mobile/fcpo_payment_secinvoice.html.twig
  • Loading branch information
andrepayone committed May 13, 2024
2 parents a51e818 + 995cab5 commit 2815dd3
Show file tree
Hide file tree
Showing 157 changed files with 23,432 additions and 8,262 deletions.
6 changes: 3 additions & 3 deletions Application/Controller/Admin/FcPayOneAdmin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* PAYONE OXID Connector is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -14,9 +13,9 @@
* You should have received a copy of the GNU Lesser General Public License
* along with PAYONE OXID Connector. If not, see <http://www.gnu.org/licenses/>.
*
* @link http://www.payone.de
* @link http://www.payone.de
* @copyright (C) Payone GmbH
* @version OXID eShop CE
* @version OXID eShop CE
*/

namespace Fatchip\PayOne\Application\Controller\Admin;
Expand All @@ -30,4 +29,5 @@ class FcPayOneAdmin extends FcPayOneAdminView
* @var string
*/
protected $_sThisTemplate = '@fcpayone/admin/fcpayone';

}
116 changes: 114 additions & 2 deletions Application/Controller/Admin/FcPayOneAdminDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,106 @@

namespace Fatchip\PayOne\Application\Controller\Admin;

use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface;
use Fatchip\PayOne\Application\Model as PayOneModel;
use Fatchip\PayOne\Application\Model\FcPoConfigExport;
use Fatchip\PayOne\Application\Model\FcPoErrorMapping;
use Fatchip\PayOne\Application\Model\FcPoForwarding;
use Fatchip\PayOne\Application\Model\FcPoKlarna;
use Fatchip\PayOne\Application\Model\FcPoMapping;
use Fatchip\PayOne\Application\Model\FcPoPaypal;
use Fatchip\PayOne\Application\Model\FcPoRatePay;
use Fatchip\PayOne\Lib\FcPoHelper;
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface;
use OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;
use stdClass;

class FcPayOneAdminDetails extends AdminDetailsController
{

/**
* Helper object for dealing with different shop versions
*
* @var FcPoHelper
*/
protected FcPoHelper $_oFcPoHelper;

/**
* Centralized Database instance
*
* @var DatabaseInterface
*/
protected DatabaseInterface $_oFcPoDb;

/**
* fcpoconfigexport instance
*
* @var FcPoConfigExport
*/
protected FcPoConfigExport $_oFcPoConfigExport;

/**
* fcpopaypal instance
*
* @var FcPoPaypal
*/

protected FcPoPaypal $_oFcPoPayPal;

/**
* fcpopaypal instance
*
* @var FcPoKlarna
*/
protected FcPoKlarna $_oFcPoKlarna;

/**
* fcpomapping instance
*
* @var FcPoMapping
*/
protected FcPoMapping $_oFcPoMapping;

/**
* fcpoforwarding instance
*
* @var FcPoForwarding
*/
protected FcPoForwarding $_oFcPoForwarding;

/**
* fcporatepay instance
*
* @var FcPoRatePay
*/
protected FcPoRatePay $_oFcPoRatePay;

/**
* fcpoerrormapping instance
*
* @var FcPoErrorMapping
*/
protected FcPoErrorMapping $_oFcPoErrorMapping;


/**
* Init needed data
* @throws DatabaseConnectionException
*/
public function __construct()
{
parent::__construct();
$this->_oFcPoHelper = oxNew(FcPoHelper::class);
$this->_oFcPoDb = DatabaseProvider::getDb();
$this->_oFcPoConfigExport = oxNew(FcPoConfigExport::class);
$this->_oFcPoPayPal = oxNew(FcPoPayPal::class);
$this->_oFcPoKlarna = oxNew(FcPoKlarna::class);
$this->_oFcPoMapping = oxNew(FcPoMapping::class);
$this->_oFcPoForwarding = oxNew(FcPoForwarding::class);
$this->_oFcPoRatePay = oxNew(FcPoRatePay::class);
$this->_oFcPoErrorMapping = oxNew(FcPoErrorMapping::class);
}

/**
* Returns factory instance of given classname
*
Expand All @@ -39,4 +130,25 @@ public function fcpoGetInstance(string $sClassName): object
{
return oxNew($sClassName);
}

/**
* Returns payone status list
*
* @return stdClass[]
*/
public function getPayoneStatusList(): array
{
$aPayoneStatusList = $this->_oFcPoHelper->fcpoGetPayoneStatusList();

$aNewList = [];
foreach ($aPayoneStatusList as $sPayoneStatusId) {
$oStatus = new stdClass();
$oStatus->sId = $sPayoneStatusId;
$oStatus->sTitle = $this->_oFcPoHelper->fcpoGetLang()->translateString('fcpo_status_' . $sPayoneStatusId, null, true);
$aNewList[] = $oStatus;
}

return $aNewList;
}

}
30 changes: 29 additions & 1 deletion Application/Controller/Admin/FcPayOneAdminList.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,39 @@

namespace Fatchip\PayOne\Application\Controller\Admin;

use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface;
use Fatchip\PayOne\Lib\FcPoHelper;
use OxidEsales\Eshop\Application\Controller\Admin\AdminListController;
use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface;
use OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;

class FcPayOneAdminList extends AdminListController
{

/**
* Helper object for dealing with different shop versions
*
* @var FcPoHelper
*/
protected FcPoHelper $_oFcPoHelper;

/**
* Centralized Database instance
*
* @var DatabaseInterface
*/
protected DatabaseInterface $_oFcPoDb;


/**
* Init needed data
* @throws DatabaseConnectionException
*/
public function __construct()
{
parent::__construct();
$this->_oFcPoHelper = oxNew(FcPoHelper::class);
$this->_oFcPoDb = DatabaseProvider::getDb();
}

}
51 changes: 26 additions & 25 deletions Application/Controller/Admin/FcPayOneAdminView.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* PAYONE OXID Connector is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -21,88 +20,90 @@

namespace Fatchip\PayOne\Application\Controller\Admin;

use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface;
use Fatchip\PayOne\Lib\FcPoHelper;
use OxidEsales\Eshop\Application\Controller\Admin\AdminController;
use OxidEsales\Eshop\Core\Database\Adapter\DatabaseInterface;
use OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Core\Exception\DatabaseConnectionException;

class FcPayOneAdminView extends AdminController
{

/**
* Helper object for dealing with different shop versions
*
* @var object
* @var FcPoHelper
*/
protected FcPoHelper $_oFcPoHelper;

/**
* Centralized Database instance
*
* @var DatabaseInterface
*/
private $_oFcpoHelper;
protected DatabaseInterface $_oFcPoDb;


/**
* Init needed data
* @throws DatabaseConnectionException
*/
public function __construct()
{
parent::__construct();
$this->_oFcpoHelper = oxNew(FcPoHelper::class);
$this->_oFcPoHelper = oxNew(FcPoHelper::class);
$this->_oFcPoDb = DatabaseProvider::getDb();
}


/**
* Return admin template seperator sign by shop-version
* Return admin template separator sign by shop-version
*
* @return string
*/
public function fcGetAdminSeperator()
public function fcGetAdminSeparator(): string
{
$iVersion = $this->_oFcpoHelper->fcpoGetIntShopVersion();
if ($iVersion < 4300) {
return '?';
} else {
return '&';
}
return '&';
}

/**
* Returns current view identifier
*
* @return string
*/
public function getViewId(): string
{
return 'dyn_fcpayone';
}


/**
* Template getter for integrator ID
*
*
* @return string
*/
public function fcpoGetIntegratorId()
public function fcpoGetIntegratorId(): string
{
return $this->_oFcpoHelper->fcpoGetIntegratorId();
return $this->_oFcPoHelper->fcpoGetIntegratorId();
}


/**
* Template getter returns payone connector version
*
*
* @return string
*/
public function fcpoGetVersion()
public function fcpoGetVersion(): string
{
return $this->_oFcpoHelper->fcpoGetModuleVersion();
return $this->_oFcPoHelper->fcpoGetModuleVersion();
}

/**
* Template getter for Merchant ID
*
*
* @return string
*/
public function fcpoGetMerchantId()
public function fcpoGetMerchantId(): string
{
$oConfig = $this->_oFcpoHelper->fcpoGetConfig();
$oConfig = $this->_oFcPoHelper->fcpoGetConfig();
return $oConfig->getConfigParam('sFCPOMerchantID');
}

}
22 changes: 14 additions & 8 deletions Application/Controller/Admin/FcPayOneApiLog.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* PAYONE OXID Connector is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -26,37 +25,44 @@
class FcPayOneApiLog extends FcPayOneAdminDetails
{

public $_oFcpoHelper;
/**
* Current class template name
*
* @var string
*/
protected $_sThisTemplate = '@fcpayone/admin/fcpayone_apilog';

/**
* Array with existing status of order
*
* @var array|null
*/
protected ?array $_aStatus = null;


/**
* Loads transaction log entry with given oxid, passes
* it's data to Smarty engine and returns name of template file
* "fcpayone_apilog.html.twig".
* its data to Twig engine and returns path to a template
* "fcpayone_apilog".
*
* @return string
*/
public function render()
public function render(): string
{
parent::render();

$oLogEntry = $this->_oFcpoHelper->getFactoryObject(FcPoRequestLog::class);
$oLogEntry = $this->_oFcPoHelper->getFactoryObject(FcPoRequestLog::class);

$sOxid = $this->_oFcpoHelper->fcpoGetRequestParameter("oxid");
$sOxid = $this->_oFcPoHelper->fcpoGetRequestParameter("oxid");
if ($sOxid != "-1" && isset($sOxid)) {
// load object
$oLogEntry->load($sOxid);
$this->_aViewData["edit"] = $oLogEntry;
}

$this->_aViewData['sHelpURL'] = $this->_oFcpoHelper->fcpoGetHelpUrl();
$this->_aViewData['sHelpURL'] = $this->_oFcPoHelper->fcpoGetHelpUrl();

return $this->_sThisTemplate;
}

}
Loading

0 comments on commit 2815dd3

Please sign in to comment.