From 1829422d4026e190d26b1fe6793d526f4cbdfbb7 Mon Sep 17 00:00:00 2001 From: Kheuval <55691260+Kheuval@users.noreply.github.com> Date: Thu, 20 Feb 2025 16:38:04 +0100 Subject: [PATCH 1/2] [Fix] Oney provider country code --- src/Provider/OneySimulation/CachedSimulationDataProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Provider/OneySimulation/CachedSimulationDataProvider.php b/src/Provider/OneySimulation/CachedSimulationDataProvider.php index a5a63fcc..5faeac0d 100644 --- a/src/Provider/OneySimulation/CachedSimulationDataProvider.php +++ b/src/Provider/OneySimulation/CachedSimulationDataProvider.php @@ -29,7 +29,7 @@ public function __construct( public function getForCart(OrderInterface $cart): array { - $country = \explode('_', $cart->getLocaleCode() ?? 'fr_FR')[1]; + $country = strtoupper(substr($cart->getLocaleCode() ?? 'fr_FR', -2)); $cacheKey = \sprintf( 'oney_simulation_%s_%s_%s', $country, From 143f41fda64496fd505d4be8fc638be3a33445b6 Mon Sep 17 00:00:00 2001 From: Kheuval <55691260+Kheuval@users.noreply.github.com> Date: Thu, 20 Feb 2025 16:39:12 +0100 Subject: [PATCH 2/2] [Fix] Oney provider country code --- src/Provider/OneySimulation/OneySimulationDataProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Provider/OneySimulation/OneySimulationDataProvider.php b/src/Provider/OneySimulation/OneySimulationDataProvider.php index 0b0f1b9a..932c64bb 100644 --- a/src/Provider/OneySimulation/OneySimulationDataProvider.php +++ b/src/Provider/OneySimulation/OneySimulationDataProvider.php @@ -29,7 +29,7 @@ public function __construct( public function getForCart(OrderInterface $cart): array { - $country = \explode('_', $cart->getLocaleCode() ?? 'fr_FR')[1]; + $country = strtoupper(substr($cart->getLocaleCode() ?? 'fr_FR', -2)); $data = [ 'amount' => $cart->getTotal(),