Skip to content

Commit 4cc5521

Browse files
authored
2.1.1-release (#2)
1 parent d0697b1 commit 4cc5521

File tree

8 files changed

+34
-16
lines changed

8 files changed

+34
-16
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
/vendor/
33

44
/mondu-logs
5-
.env
6-
.idea
5+
.env

Components/PluginConfig/Service/ConfigService.php

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
class ConfigService {
1515
const API_URL = 'https://api.mondu.ai/api/v1';
1616
const WIDGET_URL = 'https://checkout.mondu.ai/widget.js';
17-
1817
const SANDBOX_API_URL = 'https://api.demo.mondu.ai/api/v1';
1918
const SANDBOX_WIDGET_URL = 'https://checkout.demo.mondu.ai/widget.js';
2019

Services/SessionService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private function reserveOrderNumber() {
4444
if($this->session->offsetExists('sOrderVariables')) {
4545
$variables = $this->session->offsetGet('sOrderVariables');
4646
if(empty($variables['sOrderNumber'])) {
47-
$orderNumber = substr(md5(mt_rand()), 0, 7);
47+
$orderNumber = uniqid('M_SW5_');
4848
$variables['sOrderNumber'] = $orderNumber;
4949
$this->session->offsetSet('sOrderVariables', $variables);
5050
}

Services/Webhook/Handlers/OrderConfirmed.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ public function getEventType()
3030
public function invoke(Webhook $webhook)
3131
{
3232
$this->paymentStatusService->updatePaymentStatus(
33-
$webhook->getExternalReferenceId(),
33+
$webhook->getOrderUid(),
34+
Status::ORDER_STATE_IN_PROCESS,
35+
Status::GROUP_STATE
36+
);
37+
$this->paymentStatusService->updatePaymentStatus(
38+
$webhook->getOrderUid(),
3439
Status::PAYMENT_STATE_COMPLETELY_PAID,
3540
Status::GROUP_PAYMENT,
3641
$webhook->getOrderState()

Services/Webhook/Handlers/OrderDeclined.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ public function getEventType()
2626
*/
2727
public function invoke(Webhook $webhook)
2828
{
29-
$this->paymentStatusService->updatePaymentStatus(
30-
$webhook->getExternalReferenceId(),
31-
Status::ORDER_STATE_CANCELLED_REJECTED,
32-
Status::GROUP_STATE,
33-
$webhook->getOrderState()
34-
);
29+
if (!$webhook->isTemporaryExternalReferenceId()) {
30+
$this->paymentStatusService->updatePaymentStatus(
31+
$webhook->getOrderUid(),
32+
Status::ORDER_STATE_CANCELLED_REJECTED,
33+
Status::GROUP_STATE,
34+
$webhook->getOrderState()
35+
);
36+
}
3537
}
3638
}

Services/Webhook/Handlers/OrderPending.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ public function getEventType()
3131
public function invoke(Webhook $webhook)
3232
{
3333
$this->paymentStatusService->updatePaymentStatus(
34-
$webhook->getExternalReferenceId(),
34+
$webhook->getOrderUid(),
3535
Status::ORDER_STATE_IN_PROCESS,
3636
Status::GROUP_STATE
3737
);
3838
$this->paymentStatusService->updatePaymentStatus(
39-
$webhook->getExternalReferenceId(),
39+
$webhook->getOrderUid(),
4040
Status::PAYMENT_STATE_REVIEW_NECESSARY,
4141
Status::GROUP_PAYMENT,
4242
$webhook->getOrderState()

Services/Webhook/WebhookStruct.php

+8
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ public function setResource($resource)
147147
$this->resource = $resource;
148148
}
149149

150+
/**
151+
* @return bool
152+
*/
153+
public function isTemporaryExternalReferenceId(): bool
154+
{
155+
return str_starts_with($this->getExternalReferenceId(), 'M_SW5');
156+
}
157+
150158
/**
151159
* @return WebhookStruct
152160
*/

plugin.xml

+8-3
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.0</version>
8+
<version>2.1.1</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.1.1">
19+
<changes lang="en">Bugfixes and improvements</changes>
20+
<changes lang="de">Bugfixes and improvements</changes>
21+
</changelog>
22+
1823
<changelog version="2.1.0">
1924
<changes lang="en">Changes for pending Mondu state</changes>
2025
<changes lang="de">Changes for pending Mondu state</changes>
@@ -25,8 +30,8 @@
2530
<changes lang="de">Bugfixes and improvements</changes>
2631
</changelog>
2732
<changelog version="2.0.2">
28-
<changes lang="en">Allow merchants to use custom documents for invoice</changes>
29-
<changes lang="de">Allow merchants to use custom documents for invoice</changes>
33+
<changes lang="en">Allow merchants to use custom documents for ivoice</changes>
34+
<changes lang="de">Allow merchants to use custom documents for ivoice</changes>
3035
</changelog>
3136
<changelog version="2.0.1">
3237
<changes lang="en">Non existent service bugfix</changes>

0 commit comments

Comments
 (0)