From d506b5538f541f95c8c9f058fb13a8ebcc7e7175 Mon Sep 17 00:00:00 2001 From: Makoto Mizukami Date: Wed, 31 Jul 2024 12:47:20 +0900 Subject: [PATCH] Examine currency before recognizing as an available payment method --- class-wc-settings-page-komoju.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/class-wc-settings-page-komoju.php b/class-wc-settings-page-komoju.php index 75bf211..9922bb1 100644 --- a/class-wc-settings-page-komoju.php +++ b/class-wc-settings-page-komoju.php @@ -365,10 +365,12 @@ private function fetch_all_payment_methods() try { $all_payment_methods = $api->paymentMethods(); $methods_by_slug = []; + $wc_currency = get_woocommerce_currency(); foreach ($all_payment_methods as $payment_method) { - $slug = $payment_method['type_slug']; - if (isset($methods_by_slug[$slug])) { + $slug = $payment_method['type_slug']; + $pm_currency = $payment_method['currency']; + if ((!empty($wc_currency) && $pm_currency != $wc_currency) || isset($methods_by_slug[$slug])) { continue; } $methods_by_slug[$slug] = $payment_method;