Skip to content

Commit da4d145

Browse files
PT-3119: Add Pay Now as payment method to Shopware5 (#7)
1 parent cfe12a5 commit da4d145

File tree

6 files changed

+53
-7
lines changed

6 files changed

+53
-7
lines changed

Bootstrap/Assets/Translations.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ final class Translations
1919
PaymentMethods::PAYMENT_MONDU_3 => [
2020
'description' => 'Mondu Split Payments',
2121
'additionalDescription' => 'Information on the processing of your personal data by Mondu GmbH can be found <a href="https://www.mondu.ai/de/datenschutzgrundverordnung-kaeufer/" target="_blank">here.</a>'
22+
],
23+
PaymentMethods::PAYMENT_MONDU_4 => [
24+
'description' => 'Mondu Instant Pay – Pay directly from your bank account',
25+
'additionalDescription' => 'Information on the processing of your personal data by Mondu GmbH can be found <a href="https://www.mondu.ai/de/datenschutzgrundverordnung-kaeufer/" target="_blank">here.</a>'
2226
]
2327
],
2428
'de_DE' => [
@@ -33,7 +37,11 @@ final class Translations
3337
PaymentMethods::PAYMENT_MONDU_3 => [
3438
'description' => 'Mondu Ratenzahlung - Bequem in Raten per Bankeinzug zahlen',
3539
'additionalDescription' => 'Hinweise zur Verarbeitung Ihrer personenbezogenen Daten durch die Mondu GmbH finden Sie <a href="https://www.mondu.ai/de/datenschutzgrundverordnung-kaeufer" target="_blank">hier</a>.'
36-
]
40+
],
41+
PaymentMethods::PAYMENT_MONDU_4 => [
42+
'description' => 'Mondu Echtzeitüberweisung – Direkt von Ihrem Bankkonto bezahlen',
43+
'additionalDescription' => 'Informationen über die Verarbeitung Ihrer persönlichen Daten durch die Mondu GmbH finden Sie <a href="https://www.mondu.ai/de/datenschutzgrundverordnung-kaeufer" target="_blank">hier</a>.',
44+
],
3745
],
3846
'nl_NL' => [
3947
PaymentMethods::PAYMENT_MONDU_1 => [
@@ -47,6 +55,10 @@ final class Translations
4755
PaymentMethods::PAYMENT_MONDU_3 => [
4856
'description' => 'Mondu Gespreid betalen, betaal gemakkelijk in termijnen via automatische incasso',
4957
'additionalDescription' => 'Informatie over de verwerking van uw persoonsgegevens door Mondu GmbH vindt u <a href="https://www.mondu.ai/nl/information-nach-art-13-datenschutzgrundverordnung-fur-kaufer/" target="_blank">hier</a>.'
58+
],
59+
PaymentMethods::PAYMENT_MONDU_4 => [
60+
'description' => 'Mondu Instant Pay – Betaal direct vanaf uw bankrekening',
61+
'additionalDescription' => 'Informatie over de verwerking van uw persoonlijke gegevens door Mondu GmbH vindt u <a href="https://www.mondu.ai/nl/information-nach-art-13-datenschutzgrundverordnung-fur-kaufer/" target="_blank">hier</a>.',
5062
]
5163
],
5264
'fr_FR' => [
@@ -61,6 +73,10 @@ final class Translations
6173
PaymentMethods::PAYMENT_MONDU_3 => [
6274
'description' => 'Mondu Paiements Fractionnés - Payer facilement en plusieurs fois par prélèvement automatique',
6375
'additionalDescription' => 'Des informations sur la façon dont Mondu GmbH traite vos données personnelles peuvent être trouvées <a href=\"https://mondu.ai/fr/gdpr-notification-for-buyers\" target=\"_blank\">ici</a>.'
76+
],
77+
PaymentMethods::PAYMENT_MONDU_4 => [
78+
'description' => 'Mondu Virement Instantané – Payez directement depuis votre compte bancaire',
79+
'additionalDescription' => 'Des informations sur la façon dont Mondu GmbH traite vos données personnelles peuvent être trouvées <a href=\"https://mondu.ai/fr/gdpr-notification-for-buyers\" target=\"_blank\">ici</a>.',
6480
]
6581
]
6682
];

Enum/PaymentMethods.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,21 @@ final class PaymentMethods extends Enum
1111
const PAYMENT_MONDU_1 = 'mondu_payment';
1212
const PAYMENT_MONDU_2 = 'mondu_payment_sepa';
1313
const PAYMENT_MONDU_3 = 'mondu_payment_installment';
14+
const PAYMENT_MONDU_4 = 'mondu_payment_pay_now';
1415

1516
const MONDU_INVOICE = 'invoice';
1617
const MONDU_SEPA = 'direct_debit';
1718
const MONDU_INSTALLMENT = 'installment';
19+
const MONDU_PAY_NOW = 'pay_now';
1820

19-
const LOCAL_MONDU_PAYMENT_METHODS = [self::PAYMENT_MONDU_1, self::PAYMENT_MONDU_2, self::PAYMENT_MONDU_3];
20-
const MONDU_PAYMENT_METHODS = [self::MONDU_INVOICE, self::MONDU_SEPA, self::MONDU_INSTALLMENT];
21+
const LOCAL_MONDU_PAYMENT_METHODS = [self::PAYMENT_MONDU_1, self::PAYMENT_MONDU_2, self::PAYMENT_MONDU_3, self::PAYMENT_MONDU_4];
22+
const MONDU_PAYMENT_METHODS = [self::MONDU_INVOICE, self::MONDU_SEPA, self::MONDU_INSTALLMENT, self::MONDU_PAY_NOW];
2123

2224
const MAPPING = [
2325
self::MONDU_INVOICE => self::PAYMENT_MONDU_1,
2426
self::MONDU_SEPA => self::PAYMENT_MONDU_2,
25-
self::MONDU_INSTALLMENT => self::PAYMENT_MONDU_3
27+
self::MONDU_INSTALLMENT => self::PAYMENT_MONDU_3,
28+
self::MONDU_PAY_NOW => self::PAYMENT_MONDU_4,
2629
];
2730

2831
const MONDU_STATE_CONFIRMED = 'confirmed';
@@ -64,6 +67,18 @@ final class PaymentMethods extends Enum
6467
'mondu_config' => [
6568
'allowed_in_countries' => ['DE'],
6669
],
70+
],
71+
self::PAYMENT_MONDU_4 => [
72+
'name' => self::PAYMENT_MONDU_4,
73+
'description' => 'Mondu Echtzeitüberweisung – Direkt von Ihrem Bankkonto bezahlen',
74+
'action' => 'Mondu',
75+
'active' => true,
76+
'position' => 3,
77+
'template' => 'mondu_change_payment.tpl',
78+
'additionalDescription' => 'Informationen über die Verarbeitung Ihrer persönlichen Daten durch die Mondu GmbH finden Sie <a href="https://www.mondu.ai/de/datenschutzgrundverordnung-kaeufer" target="_blank">hier</a>.',
79+
'mondu_config' => [
80+
'allowed_in_countries' => ['DE'],
81+
],
6782
]
6883
];
6984

Helpers/OrderHelper.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Mond1SWR5\Helpers;
44

5+
use Enlight_Components_Db_Adapter_Pdo_Mysql;
56
use Mond1SWR5\Components\PluginConfig\Service\ConfigService;
67
use Mond1SWR5\Enum\PaymentMethods;
78
use Mond1SWR5\Services\OrderServices\AbstractOrderAdditionalCostsService;
@@ -49,14 +50,20 @@ class OrderHelper
4950
*/
5051
private $orderAdditionalCostsService;
5152

53+
/**
54+
* @var Enlight_Components_Db_Adapter_Pdo_Mysql
55+
*/
56+
protected $db;
57+
5258
public function __construct(
5359
ModelManager $modelManager,
5460
DocumentHelper $documentHelper,
5561
Logger $logger,
5662
ConfigService $configService,
5763
CartHelper $cartHelper,
5864
CustomerHelper $customerHelper,
59-
AbstractOrderAdditionalCostsService $orderAdditionalCostsService
65+
AbstractOrderAdditionalCostsService $orderAdditionalCostsService,
66+
Enlight_Components_Db_Adapter_Pdo_Mysql $db
6067
) {
6168
$this->modelManager = $modelManager;
6269
$this->documentHelper = $documentHelper;
@@ -65,6 +72,7 @@ public function __construct(
6572
$this->cartHelper = $cartHelper;
6673
$this->customerHelper = $customerHelper;
6774
$this->orderAdditionalCostsService = $orderAdditionalCostsService;
75+
$this->db = $db;
6876
}
6977

7078
public function canShipOrder($order): bool

Resources/views/backend/mondu_overview/index.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
SEPA Direct Debit
3232
{elseif $order.attribute.monduPaymentMethod eq 'installment'}
3333
Ratenzahlung
34+
{elseif $order.attribute.monduPaymentMethod eq 'pay_now'}
35+
Pay Now
3436
{else}
3537
{$order.attribute.monduPaymentMethod}
3638
{/if}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mondu/bnpl-checkout-shopware5",
33
"description": "Mondu payment method for shopware 5",
4-
"version": "2.1.5",
4+
"version": "2.2.0",
55
"license": "MIT",
66
"authors": [
77
{

plugin.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<label lang="en">Mondu Payment</label>
66
<label lang="de">Mondu Payment</label>
77

8-
<version>2.1.6</version>
8+
<version>2.2.0</version>
99
<copyright>(c) Mondu GmbH</copyright>
1010
<author>Mondu GmbH</author>
1111
<link>https://mondu.ai</link>
@@ -15,6 +15,11 @@
1515
<description lang="en">This module offers you Mondu as a checkout option</description>
1616
<description lang="de">This module offers you Mondu as a checkout option</description>
1717

18+
<changelog version="2.2.0">
19+
<changes lang="en">Added Mondu "Pay Now" payment method.</changes>
20+
<changes lang="de">Added Mondu "Pay Now" payment method.</changes>
21+
</changelog>
22+
1823
<changelog version="2.1.6">
1924
<changes lang="en">Bugfixes and improvements.</changes>
2025
<changes lang="de">Bugfixes and improvements.</changes>

0 commit comments

Comments
 (0)