PayPal isn't sending IPN to my handler? - paypal

I have an IPN handler, but it seems it isn't getting any IPN's from PayPal. When I hit the subscribe button, my payment goes through, but my IPN handler doesn't get any requests.
I tried invoking via Firebug's javascript console by
$.post('http://mysite.com/ipn', {'foo': 'bar'})
and I can see in my logs that the request is received (although my handler fails, as expected).

Debugging IPN is hard unless you follow the rules:
Check that the IPN URL domain resolves correctly to an external IP
Ensure that the URL is accessible from outside of your local network
Do not expect to use echo or print for debug - log everything to a file.
Create a "sandbox" account for a buyer and a seller so you can to test from both the seller and buyer perspective. Read the PayPal sandbox user guide.
Make sure you follow all the directions in setting up a sandbox test environment, including the addition of fake bank accounts and credit cards.

Related

Why PayPal IPN work on Simulator, but not working on sandbox?

I made a copy of this script on my server. And when I test it on IPN simulator in the developer panel, and everything is fine - I get emails and the logs are saved. But when I try to test the same script via sandbox facilitator account, the script does not work. I added the URL of the IPN script in the settings and I'm testing as buyer account.
Tell me please, what else can check?
You need to make sure you've configured the SELLER sandbox account you're using with the IPN URL that you are testing.
Also, make sure this is not getting overridden by the PayPal button or API integration you are testing with. For example, the Notify URL parameter can be used to specify an IPN URL in payment requests, and this would override anything set at the account level.
If you have the URL set properly, and you don't have an override, it should hit that URL as expected. You can check the IPN History of the sandbox seller account to verify whether or not IPNs are getting sent.

Paypal IPN not firing?

I have a question about Paypal IPN, I was wondering when does the IPN activate and send it's message to my website.
I currently have my website that has a buy button. When the client buy the service, he is directed to paypal. Once he pay the service, nothing happen. In order for me to receive the IPN notification, the user has to click "Return to merchant website" or whatever the link is, then I receive the IPN notification.
Is it normal, does it work like that for everyone?
Cause right now, most people when they are done with the payment, just close the website and I don't receive any notification.
Thanks for any help !
Your question leaves a lot of missing information so I will go through each option for you:
Read here about how to setup a sandbox account if you don't already have one: https://developer.paypal.com/docs/classic/lifecycle/sb_create-accounts/
Bare in mind that your sandbox account is entirely separate in every way from your live paypal account. All settings will need to be checked and customised as needed.
Set up your IPN URL on your sandbox account Here: https://www.sandbox.paypal.com/uk/cgi-bin/webscr?cmd=_profile-ipn-notify
Once set up, you then need to download and set your code (PHP or something else) to the listener (referenced in the above sandbox profile link). You can find IPN code examples here: https://github.com/paypal/ipn-code-samples
When that's all set you need to set your listener to using the sandbox mode and then log in to your live account and then run the IPN simulator from here: https://developer.paypal.com/developer/ipnSimulator/
Paypal will send messages to your IPN listener and you need to do something with the messages, typically output them into some sort of log file. Any issues, you can read Paypals feedback and IPN data/delivery information here https://www.sandbox.paypal.com/uk/cgi-bin/webscr?cmd=_display-ipns-history&nav=0.3.4 [Found from History->ipnHistory on the Paypal menu] and it should list them out. You can resend any failed or queued or undelivered messages.
Paypal is a terribly documented and terribly structured system for coding with. I hate it. Use Stripe.
I love bullet points.
Paypal claims they will try and resend failed/queued IPNs 16 times over 5 days. I have yet to see this, you need to resend them manually (at least, sandbox ones)
Please remember all the settings and changes you have made to your Sandbox account will need to be also made to your live account before you make your payment system live!
Solution
My return_URL is the location of my IPN.php file which take care of the data sent and received. My problem is that the IPN is only firing when I click the "Return to merchant website" and not when the payment is actually completed
What you have done, from reading your comments, is set your IPN page to being your return from paypal page, this is NOT the way IPN is supposed to work, the IPN page should never be visited by the customer, only ever by Paypal.
Read through my anwser (points 2,3,4) and set up your IPN web link as I have described above, your return_url value should be a basic page to say to the customer "transaction complete". The IPN page is defined on your paypal accounts (sandbox and live) as I stated above.
This will fix your problem.

Detecting all parts of a parallel payment with IPN

I have a parallel payment setup on my dev website, which allows a user to make 2 payments in parallel. Part 1 of the payment goes to the main website, i.e. the site which the user is paying from, i.e. the website which initiates the paypal payment. Part 2 of the payment goes to a completely different paypal account which is unrelated to the main website.
I am using ipn.php on my dev server to detect the status of the payment. When the main sites payment is received (part 1), this is detected by my dev servers ipn.php file. However, the ipn.php file does not seem to detect the other payment (part 2) which goes to the other paypal account which is unrelated to the main website. Is this behavior normal for the ipn system, or is there a way to get my dev servers ipn.php to detect both parts of the parallel payment even though part 2 of the payment is going to someone else?
Each individual payment would trigger an IPN based on the account the payment went to. Sounds like you've got your own IPN configured, but you're only getting an IPN for the payment that comes to you, which would be expected. The other payment would only trigger an IPN for that receiver if they had IPN configured in their own account.
That said, you can set an IPN for the application within your pay request using the NotificationURL parameter. This would send an app specific IPN to the URL specified which is separate from the individual payment IPN's that each receiver may or may not get based on their own settings.
So, it sounds to me like you need to setup the NotificationURL for an app specific IPN, and then you can configure IPN within your PayPal account to get more details about the individual payment that comes to you, and then the 3rd party could configure their own IPN based on their needs for the payment that goes to them.
Make sense?

Paypal IPN not working on another paypal account

We have this website that was running since September 2013 and relying on paypal IPN for user registration. However, this week we got a report from the client where 3 users was able to pay through paypal but was not registered into the site.
We temporary changed the paypal email('business' field) from the client's to another paypal account. Went through the process of registration and the IPN was successfully delivered. The user was created in the system, the IPN transaction was logged into our system. When we tried to changed it back to the client's paypal email account, but unfortunately the IPN did not reached through our system.
Here are some questions that I have in mind
Does the type of paypal account (ie. business or personal account) matter when sending and receiving IPNs? Could this be a possibility? (even though last year it was working perfectly fine with the client's paypal account)
We've been receiving this paypal email (below) for the past months. That email was appearing after a few months when we opened the site and we didn't even changed a single code from our IPN listener. Could this be the reason why the IPN was not sent when we use the client's paypal account? However, we always use the notify_url field since we have multiple IPN listeners.
>Please check your server that handles PayPal Instant Payment
>Notifications (IPN). IPNs sent to the following URL(s) are failing:
>
>http://<site>/payment/postback/
>
>If you do not recognize this URL, you may be using a service provider
>that is using IPN on your behalf. Please contact your service provider
>with the above information. If this problem continues, IPNs may be
>disabled for your account.
thanks,
Your IPN script is not completing successfully, so PayPal's server is not getting a 200 result back, which causes it to send repeat IPN's and will eventually disable itself as the message says.
Your web server logs should provide the info you need. Check there to see the history of the IPN script getting hit and you'll probably find some 500 results. Those should also provide the actual error that happened so you can get it resolved.
It's possible that some IPN's are working just fine but others are failing based on certain characters in payer information or other similar issues. You need to get all of that worked out in your IPN script so it can handle anything thrown at it.

Not receiving any IPN post for sandbox account

I'm using sandbox accounts to test SetExpressCheckout and DoExpressCheckout methods. However, I'm not receiving any IPN notifications.
My PC has public IP and firewall is off, so I'm expecting IPN posts but none are coming. Is there anything I should do (e.g. any profile settings) to start receiving IPN? (I'm using the Java SDK and passing the notify_url as parameter)
I'm also checking the "IPN History Page" from PayPal.com and I do not find any data there. Am I supposed to find IPN data in this page even if I use the sandbox accounts?
Thanks for your help
EDIT: I solved the problem by transfering my code to another server. something must have been wrong with my public IP.
Make sure you have IPN enabled in your test Sandbox PayPal account. Also, you will not see IPN messages in your PayPal account if you are going to www.paypal.com. This would only be for live IPN messages sent through your live account. If you are wanting to see the IPN messages for your sandbox transactions, you would need to log into the sandbox seller account and view the IPN messages from there.