Skip to content

Commit

Permalink
Examine currency before recognizing as an available payment method
Browse files Browse the repository at this point in the history
  • Loading branch information
makotom committed Jul 31, 2024
1 parent f93a6a8 commit d506b55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions class-wc-settings-page-komoju.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d506b55

Please sign in to comment.