Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
Django-paypal works in IPN simulator but not in sandbox

I have written an IPN following the django-paypal IPN tutorial, however mine does not seem to work. It works no problem on the PayPal IPN Simulator, and I receive the IPN and the code executes, however when I try to do it in Sandbox mode, the payment goes through by no response.

Views:

from django.core.urlresolvers import reverse
from django.shortcuts import render
from paypal.standard.forms import PayPalPaymentsForm

def view_that_asks_for_money(request):

    # What you want the button to do.
    paypal_dict = {
        "business": "receiver_email@example.com",
        "amount": "100.00",
        "item_name": "Product",
        "invoice": "100",
        "notify_url": "http://myip/paypal/",
        "return_url": "https://www.example.com/your-return-location/",
        "cancel_return": "https://www.example.com/your-cancel-location/",
        "custom": "Upgrade all users!",  # Custom command to correlate to some function later (optional)
    }

    # Create the instance.
    form = PayPalPaymentsForm(initial=paypal_dict)
    context = {"form": form}
    return render(request, "payment.html", context)

from paypal.standard.models import ST_PP_COMPLETED
from paypal.standard.ipn.signals import valid_ipn_received

def show_me_the_money(sender, **kwargs):
    ipn_obj = sender
    category = Category(name="Got IPN")
    category.save()
    if ipn_obj.payment_status == ST_PP_COMPLETED:
        category = Category(name="Good Buzz, complete")
        category.save()
    else:
        category = Category(name="Bad Buzz, not complete")
        category.save()


valid_ipn_received.connect(show_me_the_money)
invalid_ipn_received.connect(show_me_the_money)

URLS:

etc etc etc...
    url(r'^paypal/', include('paypal.standard.ipn.urls')),
    url(r'^test/$', views.view_that_asks_for_money, name='ask')
]

When I send my IPN to : http://myip/paypal/ it works but not through sandbox.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda