Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Rename folder to keep module naming consistency

Mira Szewczykb233ecb293dc
diff --git a/saleor/dashboard/payments/__init__.py b/saleor/dashboard/payment/__init__.py
similarity index 100%
rename from saleor/dashboard/payments/__init__.py
rename to saleor/dashboard/payment/__init__.py
diff --git a/saleor/dashboard/payment/urls.py b/saleor/dashboard/payment/urls.py
new file mode 100644
index 0000000000..b6dab5336c
--- /dev/null
+++ b/saleor/dashboard/payment/urls.py
@@ -0,0 +1,12 @@
+from django.conf.urls import url
+
+from . import views
+
+urlpatterns = [
+ url(r"^$", views.index, name="payments-index"),
+ url(
+ r"^configure/(?P<plugin_name>[\w-]+)$",
+ views.configure_payment_gateway,
+ name="configure-payment",
+ ),
+]
diff --git a/saleor/dashboard/payments/urls.py b/saleor/dashboard/payments/urls.py
deleted file mode 100644
index e9ab2cad34..0000000000
--- a/saleor/dashboard/payments/urls.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from django.conf.urls import url
-
-from . import views
-
-urlpatterns = [url(r"^$", views.index, name="payments-index")]
diff --git a/saleor/dashboard/payments/views.py b/saleor/dashboard/payments/views.py
deleted file mode 100644
index ed2245396f..0000000000
--- a/saleor/dashboard/payments/views.py
+++ /dev/null
@@ -1,29 +0,0 @@
-from typing import TYPE_CHECKING
-
-from django.contrib.auth.decorators import permission_required
-from django.template.response import TemplateResponse
-
-from ...payment.gateways.braintree.plugin import BraintreeGatewayPlugin
-from ...payment.gateways.dummy.plugin import DummyGatewayPlugin
-from ...payment.gateways.razorpay.plugin import RazorpayGatewayPlugin
-from ...payment.gateways.stripe.plugin import StripeGatewayPlugin
-from ..views import staff_member_required
-
-if TYPE_CHECKING:
- from django.http import HttpRequest
-
-GATEWAYS_PLUGINS = [
- BraintreeGatewayPlugin,
- DummyGatewayPlugin,
- RazorpayGatewayPlugin,
- StripeGatewayPlugin,
-]
-
-
-@staff_member_required
-@permission_required("extensions.manage_plugins")
-def index(request: "HttpRequest") -> TemplateResponse:
- payment_gateways = [gateway.PLUGIN_NAME for gateway in GATEWAYS_PLUGINS]
-
- ctx = {"payment_gateways": payment_gateways}
- return TemplateResponse(request, "dashboard/payments/index.html", ctx)
diff --git a/saleor/dashboard/urls.py b/saleor/dashboard/urls.py
index 7e7e7400ef..fe09c22205 100644
--- a/saleor/dashboard/urls.py
+++ b/saleor/dashboard/urls.py
@@ -8,7 +8,7 @@ from .discount.urls import urlpatterns as discount_urls
from .menu.urls import urlpatterns as menu_urls
from .order.urls import urlpatterns as order_urls
from .page.urls import urlpatterns as page_urls
-from .payments.urls import urlpatterns as payments_urls
+from .payment.urls import urlpatterns as payments_urls
from .product.urls import urlpatterns as product_urls
from .search.urls import urlpatterns as search_urls
from .shipping.urls import urlpatterns as shipping_urls