This commit is contained in:
2025-11-04 02:16:17 +01:00
parent 8dd4f6e731
commit 47b9770a70
5 changed files with 402 additions and 261 deletions

View File

@@ -1,20 +1,11 @@
from django.urls import path
from .views import (
GoPayPaymentView,
GoPayPaymentStatusView,
GoPayRefundPaymentView,
GoPayCaptureAuthorizationView,
GoPayVoidAuthorizationView,
GoPayCreateRecurrenceView,
GoPayPaymentInstrumentsView,
)
from .views import PaymentStatusView, PaymentRefundListView, GoPayWebhookView
urlpatterns = [
path('payment/', GoPayPaymentView.as_view(), name='gopay-payment'),
path('payment/<int:payment_id>/status/', GoPayPaymentStatusView.as_view(), name='gopay-payment-status'),
path('payment/<int:payment_id>/refund/', GoPayRefundPaymentView.as_view(), name='gopay-refund-payment'),
path('payment/<int:payment_id>/capture/', GoPayCaptureAuthorizationView.as_view(), name='gopay-capture-authorization'),
path('payment/<int:payment_id>/void/', GoPayVoidAuthorizationView.as_view(), name='gopay-void-authorization'),
path('payment/<int:payment_id>/recurrence/', GoPayCreateRecurrenceView.as_view(), name='gopay-create-recurrence'),
path('payment-instruments/', GoPayPaymentInstrumentsView.as_view(), name='gopay-payment-instruments'),
]
# Dotaz na stav platby (GET)
path('api/payments/payment/<int:pk>', PaymentStatusView.as_view(), name='gopay-payment-status'),
# Historie refundací (GET)
path('api/payments/payment/<int:pk>/refunds', PaymentRefundListView.as_view(), name='gopay-payment-refunds'),
# Webhook od GoPay (HTTP GET s ?id=...)
path('api/payments/gopay/webhook', GoPayWebhookView.as_view(), name='gopay-webhook'),
]