mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Invoice is sent iif payment is Ok
This commit is contained in:
parent
9fbf17004a
commit
7c35571237
2 changed files with 3 additions and 2 deletions
|
@ -38,6 +38,7 @@ from cotisations.models import Facture
|
||||||
from .comnpay import Transaction
|
from .comnpay import Transaction
|
||||||
from .models import ComnpayPayment
|
from .models import ComnpayPayment
|
||||||
|
|
||||||
|
from cotisations.utils import send_mail_invoice
|
||||||
|
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
@login_required
|
@login_required
|
||||||
|
@ -133,6 +134,8 @@ def ipn(request):
|
||||||
facture.valid = True
|
facture.valid = True
|
||||||
facture.save()
|
facture.save()
|
||||||
|
|
||||||
|
send_mail_invoice(facture)
|
||||||
|
|
||||||
# Everything worked we send a reponse to Comnpay indicating that
|
# Everything worked we send a reponse to Comnpay indicating that
|
||||||
# it's ok for them to proceed
|
# it's ok for them to proceed
|
||||||
return HttpResponse("HTTP/1.0 200 OK")
|
return HttpResponse("HTTP/1.0 200 OK")
|
||||||
|
|
|
@ -148,8 +148,6 @@ def new_facture(request, user, userid):
|
||||||
p.facture = new_invoice_instance
|
p.facture = new_invoice_instance
|
||||||
p.save()
|
p.save()
|
||||||
|
|
||||||
send_mail_invoice(new_invoice_instance)
|
|
||||||
|
|
||||||
return new_invoice_instance.paiement.end_payment(
|
return new_invoice_instance.paiement.end_payment(
|
||||||
new_invoice_instance,
|
new_invoice_instance,
|
||||||
request
|
request
|
||||||
|
|
Loading…
Reference in a new issue