Skip to content

Commit ee48e31

Browse files
authored
Merge pull request #435 from OXID-eSales/PSPAYPAL-803
move functionality to model
2 parents a38b2b1 + 4102734 commit ee48e31

5 files changed

Lines changed: 15 additions & 65 deletions

File tree

metadata.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use OxidEsales\Eshop\Application\Component\BasketComponent;
99
use OxidEsales\Eshop\Application\Component\UserComponent;
10-
use OxidEsales\Eshop\Application\Controller\Admin\PaymentMain;
1110
use OxidEsales\Eshop\Application\Controller\OrderController;
1211
use OxidEsales\Eshop\Application\Controller\PaymentController;
1312
use OxidEsales\Eshop\Application\Controller\Admin\OrderMain;
@@ -27,7 +26,6 @@
2726
use OxidSolutionCatalysts\PayPal\Controller\Admin\PayPalConfigController;
2827
use OxidSolutionCatalysts\PayPal\Controller\Admin\PayPalOrderController;
2928
use OxidSolutionCatalysts\PayPal\Controller\Admin\OrderMain as PayPalOrderMainController;
30-
use OxidSolutionCatalysts\PayPal\Controller\Admin\PaymentMain as PayPalPaymentMainController;
3129
use OxidSolutionCatalysts\PayPal\Controller\Admin\OrderOverview as PayPalOrderOverviewController;
3230
use OxidSolutionCatalysts\PayPal\Controller\OrderController as PayPalFrontEndOrderController;
3331
use OxidSolutionCatalysts\PayPal\Controller\PaymentController as PayPalPaymentController;
@@ -82,7 +80,6 @@
8280
UserComponent::class => PayPalUserComponent::class,
8381
BasketComponent::class => PayPalBasketComponent::class,
8482
OrderMain::class => PayPalOrderMainController::class,
85-
PaymentMain::class => PayPalPaymentMainController::class,
8683
OrderOverview::class => PayPalOrderOverviewController::class,
8784
State::class => PayPalState::class
8885
],

src/Controller/Admin/PaymentMain.php

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/Model/Payment.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace OxidSolutionCatalysts\PayPal\Model;
99

10+
use OxidEsales\Eshop\Core\Field;
1011
use OxidSolutionCatalysts\PayPal\Core\PayPalDefinitions;
1112

1213
class Payment extends Payment_parent
@@ -40,4 +41,18 @@ public function isDeprecatedPayment(): bool
4041
{
4142
return PayPalDefinitions::isDeprecatedPayment($this->getId());
4243
}
44+
45+
/**
46+
* @inheritDoc
47+
*
48+
* @return string|bool
49+
*/
50+
public function save()
51+
{
52+
// PayPalExpress could not be a default Payment
53+
if ($this->getId() === PayPalDefinitions::EXPRESS_PAYPAL_PAYMENT_ID) {
54+
$this->oxpayments__oxchecked = new Field(0);
55+
}
56+
return parent::save();
57+
}
4358
}

views/admin/de/admin_lang.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,5 +296,4 @@
296296

297297
'OSC_PAYPAL_CUSTOM_ID_CONTENTS_TITLE' => 'PayPal Inhalte des benutzerdefinierten ID-Feldes',
298298
'OSC_PAYPAL_CUSTOM_ID_CONTENTS_DESC' => 'Das benutzerdefinierte PayPal-ID-Feld kann entweder nur den Bestellnummernwert oder ein JSON mit zusätzlichen Daten enthalten.',
299-
'OSC_PAYPAL_PAYMENT_METHOD_CANNOT_BE_DEFAULT' => 'Dieses Zahlungsart kann nicht als Standart-Zahlungsart verwendet werden.',
300299
];

views/admin/en/admin_lang.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,4 @@
295295

296296
'OSC_PAYPAL_CUSTOM_ID_CONTENTS_TITLE' => 'PayPal custom id field contents',
297297
'OSC_PAYPAL_CUSTOM_ID_CONTENTS_DESC' => 'PayPal custom id field will be JSON encoded string with order number, shop version and the PayPal module version.',
298-
299-
'OSC_PAYPAL_PAYMENT_METHOD_CANNOT_BE_DEFAULT' => 'This payment method cannot be set as default',
300298
];

0 commit comments

Comments
 (0)