# pylint: disable= E0632
from django.urls import path

from ocyan.main.loading import get_ocyan_classes

from .constants import APP_CODE

MolliePaymentView, WebhookView, MollieCallbackView = get_ocyan_classes(
    "payment_mollie.views", ["MolliePaymentView", "WebhookView", "MollieCallbackView"]
)

app_name = APP_CODE
urlpatterns = [
    path("payment/mollie/kbc/", MolliePaymentView.as_view(method="kbc"), name="kbc"),
    path(
        "payment/mollie/ideal/", MolliePaymentView.as_view(method="ideal"), name="ideal"
    ),
    path(
        "payment/mollie/paypal/",
        MolliePaymentView.as_view(method="paypal"),
        name="paypal",
    ),
    path(
        "payment/mollie/sofort/",
        MolliePaymentView.as_view(method="sofort"),
        name="sofort",
    ),
    path(
        "payment/mollie/belfius/",
        MolliePaymentView.as_view(method="belfius"),
        name="belfius",
    ),
    path(
        "payment/mollie/bitcoin/",
        MolliePaymentView.as_view(method="bitcoin"),
        name="bitcoin",
    ),
    path(
        "payment/mollie/giftcard/",
        MolliePaymentView.as_view(method="giftcard"),
        name="giftcard",
    ),
    path(
        "payment/mollie/inghomepay/",
        MolliePaymentView.as_view(method="inghomepay"),
        name="inghomepay",
    ),
    path(
        "payment/mollie/creditcard/",
        MolliePaymentView.as_view(method="creditcard"),
        name="creditcard",
    ),
    path(
        "payment/mollie/mistercash/",
        MolliePaymentView.as_view(method="bancontact"),
        name="mistercash",
    ),
    path(
        "payment/mollie/banktransfer/",
        MolliePaymentView.as_view(method="banktransfer"),
        name="banktransfer",
    ),
    path("payment/mollie/eps/", MolliePaymentView.as_view(method="eps"), name="eps"),
    path(
        "payment/mollie/directdebit/",
        MolliePaymentView.as_view(method="directdebit"),
        name="directdebit",
    ),
    path(
        "payment/mollie/bancontact/",
        MolliePaymentView.as_view(method="bancontact"),
        name="bancontact",
    ),
    path(
        "payment/mollie/klarna",
        MolliePaymentView.as_view(method="klarna"),
        name="klarna",
    ),
    path(
        "payment/mollie/klarnapaylater",
        MolliePaymentView.as_view(method="klarnapaylater"),
        name="klarnapaylater",
    ),
    path(
        "payment/mollie/klarnapaynow",
        MolliePaymentView.as_view(method="klarnapaynow"),
        name="klarnapaynow",
    ),
    path(
        "payment/mollie/klarnasliceit",
        MolliePaymentView.as_view(method="klarnasliceit"),
        name="klarnasliceit",
    ),
    path(
        "payment/mollie/przelewy24",
        MolliePaymentView.as_view(method="przelewy24"),
        name="przelewy24",
    ),
    # Handle a Mollie callback (from a payment) to redirect to the right view.
    path(
        "payment/mollie/callback/<oidb64>/<token>/",
        MollieCallbackView.as_view(),
        name="mollie_callback",
    ),
    # Handle a Mollie payment status change.
    path("webhook/", WebhookView.as_view(), name="webhook"),
]
