Package: chargily-epay-Django
epay-gateway-djangoChargily ePay Gateway (Django Package)Documentationyou can find more aboutHereThis Plugin is to integrate ePayment gateway with Chargily easily.Currently support payment byCIB / EDAHABIAcards and soon byVisa / MastercardThis repo is recently created forDjango plugin, If you are a developer and want to collaborate to the development of this plugin, you are welcomed!Installationpipinstallchargily-epay-DjangoCreate Payment modelto create a payment model you need to extend one of the following classesAbstractPayment,AnonymPayment,AnonymPayment.fromchargily_epay_django.modelsimportAnonymPaymentclassPayment(AnonymPayment):webhook_url='payment-confirmation'# reverse urlback_url='payment-status'# reverse urlCreatePaymentViewyou can create a new Payment usingCreatePaymentView, this class extends fromCreateView# views.pyfromdjango.formsimportModelFormfromchargily_epay_django.viewsimportCreatePaymentViewfrommy_app.modelsimportPaymentclassPaymentForm(ModelForm):classMeta:model=Paymentfields=['client','client_email','amount','mode','comment']classCreatePayment(CreatePaymentView):template_name:str="payment/payment-template.html"form_class=PaymentFormExamplePaymentConfirmationViewif you want to confirme payment you can usePaymentConfirmationViewview, this view responsable for reciving payment confirmation from third party.# views.py# .....fromchargily_epay_django.viewsimportCreatePaymentView,PaymentConfirmationView# .....classPaymentConfirmation(PaymentConfirmationView):model=PaymentPaymentObjectStatusView, Or PaymentObjectDoneViewto check payment status you can usePaymentObjectStatusView, OrPaymentObjectDoneViewcheck the doc to see dirence# views.py# .....fromchargily_epay_django.viewsimportCreatePaymentView,PaymentConfirmationView,PaymentObjectDoneView# .....classPaymentStatus(PaymentObjectDoneView):template_name:str="payment/payment-status.html"model=PaymentExampleFakePaymentif you are working inDevlopmentmode you can useFakePaymentViewall you need to do is to create a view and extend this class and addFakePaymentMixin, toPaymentmodel# models.pyfromchargily_epay_django.modelsimportAnonymPayment,FakePaymentMixinclassPayment(FakePaymentMixin,AnonymPayment):webhook_url='payment-confirmation'# reverse urlback_url='payment-status'# reverse urlfake_payment_url="fake-payment"# reverse url# viewfromchargily_epay_django.viewsimport(CreatePaymentView,PaymentConfirmationView,PaymentObjectDoneView,FakePaymentView)classFakePayment(FakePaymentView):model=PaymentExampleResultwe now canCREATE,UPDATEandREADpayment using this few lines of code.Note: you still have to configure settings, and urls.py# models.pyfromchargily_epay_django.modelsimportAnonymPayment,FakePaymentMixinclassPayment(FakePaymentMixin,AnonymPayment):webhook_url='payment-confirmation'# reverse urlback_url='payment-status'# reverse urlfake_payment_url="fake-payment"# reverse url# views.pyfromdjango.formsimportModelFormfromchargily_epay_django.viewsimport(CreatePaymentView,PaymentConfirmationView,PaymentObjectDoneView,FakePaymentView)frommy_app.modelsimportPayment# FORMclassPaymentForm(ModelForm):classMeta:model=Paymentfields=['client','client_email','amount','mode','comment']# VIEWSclassCreatePayment(CreatePaymentView):template_name:str="payment/payment-template.html"form_class=PaymentFormclassPaymentConfirmation(PaymentConfirmationView):model=PaymentclassPaymentStatus(PaymentObjectDoneView):template_name:str="payment/payment-status.html"model=PaymentclassFakePayment(FakePaymentView):model=PaymentExamplecheck this examplesponsor siteContribution tipsMake a fork of this repo.Take a tour to ourAPI documentation hereGet your API Key/Secret fromePay by Chargilydashboard for free.Start developing.Finished? Push and merge.