Skip to content

Commit b4861b7

Browse files
author
Dennis Garding
authored
Merge pull request #36 from shopware5/pt-13140/deactivate-myBank
PT-13140 - Deactivates MyBank payment method
2 parents dc8aefe + 4841b82 commit b4861b7

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[en_GB]
22
onboardingMessageText = "Please be aware, that your PayPal-account needs to be eligible for receiving payments with "Pay Upon Invoice", for this payment method to be available to your customers. You may authorize your account in the PayPal settings module."
3+
myBankDisclaimerText = "Merchants enabling MyBank after February 2023 will need manual approval by PayPal. Reach out to merchant support for further information on this."
34

45
[de_DE]
5-
onboardingMessageText = "Bitte beachte, dass Dein PayPal-Konto für den Empfang von Zahlungen mit "PayPal Rechnungskauf" zugelassen sein muss, damit diese Zahlungsmethode für Deine Kunden verfügbar ist. Du kannst Dein Konto im PayPal-Einstellungsmodul autorisieren."
6+
onboardingMessageText = "Bitte beachte, dass Dein PayPal-Konto für den Empfang von Zahlungen mit "PayPal Rechnungskauf" zugelassen sein muss, damit diese Zahlungsmethode für Deine Kunden verfügbar ist. Du kannst Dein Konto im PayPal-Einstellungsmodul autorisieren."
7+
myBankDisclaimerText = "Händler, die MyBank nach Februar 2023 aktivieren, benötigen eine manuelle Freischaltung durch PayPal. Für weiterführende Informationen hierzu bitte den Händlersupport kontaktieren."

Resources/views/backend/payment/controller/payment_paypal_unified.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,19 @@ Ext.define('Shopware.apps.Payment.controller.PaymentPaypalUnified', {
55
override: 'Shopware.apps.Payment.controller.Payment',
66

77
snippets: {
8-
onboardingMessageText: '{s name="onboardingMessageText"}Please be aware, that your PayPal-account needs to be eligible for receiving payments with "Pay Upon Invoice", for this payment method to be available to your customers. You may authorize your account in the PayPal settings module.{/s}'
8+
onboardingMessageText: '{s name="onboardingMessageText"}Please be aware, that your PayPal-account needs to be eligible for receiving payments with "Pay Upon Invoice", for this payment method to be available to your customers. You may authorize your account in the PayPal settings module.{/s}',
9+
myBankDisclaimerText: '{s name="myBankDisclaimerText"}Merchants enabling MyBank after February 2023 will need manual approval by PayPal. Reach out to merchant support for further information on this.{/s}',
910
},
1011

1112
onboardingMessage: null,
1213
payUponInvoicePaymentMethodName: 'SwagPaymentPayPalUnifiedPayUponInvoice',
14+
myBankPaymentMethodName: 'SwagPaymentPayPalUnifiedMyBank',
1315

1416
/**
1517
* @param { Ext.view.View } view
1618
* @param { Ext.data.Record } record
1719
*/
1820
onItemClick: function (view, record) {
19-
if (this.alreadyAdded === true) {
20-
this.callParent(arguments);
21-
return;
22-
}
23-
2421
var win = view.up('window'),
2522
form = win.generalForm,
2623
treeToolBar = win.down('toolbar[name=treeToolBar]'),
@@ -31,13 +28,20 @@ Ext.define('Shopware.apps.Payment.controller.PaymentPaypalUnified', {
3128

3229
if (record.get('name') === this.payUponInvoicePaymentMethodName) {
3330
form.insert(0, this._createOnboardingMessage());
34-
this.alreadyAdded = true;
3531
} else if (this.onboardingMessage !== null) {
3632
form.remove(this.onboardingMessage);
3733

3834
this.onboardingMessage = null;
3935
}
4036

37+
if (record.get('name') === this.myBankPaymentMethodName) {
38+
form.insert(0, this._createMyBankDisclaimer());
39+
} else if (this.myBankDisclaimer !== null) {
40+
form.remove(this.myBankDisclaimer);
41+
42+
this.myBankDisclaimer = null;
43+
}
44+
4145
this.callParent(arguments);
4246
},
4347

@@ -49,5 +53,14 @@ Ext.define('Shopware.apps.Payment.controller.PaymentPaypalUnified', {
4953

5054
return this.onboardingMessage;
5155
},
56+
57+
_createMyBankDisclaimer: function () {
58+
this.myBankDisclaimer = Shopware.Notification.createBlockMessage(
59+
this.snippets.myBankDisclaimerText,
60+
'alert'
61+
);
62+
63+
return this.myBankDisclaimer;
64+
},
5265
});
5366
// {/block}

SwagPaymentPayPalUnified.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use SwagPaymentPayPalUnified\Components\DependencyInjection\RiskManagementValueCompilerPass;
2424
use SwagPaymentPayPalUnified\Components\DependencyInjection\WebhookFactoryCompilerPass;
2525
use SwagPaymentPayPalUnified\Components\PaymentMethodProvider;
26+
use SwagPaymentPayPalUnified\Components\PaymentMethodProviderInterface;
2627
use SwagPaymentPayPalUnified\Setup\Installer;
2728
use SwagPaymentPayPalUnified\Setup\PaymentModels\PaymentModelFactory;
2829
use SwagPaymentPayPalUnified\Setup\TranslationTransformer;
@@ -115,6 +116,9 @@ public function activate(ActivateContext $context)
115116
{
116117
$paymentMethodProvider = $this->getPaymentMethodProvider();
117118
foreach (PaymentMethodProvider::getAllUnifiedNames() as $unifiedName) {
119+
if ($unifiedName === PaymentMethodProviderInterface::MY_BANK_METHOD_NAME) {
120+
continue;
121+
}
118122
$paymentMethodProvider->setPaymentMethodActiveFlag($unifiedName, true);
119123
}
120124

Tests/Functional/Controller/Frontend/PaypalUnifiedV2Test.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,6 @@ public function orderDataProvider()
213213
];
214214
}
215215

216-
/**
217-
* @param Container $container
218-
*/
219216
private function getController(Container $container = null)
220217
{
221218
$request = new Enlight_Controller_Request_RequestTestCase();

0 commit comments

Comments
 (0)