From 196369d950e4421fd9e397f3281e35a61fddb2fd Mon Sep 17 00:00:00 2001 From: Makoto Mizukami Date: Wed, 31 Jul 2024 13:18:55 +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..a515b8d 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 (isset($methods_by_slug[$slug]) && $pm_currency !== $wc_currency) { continue; } $methods_by_slug[$slug] = $payment_method;