From 54a7e96d9a7524af2638b1b683373ea579476c42 Mon Sep 17 00:00:00 2001 From: Makoto Mizukami Date: Wed, 31 Jul 2024 11:31:09 +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..15e5287 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 ($pm_currency != $wc_currency || isset($methods_by_slug[$slug])) { continue; } $methods_by_slug[$slug] = $payment_method;