protected function getPaymentAccountNumber(PaymentMethodInterface $method, string $origin)
    {
        foreach ($this->accounts as $account) {
            if ($account->getType() !== AccountingTypes::TYPE_PAYMENT) {
                continue;
            }

            if ($account->getPaymentMethod() !== $method) {
                continue;
            }

            return $account->getNumber();
        }

        throw new LogicException(sprintf(
            "No payment account number configured for payment method '%s' (%s)",
            $method->getName(),
            $origin
        ));
    }