From 856cc6145db43f9f152d281de81a1e87b16047e9 Mon Sep 17 00:00:00 2001 From: "duck." Date: Thu, 8 May 2025 09:54:18 +0100 Subject: [PATCH] Octopus: fix tariff payment method API presumption (#21114) --- tariff/octopus.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tariff/octopus.go b/tariff/octopus.go index e5ffc0a97..93622812d 100644 --- a/tariff/octopus.go +++ b/tariff/octopus.go @@ -129,7 +129,11 @@ func (t *Octopus) run(done chan error) { data := make(api.Rates, 0, len(res.Results)) for _, r := range res.Results { - if t.paymentMethod != "" && r.PaymentMethod != t.paymentMethod { + // This checks whether: + // - a Payment Method is set on the Result + // - a Payment Method filter is set + // - the Payment Method in the Result matches the Payment Method filter + if r.PaymentMethod != "" && t.paymentMethod != "" && r.PaymentMethod != t.paymentMethod { // A Payment Method filter is set, and this Tariff entry does not match our filter. continue }