# views.py
from django.forms import ModelForm
from chargily_epay_django.views import (
CreatePaymentView,
PaymentConfirmationView,
PaymentObjectDoneView,
FakePaymentView
)
from my_app.models import Payment
# FORM
class PaymentForm(ModelForm):
class Meta:
model = Payment
fields = ['client', 'client_email', 'amount', 'mode', 'comment']
# VIEWS
class CreatePayment(CreatePaymentView):
template_name: str = "payment/payment-template.html"
form_class = PaymentForm
class PaymentConfirmation(PaymentConfirmationView):
model = Payment
class PaymentStatus(PaymentObjectDoneView):
template_name: str = "payment/payment-status.html"
model = Payment
class FakePayment(FakePaymentView):
model = Payment