Search code examples
c#paypalpaypal-ipn

C# paypal IPN communication


I've set up the IPN to communicate with my website within Paypal, but for some reason paypal does not seem to call it. Below is the method that is listening, but its does not seem to get anything.

Could someone please point me in the write direction?

Thanks

[HttpPost]
    public void paypalipn(string receiver_email, string receiver_id, string test_ipn, string txn_id, string payer_id, string payer_status, string payment_date, string payment_status, string payment_type)
    {
        string subject = "Audit - Paypal IPN ";
        string buildemail = "receiver_email: " + receiver_email;
        buildemail += "receiver_id: "+receiver_id;
        buildemail += "<br>test_ipn: "+test_ipn;
        buildemail += "<br>txn_id: " + txn_id;
        buildemail += "<br>payer_id: " + payer_id;
        buildemail += "<br>payer_status: " + payer_status;
        buildemail += "<br>payment_date: " + payment_date;
        buildemail += "<br>payment_status: " + payment_status;
        buildemail += "<br>payment_type: " + payment_type;

        Libraries.Email.Product.SendAudit(subject, buildemail);



    }

Solution

  • If you are setting your IPN in your PayPal account, make sure that it is enabled and that the URL is correct. Also, if you are setting it in your account you can check your IPN history to see if the IPN POSTs are being sent out. They will either be marked as sent, retrying, or failed. If they are in a failed or retrying status you can click the message and if your server is sending back any error code it should be listed here. Also, check your error logs on your server to make sure the script is not erroring out.