Skip to content

Commit 790eee5

Browse files
committed
🐛 Mollie provider in multilanguage setup, thanks @samzzi
closes #2
1 parent 530cd65 commit 790eee5

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

classes/Kart/Provider/Mollie.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ public function checkout(): string
6262
}
6363
}
6464

65+
$locale = $this->kirby->multilang() ? $this->kirby->language()?->locale() : null;
66+
if (is_array($locale)) {
67+
$locale = $locale[0];
68+
}
69+
if (is_null($locale)) {
70+
$locale = kart()->option('locale', 'en_EN');
71+
}
72+
6573
// https://docs.mollie.com/reference/create-payment
6674
$remote = Remote::post('https://api.mollie.com/v2/payments', [
6775
'headers' => [
@@ -73,7 +81,7 @@ public function checkout(): string
7381
'metadata' => [
7482
'order_id' => $uuid,
7583
],
76-
'locale' => $this->kirby->language()?->locale(),
84+
'locale' => strval($locale),
7785
'method' => ['applepay', 'creditcard', 'paypal', 'twint'],
7886
'customerId' => $customerId,
7987
'redirectUrl' => url(Router::PROVIDER_SUCCESS).'?session_id='.urlencode($uuid),

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bnomei/kirby-kart",
33
"type": "kirby-plugin",
4-
"version": "5.1.0",
4+
"version": "5.1.1",
55
"description": "Streamlined E-Commerce Shopping Cart Solution",
66
"license": "proprietary",
77
"authors": [

vendor/composer/installed.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php return array(
22
'root' => array(
33
'name' => 'bnomei/kirby-kart',
4-
'pretty_version' => '5.1.0',
5-
'version' => '5.1.0.0',
4+
'pretty_version' => '5.1.1',
5+
'version' => '5.1.1.0',
66
'reference' => null,
77
'type' => 'kirby-plugin',
88
'install_path' => __DIR__ . '/../../',
@@ -11,8 +11,8 @@
1111
),
1212
'versions' => array(
1313
'bnomei/kirby-kart' => array(
14-
'pretty_version' => '5.1.0',
15-
'version' => '5.1.0.0',
14+
'pretty_version' => '5.1.1',
15+
'version' => '5.1.1.0',
1616
'reference' => null,
1717
'type' => 'kirby-plugin',
1818
'install_path' => __DIR__ . '/../../',

0 commit comments

Comments
 (0)