27 lines
886 B
Python
27 lines
886 B
Python
from django.urls import include, path
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
from .views import (
|
|
BillingPlanViewSet,
|
|
InvoiceViewSet,
|
|
PaymentGatewayViewSet,
|
|
PaymentTransactionViewSet,
|
|
SubscriptionViewSet,
|
|
WebhookViewSet,
|
|
)
|
|
|
|
router = DefaultRouter()
|
|
router.register(r"gateways", PaymentGatewayViewSet, basename="billing-gateways")
|
|
router.register(r"plans", BillingPlanViewSet, basename="billing-plans")
|
|
router.register(r"subscriptions", SubscriptionViewSet, basename="billing-subscriptions")
|
|
router.register(r"invoices", InvoiceViewSet, basename="billing-invoices")
|
|
router.register(r"transactions", PaymentTransactionViewSet, basename="billing-transactions")
|
|
|
|
urlpatterns = [
|
|
path("", include(router.urls)),
|
|
path(
|
|
"webhook/receive/",
|
|
WebhookViewSet.as_view({"post": "receive"}),
|
|
name="billing-webhook-receive",
|
|
),
|
|
]
|