Esempio n. 1
0
def sermepa_ipn(request):
    form = SermepaResponseForm(request.POST)
    if form.is_valid():
        sermepa_resp = form.save()
        if sermepa_resp.check_signature():
            if int(sermepa_resp.Ds_Response) < 100:
                payment_was_successful.send(sender=sermepa_resp)
            else:
                payment_was_error.send(sender=sermepa_resp)
        else:
            signature_error.send(sender=sermepa_resp)
    return HttpResponse()
Esempio n. 2
0
def sermepa_ipn(request):
    form = SermepaResponseForm(request.POST)
    if form.is_valid():
        sermepa_resp = form.save()
        if sermepa_resp.check_signature():
            if int(sermepa_resp.Ds_Response) < 100:
                payment_was_successful.send(sender=sermepa_resp)
            else:
                payment_was_error.send(sender=sermepa_resp)
        else:
            signature_error.send(sender=sermepa_resp)
    return HttpResponse()
Esempio n. 3
0
def sermepa_ipn(request):
    form = SermepaResponseForm(request.POST)
    if form.is_valid():
        sermepa_resp = form.save()
        if sermepa_resp.check_signature():
            if int(sermepa_resp.Ds_Response) < 100:
                payment_was_successful.send(sender=sermepa_resp)  # signal
            elif sermepa_resp.Ds_Response == "0900" and sermepa_resp.Ds_TransactionType == OPER_REFUND:
                refund_was_successful.send(sender=sermepa_resp)  # signal
            else:
                payment_was_error.send(sender=sermepa_resp)  # signal
        else:
            signature_error.send(sender=sermepa_resp)  # signal

    return HttpResponse()
Esempio n. 4
0
def sermepa_ipn(request):
    form = SermepaResponseForm(request.POST)
    if form.is_valid():
        sermepa_resp = form.save()
        if sermepa_resp.check_signature():
            if int(sermepa_resp.Ds_Response) < 100:
                payment_was_successful(sender=sermepa_resp)  #signal
            elif sermepa_resp.Ds_Response == '0900' and\
                 sermepa_resp.Ds_TransactionType==OPER_REFUND:
                refund_was_successful.send(sender=sermepa_resp)  #signal
            else:
                payment_was_error(sender=sermepa_resp)  #signal
        else:
            signature_error.send(sender=sermepa_resp)  #signal

    return HttpResponse()