From 87f30aa86698327f449b4c19d5b8bddddd447872 Mon Sep 17 00:00:00 2001 From: leon-zhang-awx Date: Fri, 8 Nov 2024 10:44:48 +0800 Subject: [PATCH] method_codes field default empty string not null --- Model/PaymentIntent.php | 2 +- Model/Ui/ConfigProvider.php | 3 ++- etc/db_schema.xml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Model/PaymentIntent.php b/Model/PaymentIntent.php index 1836dd7..c97ab1f 100644 --- a/Model/PaymentIntent.php +++ b/Model/PaymentIntent.php @@ -210,7 +210,7 @@ public function setDetail(string $detail): PaymentIntentInterface */ public function getMethodCodes(): string { - return $this->getData(PaymentIntentInterface::METHOD_CODES_COLUMN); + return $this->getData(PaymentIntentInterface::METHOD_CODES_COLUMN) ?? ''; } /** diff --git a/Model/Ui/ConfigProvider.php b/Model/Ui/ConfigProvider.php index d1c8a7f..7aade4e 100644 --- a/Model/Ui/ConfigProvider.php +++ b/Model/Ui/ConfigProvider.php @@ -83,7 +83,8 @@ public function __construct( private function getAvailableCurrencies() { $cacheName = 'airwallex_available_currencies'; - if (!$result = $this->cache->load($cacheName)) { + $result = $this->cache->load($cacheName); + if (empty($result) || $result === "[]") { $index = 0; $items = []; while (true) { diff --git a/etc/db_schema.xml b/etc/db_schema.xml index 3e3d88b..678b26b 100644 --- a/etc/db_schema.xml +++ b/etc/db_schema.xml @@ -14,7 +14,7 @@ - +