diff --git a/payments/core.py b/payments/core.py index fb3be853e..4995077f0 100644 --- a/payments/core.py +++ b/payments/core.py @@ -1,5 +1,4 @@ import re -from importlib import import_module from typing import TYPE_CHECKING from typing import Dict from typing import Optional @@ -155,9 +154,7 @@ def _default_provider_factory(variant: str, payment: Optional["BasePayment"] = N if not handler: raise ValueError(f"Payment variant does not exist: {variant}") if variant not in PROVIDER_CACHE: - module_path, class_name = handler.rsplit(".", 1) - module = import_module(module_path) - class_ = getattr(module, class_name) + class_ = import_string(handler) PROVIDER_CACHE[variant] = class_(**config) return PROVIDER_CACHE[variant]