Commit 4cc5521 1 parent d0697b1 commit 4cc5521 Copy full SHA for 4cc5521
File tree 8 files changed +34
-16
lines changed
Components/PluginConfig/Service
8 files changed +34
-16
lines changed Original file line number Diff line number Diff line change 2
2
/vendor /
3
3
4
4
/mondu-logs
5
- .env
6
- .idea
5
+ .env
Original file line number Diff line number Diff line change 14
14
class ConfigService {
15
15
const API_URL = 'https://api.mondu.ai/api/v1 ' ;
16
16
const WIDGET_URL = 'https://checkout.mondu.ai/widget.js ' ;
17
-
18
17
const SANDBOX_API_URL = 'https://api.demo.mondu.ai/api/v1 ' ;
19
18
const SANDBOX_WIDGET_URL = 'https://checkout.demo.mondu.ai/widget.js ' ;
20
19
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ private function reserveOrderNumber() {
44
44
if ($ this ->session ->offsetExists ('sOrderVariables ' )) {
45
45
$ variables = $ this ->session ->offsetGet ('sOrderVariables ' );
46
46
if (empty ($ variables ['sOrderNumber ' ])) {
47
- $ orderNumber = substr ( md5 ( mt_rand ()), 0 , 7 );
47
+ $ orderNumber = uniqid ( ' M_SW5_ ' );
48
48
$ variables ['sOrderNumber ' ] = $ orderNumber ;
49
49
$ this ->session ->offsetSet ('sOrderVariables ' , $ variables );
50
50
}
Original file line number Diff line number Diff line change @@ -30,7 +30,12 @@ public function getEventType()
30
30
public function invoke (Webhook $ webhook )
31
31
{
32
32
$ 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 (),
34
39
Status::PAYMENT_STATE_COMPLETELY_PAID ,
35
40
Status::GROUP_PAYMENT ,
36
41
$ webhook ->getOrderState ()
Original file line number Diff line number Diff line change @@ -26,11 +26,13 @@ public function getEventType()
26
26
*/
27
27
public function invoke (Webhook $ webhook )
28
28
{
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
+ }
35
37
}
36
38
}
Original file line number Diff line number Diff line change @@ -31,12 +31,12 @@ public function getEventType()
31
31
public function invoke (Webhook $ webhook )
32
32
{
33
33
$ this ->paymentStatusService ->updatePaymentStatus (
34
- $ webhook ->getExternalReferenceId (),
34
+ $ webhook ->getOrderUid (),
35
35
Status::ORDER_STATE_IN_PROCESS ,
36
36
Status::GROUP_STATE
37
37
);
38
38
$ this ->paymentStatusService ->updatePaymentStatus (
39
- $ webhook ->getExternalReferenceId (),
39
+ $ webhook ->getOrderUid (),
40
40
Status::PAYMENT_STATE_REVIEW_NECESSARY ,
41
41
Status::GROUP_PAYMENT ,
42
42
$ webhook ->getOrderState ()
Original file line number Diff line number Diff line change @@ -147,6 +147,14 @@ public function setResource($resource)
147
147
$ this ->resource = $ resource ;
148
148
}
149
149
150
+ /**
151
+ * @return bool
152
+ */
153
+ public function isTemporaryExternalReferenceId (): bool
154
+ {
155
+ return str_starts_with ($ this ->getExternalReferenceId (), 'M_SW5 ' );
156
+ }
157
+
150
158
/**
151
159
* @return WebhookStruct
152
160
*/
Original file line number Diff line number Diff line change 5
5
<label lang =" en" >Mondu Payment</label >
6
6
<label lang =" de" >Mondu Payment</label >
7
7
8
- <version >2.1.0 </version >
8
+ <version >2.1.1 </version >
9
9
<copyright >(c) Mondu GmbH</copyright >
10
10
<author >Mondu GmbH</author >
11
11
<link >https://mondu.ai</link >
15
15
<description lang =" en" >This module offers you Mondu as a checkout option</description >
16
16
<description lang =" de" >This module offers you Mondu as a checkout option</description >
17
17
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
+
18
23
<changelog version =" 2.1.0" >
19
24
<changes lang =" en" >Changes for pending Mondu state</changes >
20
25
<changes lang =" de" >Changes for pending Mondu state</changes >
25
30
<changes lang =" de" >Bugfixes and improvements</changes >
26
31
</changelog >
27
32
<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 >
30
35
</changelog >
31
36
<changelog version =" 2.0.1" >
32
37
<changes lang =" en" >Non existent service bugfix</changes >
You can’t perform that action at this time.
0 commit comments