Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Application/Model/Payment/Banktransfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,8 @@ protected function getDueDate()
public function getPaymentSpecificParameters(Order $oOrder)
{
$aParams = parent::getPaymentSpecificParameters($oOrder);

$aParams['billingEmail'] = $oOrder->oxorder__oxbillemail->value;
$aParams['dueDate'] = $this->getDueDate();

if ($this->getApiMethod() == 'order') {
unset($aParams['billingEmail']); // existance of billingEmail param in OrderAPI triggers error
}
return $aParams;
}
}
32 changes: 5 additions & 27 deletions Application/Model/Payment/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ abstract class Base
*/
protected $aPaymentConfig = null;

/**
* Determines if the payment methods only supports the order API
*
* @var bool
*/
protected $blIsOnlyOrderApiSupported = false;

/**
* Determines if the payment methods supports the order expiry mechanism
*
Expand Down Expand Up @@ -161,16 +154,6 @@ public function getMolliePaymentCode()
return $this->sMolliePaymentCode;
}

/**
* Returns if the payment methods only supports the order API
*
* @return bool
*/
public function isOnlyOrderApiSupported()
{
return $this->blIsOnlyOrderApiSupported;
}

/**
* Returns array of billing country restrictions
*
Expand Down Expand Up @@ -275,7 +258,7 @@ public function getApiEndpoint($sMode = false, $sApiMethod = false)
if ($sApiMethod === false) {
$sApiMethod = $this->getApiMethod();
}
if ($sApiMethod == 'order') {
if ($sApiMethod == 'order') { // FCRM_REMOVE_ORDERS_API
return Payment::getInstance()->loadMollieApi($sMode)->orders;
}
return Payment::getInstance()->loadMollieApi($sMode)->payments;
Expand Down Expand Up @@ -308,6 +291,7 @@ public function getApiEndpointByOrder($oOrder)
*/
public function getApiRequestModel($oOrder = false)
{
// FCRM_REMOVE_ORDERS_API
if ($this->getApiMethod($oOrder) == 'order') {
return oxNew(\Mollie\Payment\Application\Model\Request\Order::class);
}
Expand All @@ -322,6 +306,7 @@ public function getApiRequestModel($oOrder = false)
*/
public function getTransactionHandler($oOrder = false)
{
// FCRM_REMOVE_ORDERS_API
if ($this->getApiMethod($oOrder) == 'order') {
return oxNew(\Mollie\Payment\Application\Model\TransactionHandler\Order::class);
}
Expand All @@ -340,14 +325,7 @@ public function getApiMethod($oOrder = false)
return $oOrder->oxorder__mollieapi->value;
}

$sApiMethod = $this->getConfigParam('api');
if (empty($sApiMethod)) {
$sApiMethod = $this->sDefaultApi;
if ($this->blIsOnlyOrderApiSupported === true) {
$sApiMethod = 'order';
}
}
return $sApiMethod;
return 'payment'; // order API was removed in 2025-12
}

/**
Expand Down Expand Up @@ -586,7 +564,7 @@ public function getPaymentSpecificParameters(Order $oOrder)
$aParams = [];

$sCaptureMethod = $this->getCaptureMethod();
if ($this->getApiMethod($oOrder) == 'payment' && $sCaptureMethod !== false) { // Merchant capture only available for Payment API
if ($sCaptureMethod !== false) { // Merchant capture only available for Payment API
$oOrder->mollieSetCaptureMode($sCaptureMethod);
$aParams['captureMode'] = $sCaptureMethod;
if ($sCaptureMethod === 'automatic') {
Expand Down
7 changes: 5 additions & 2 deletions Application/Model/Payment/KlarnaPayLater.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Mollie\Payment\Application\Model\Payment;

// FCRM_REMOVE_ORDERS_API
class KlarnaPayLater extends Base
{
/**
Expand All @@ -19,11 +20,13 @@ class KlarnaPayLater extends Base
protected $sMolliePaymentCode = 'klarnapaylater';

/**
* Determines if the payment methods only supports the order API
* Determines if payment method is deprecated.
* Deprecated methods are disabled, can't be used anymore and will be removed in a future release.
* They stay in the module to allow finishing old orders where these methods have been used
*
* @var bool
*/
protected $blIsOnlyOrderApiSupported = true;
protected $blMethodIsDeprecated = true;

/**
* @var bool
Expand Down
7 changes: 5 additions & 2 deletions Application/Model/Payment/KlarnaPayNow.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Mollie\Payment\Application\Model\Payment;

// FCRM_REMOVE_ORDERS_API
class KlarnaPayNow extends Base
{
/**
Expand All @@ -19,11 +20,13 @@ class KlarnaPayNow extends Base
protected $sMolliePaymentCode = 'klarnapaynow';

/**
* Determines if the payment methods only supports the order API
* Determines if payment method is deprecated.
* Deprecated methods are disabled, can't be used anymore and will be removed in a future release.
* They stay in the module to allow finishing old orders where these methods have been used
*
* @var bool
*/
protected $blIsOnlyOrderApiSupported = true;
protected $blMethodIsDeprecated = true;

/**
* @var bool
Expand Down
7 changes: 5 additions & 2 deletions Application/Model/Payment/KlarnaSliceIt.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Mollie\Payment\Application\Model\Payment;

// FCRM_REMOVE_ORDERS_API
class KlarnaSliceIt extends Base
{
/**
Expand All @@ -19,11 +20,13 @@ class KlarnaSliceIt extends Base
protected $sMolliePaymentCode = 'klarnasliceit';

/**
* Determines if the payment methods only supports the order API
* Determines if payment method is deprecated.
* Deprecated methods are disabled, can't be used anymore and will be removed in a future release.
* They stay in the module to allow finishing old orders where these methods have been used
*
* @var bool
*/
protected $blIsOnlyOrderApiSupported = true;
protected $blMethodIsDeprecated = true;

/**
* @var bool
Expand Down
18 changes: 0 additions & 18 deletions Application/Model/Payment/MyBank.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,4 @@ class MyBank extends Base
* @var bool
*/
protected $blNeedsExtendedAddress = true;

/**
* Returns if payment method is available for the current basket situation. The limiting factors are:
*
* 1. All factors from parent call
* 2. OrderAPI doesn't support requests without first- or lastname for MyBank, so don't show it
*
* @return bool
*/
public function isMethodAvailable($oBasket)
{
$blReturn = parent::isMethodAvailable($oBasket);
$oUser = $oBasket->getBasketUser();
if ($this->getApiMethod() === 'order' && (empty($oUser->oxuser__oxfname->value) || empty($oUser->oxuser__oxlname->value))) {
$blReturn = false;
}
return $blReturn;
}
}
5 changes: 1 addition & 4 deletions Application/Model/Payment/Twint.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ public function isMolliePaymentActiveInGeneral()
public function getPaymentSpecificParameters(Order $oOrder)
{
$aParams = parent::getPaymentSpecificParameters($oOrder);

if ($this->getApiMethod($oOrder) == 'payment') {
$aParams['locale'] = 'de_CH';
}
$aParams['locale'] = 'de_CH';
return $aParams;
}
}
9 changes: 1 addition & 8 deletions Application/Model/PaymentConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@ public static function getTableCreateQuery()
*/
public function savePaymentConfig($sPaymentId, $aConfig)
{
if (!isset($aConfig['api'])) {
return false; // Faulty values - cancel execution
}

$sMollieApi = $aConfig['api'];
unset($aConfig['api']);

return $this->handleData($sPaymentId, $sMollieApi, $aConfig);
return $this->handleData($sPaymentId, 'payment', $aConfig);
}

/**
Expand Down
7 changes: 1 addition & 6 deletions Application/Model/Request/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,7 @@ protected function addRequestParameters(CoreOrder $oOrder, $dAmount, $sReturnUrl

$this->addParameter('locale', PaymentHelper::getInstance()->getLocale());

$aPaymentSpecificParameters = $oPaymentModel->getPaymentSpecificParameters($oOrder);
if (!empty($aPaymentSpecificParameters) && $oPaymentModel->getApiMethod() == 'order') {
$aPaymentSpecificParameters = ['payment' => $aPaymentSpecificParameters];
}

$this->aParameters = array_merge($this->aParameters, $aPaymentSpecificParameters);
$this->aParameters = array_merge($this->aParameters, $oPaymentModel->getPaymentSpecificParameters($oOrder));
}

/**
Expand Down
1 change: 1 addition & 0 deletions Application/Model/Request/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use OxidEsales\Eshop\Application\Model\Order as CoreOrder;

// FCRM_REMOVE_ORDERS_API
class Order extends Base
{
/**
Expand Down
1 change: 1 addition & 0 deletions Application/Model/TransactionHandler/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Mollie\Api\Resources\Order as ApiOrder;
use OxidEsales\Eshop\Core\Registry;

// FCRM_REMOVE_ORDERS_API
class Order extends Base
{
/**
Expand Down
8 changes: 0 additions & 8 deletions Tests/Unit/Application/Model/Payment/IdealTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ public function testGetMolliePaymentCode()
$this->assertEquals("ideal", $result);
}

public function testIsOnlyOrderApiSupported()
{
$oPayment = new \Mollie\Payment\Application\Model\Payment\Ideal();
$result = $oPayment->isOnlyOrderApiSupported();

$this->assertFalse($result);
}

public function testIsOrderExpirySupported()
{
$oPayment = new \Mollie\Payment\Application\Model\Payment\Ideal();
Expand Down
3 changes: 0 additions & 3 deletions Tests/Unit/Application/Model/Request/OrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function testSendRequest()
$oPaymentModel = $this->getMockBuilder(Creditcard::class)->disableOriginalConstructor()->getMock();
$oPaymentModel->method('getMolliePaymentCode')->willReturn('creditcard');
$oPaymentModel->method('isRedirectUrlNeeded')->willReturn(true);
$oPaymentModel->method('getApiMethod')->willReturn('order');
$oPaymentModel->method('getPaymentSpecificParameters')->willReturn(['foo' => 'bar']);
$oPaymentModel->method('getApiEndpoint')->willReturn($oApiEndpoint);
$oPaymentModel->method('getApiEndpointByOrder')->willReturn($oApiEndpoint);
Expand Down Expand Up @@ -103,7 +102,6 @@ public function testSendRequestFixProductsumMismatch()
$oPaymentModel = $this->getMockBuilder(Creditcard::class)->disableOriginalConstructor()->getMock();
$oPaymentModel->method('getMolliePaymentCode')->willReturn('creditcard');
$oPaymentModel->method('isRedirectUrlNeeded')->willReturn(true);
$oPaymentModel->method('getApiMethod')->willReturn('order');
$oPaymentModel->method('getPaymentSpecificParameters')->willReturn(['foo' => 'bar']);
$oPaymentModel->method('getApiEndpoint')->willReturn($oApiEndpoint);
$oPaymentModel->method('getApiEndpointByOrder')->willReturn($oApiEndpoint);
Expand Down Expand Up @@ -210,7 +208,6 @@ public function testSendRequestSumMismatch()
$oPaymentModel = $this->getMockBuilder(Creditcard::class)->disableOriginalConstructor()->getMock();
$oPaymentModel->method('getMolliePaymentCode')->willReturn('creditcard');
$oPaymentModel->method('isRedirectUrlNeeded')->willReturn(true);
$oPaymentModel->method('getApiMethod')->willReturn('order');
$oPaymentModel->method('getPaymentSpecificParameters')->willReturn(['foo' => 'bar']);
$oPaymentModel->method('getApiEndpoint')->willReturn($oApiEndpoint);
$oPaymentModel->method('getApiEndpointByOrder')->willReturn($oApiEndpoint);
Expand Down
4 changes: 0 additions & 4 deletions Tests/Unit/Application/Model/Request/PaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function testSendRequest()
$oPaymentModel = $this->getMockBuilder(Creditcard::class)->disableOriginalConstructor()->getMock();
$oPaymentModel->method('getMolliePaymentCode')->willReturn('creditcard');
$oPaymentModel->method('isRedirectUrlNeeded')->willReturn(true);
$oPaymentModel->method('getApiMethod')->willReturn('order');
$oPaymentModel->method('getPaymentSpecificParameters')->willReturn(['foo' => 'bar']);
$oPaymentModel->method('getApiEndpoint')->willReturn($oApiEndpoint);
$oPaymentModel->method('getApiEndpointByOrder')->willReturn($oApiEndpoint);
Expand Down Expand Up @@ -70,7 +69,6 @@ public function testSendRequestApiException()
$oPaymentModel = $this->getMockBuilder(Creditcard::class)->disableOriginalConstructor()->getMock();
$oPaymentModel->method('getMolliePaymentCode')->willReturn('creditcard');
$oPaymentModel->method('isRedirectUrlNeeded')->willReturn(true);
$oPaymentModel->method('getApiMethod')->willReturn('order');
$oPaymentModel->method('getPaymentSpecificParameters')->willReturn(['foo' => 'bar']);
$oPaymentModel->method('getApiEndpoint')->willReturn($oApiEndpoint);
$oPaymentModel->method('getApiEndpointByOrder')->willReturn($oApiEndpoint);
Expand Down Expand Up @@ -111,7 +109,6 @@ public function testSendRequestDetailsFailure()
$oPaymentModel = $this->getMockBuilder(Creditcard::class)->disableOriginalConstructor()->getMock();
$oPaymentModel->method('getMolliePaymentCode')->willReturn('creditcard');
$oPaymentModel->method('isRedirectUrlNeeded')->willReturn(true);
$oPaymentModel->method('getApiMethod')->willReturn('order');
$oPaymentModel->method('getPaymentSpecificParameters')->willReturn(['foo' => 'bar']);
$oPaymentModel->method('getApiEndpoint')->willReturn($oApiEndpoint);
$oPaymentModel->method('getApiEndpointByOrder')->willReturn($oApiEndpoint);
Expand Down Expand Up @@ -152,7 +149,6 @@ public function testSendRequestExtraFailure()
$oPaymentModel = $this->getMockBuilder(Creditcard::class)->disableOriginalConstructor()->getMock();
$oPaymentModel->method('getMolliePaymentCode')->willReturn('creditcard');
$oPaymentModel->method('isRedirectUrlNeeded')->willReturn(true);
$oPaymentModel->method('getApiMethod')->willReturn('order');
$oPaymentModel->method('getPaymentSpecificParameters')->willReturn(['foo' => 'bar']);
$oPaymentModel->method('getApiEndpoint')->willReturn($oApiEndpoint);
$oPaymentModel->method('getApiEndpointByOrder')->willReturn($oApiEndpoint);
Expand Down
2 changes: 1 addition & 1 deletion extend/Application/Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ protected function setPayment($sPaymentid)

if ($this->mollieIsMolliePaymentUsed()) {
$this->oxorder__molliemode = new Field(PaymentHelper::getInstance()->getMollieMode());
$this->oxorder__mollieapi = new Field($this->mollieGetPaymentModel()->getApiMethod());
$this->oxorder__mollieapi = new Field('payment');
}
return $mParentReturn;
}
Expand Down
Loading