Search code examples
djangopaypalpaypal-ipnngrokdjango-paypal

Paypal Sandbox not sending IPN back to django through ngrok tunnel, but works fine on IPN Simulator


I have a django app that uses django-paypal to manage payments and trigger certain actions using signals.py when the payment is received

@receiver(valid_ipn_received)
def payment_notification(sender, **kwargs):
    ipn = sender
    if ipn.payment_status == 'Completed':
        # payment was successful, do something

In order to test it locally, I'm using ngrok to expose the local server to Paypal services. enter image description here Using the IPN Simulator everything is working fine and the signal in the django platform is triggered. However, when I interact with the sandbox under the same conditions, I am not receiving the IPN back from Payal after the payment is completed. From the sandbox business account dashboard I can see the payment is received, but looking at the IPN History from the same account I notice that Paypal is not able to send the IPN, claiming a "failed operation" without further information (not even an error code from the server). "Non riuscito" means "Failed" in italian The strangest thing is that the sandbox flow was working like a charm until two days ago. Now I am only able to test through the IPN Simulator. What am I doing wrong?


Solution

  • While not exactly a technical solution, I think its worth keeping track of how this problem was solved. Turned out there was a bug on the Paypal side, so as Patryk Szczepański suggested in the comments, what worked here was contacting Paypal technical support. They solved the problem in a matter of hours.