Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Examine currency before recognizing as an available payment method
Browse files Browse the repository at this point in the history
makotom committed Jul 31, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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
@@ -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;

0 comments on commit d506b55

Please sign in to comment.