Will `Notify_URL` override previous set IPN data - paypal

I am building an IPN extension for a website, but the service provider for the cart used at the moment has the option Notify_URL set (in the paypal submission form) for its own internal handling (which is somewhat flawed). If an IPN URL is set on the PayPal sellers profile, will both be used, or only one?

There appears to be some confusion on this subject. Some are claiming that both will work. They claim it should notify both in this situation. Though it appears that with subscription based payments, PayPal will only use the IPN URL set in your PayPal profile.
However, on the official PayPal documentation:
You can specify an IPN listener for a specific payment; this is the
only way to receive IPNs associated with Adaptive Payments. In this
case, PayPal sends the IPN message to the listener specified in the
notification URL for a specific button or API operation instead of the
listener specified in your Profile.
Which seems to suggest that the notify_url will override the profile settings. I would assume that it would be better to follow the PayPal documentation then something that may be working even though it isn't intended to.
Source: PayPal Documentation
It's also worth noting that if you disable IPNs in your PayPal account, neither will work.

I think the documentation may have changed since this was last answered. I was also curious what was given precedence: notify_url or your profile's IPN url. From the docs:
Optionally, you can override the URL to specify another listener for specific payments.
Here the wording is slightly confusing, but it seems that even if you have IPN turned off in your profile, if you pass a notify_url value in with the payment, it will still be sent. Bold added by me:
The IPN message will always be sent to your notification URL unless receiving IPN messages has been disabled. Even though you have not enabled receiving IPN messages in your Profile or you have reset your preference by turning off IPN messages, PayPal still sends IPN messages to the notification URL you specify for a specific payment.
I have seen this work first hand, which is why I investigated it more to make sure it was working correctly. My IPN History told me "your IPN notifications are turned off," prompting me with a link to turn it on. However, below that was a history. The reason was because I was passing in my desired notify_url with the transaction.
So #johnmadrak's statement, "It's also worth noting that if you disable IPNs in your PayPal account, neither will work," is actually not true. Even if you've turned the setting off in your profile, passing in a notify_url still works.

Related

PayPal, IPNs for Xenforo and Buttons

I have to figure out what I need to do to sort out a couple of IPN problems I have created.
Here's what I have:
- One PayPal account
- PayPal Buttons that do not require IPNs
- 2 Xenforo forums which have paid user upgrades activated
I have activated IPN under Notifications for the Xenforo site that is active. The second site is not used much and with only one IPN, that means it gets an error. This is not my first concern right now.
My buttons get used, and also through IPN errors. I see I can override the notify_url in the advanced settings, but I don't have an url to use. I don't need an url notified for these purchases. Is there something I can put in there to overide the xenforo notify_url or simply cause the button to not notify any url?
How can I deal with two xenforo sites when I am only allowed one PayPal account?
Thanks for explaining my options
Any transaction can specify its own notify_url at transaction setup/creation/redirect time , which will override any setting in the PayPal account.
The Notify URL in the PayPal account is just the default one that will be used if none is given at transaction time.
Ensure that any URL you give responds with an HTTP 200 OK/success status, since if it does not respond with a 2xx status, PayPal will consider the delivery failed and will keep retrying and will eventually deactivate the IPN delivery service for your account.

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.

IPN doesn't seem to work the way it should based on PayPal's docs

We have created a small app to help users manage certain PayPal orders, but the IPN doesn't seem to work as expected. I found this at the note at the bottom of the following URL:
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNSetup/
"Even though you have not enabled receiving IPN messages in your Profile or
you have reset your preference by turning off IPN messages, PayPal still
sends IPN messages to the notification URL you specify for a specific
payment."
Based on this we instructed our beta testers not to worry about enabling IPN in their account, since we specify the notification URL for the user's transaction via the notify_url field in the button code. But then no IPN is sent.
Next we instructed our beta testers to enable IPN, and since doing so requires you to enter a notification URL and users don't want transaction data for EVERY transaction posted to our system, and we don't want that either, we instructed them to enter a "fake" URL and disable sending messages to that URL in their account. Based on the note at the link above we figured this should work too, but it doesn't. No IPN is sent, although you can now see the message in the IPN history.
So I'm a little stumped here. The way I see it, we only have 2 options, and neither seems ideal ...
Instruct our users to enable IPN and hard-code our IPN notification URL into their profile settings. This means if they're already using IPN for something else they can't do this, and even if they can it means that data for EVERY transaction they do will hit our system and neither the user nor we want that.
Instruct our users to enter a "bogus" notification URL in their account, and leave messages to that URL enabled, since we'll override this with our own notify_url setting. This would work, however it will cause PayPal to attempt to send messages to an invalid notification URL for any transactions NOT processed through our system. I assume PayPal doesn't want this, and it could possibly lead to the user losing IPN access in the future due to constant IPN errors, etc.
Anyone have any ideas for me? Thanks!
In experience, as you're finding, you do need IPN enabled in order for the IPNs to be sent, but then if you specify notify_url it will override the URL in the profile.
Instead of setting up a bogus URL, though, you could put any actual script there. Just make it a script that does absolutely nothing. That way IPNs that get sent here will "do nothing" other than send a 200 OK back to PayPal's server showing that the IPN was received successfully.
If they're already using their own IPN solution and the data needs to go through both then you'll have to setup an IPN forwarder. You can daisy-chain IPN URLs to that a bunch of them get hit with the same data if you need to.
Personally, I like to have some sort of a catch-all IPN setup in my profile that saves any IPNs it gets to my database for logging purposes. Then, again, the notify URL can be used to override this if necessary.

Paypal IPN: my domain suffix appears twice

I am setting up my IPN for PayPal its been tested using a send box account and the site worked.
Now that I have gone live I am testing using real money and the ipn set up is
www.mysite.co.uk/XXXXXXXXX
However when I make the payment I notice in the url reply on my browser and when I check the IPN history on Paypal it says www.mysite.co.uk.co.uk. The.co.uk` appears twice. I assume this is the reason I am not getting the orders finalised on my backend.
There are two places you can specify the IPN listener URL:
your PayPal profile, or
with your transaction
It's very likely to be caused by mis-configuration in either of the two places.
If you specified it with your transaction, depending on the product you use, you may be able to find it in a parameter similar to "notify_url" or "PAYMENTREQUEST_0_NOTIFYURL". You'd need to refer to the documents of the product you are using.

Paypal notify_url if IPN not enabled

If my Paypal account does not have the IPN URL enabled, will it still be possible to receive POST data from Paypal if I use the notify_url
If the IPN is not enabled for the account and I set the notify_url, will I receive anything?
Yes, you will receive IPN.
notify_url will keep sending IPN notifications when used.
Yes, it will currently work on a PayPal account where the "global" IPN URL has never been set/enabled or where it is currently set/enabled. However, if you disable a previously enabled PayPal global IPN URL, any buttons with notify_url will stop working even if they worked before (they actually get queued in the IPN message queue but not sent like they used to). My conclusion is that the first time you enable the global IPN URL, PayPal initializes the IPN message logger/queue for your account. From there, there is no way to get back to the original behavior that I can find. On the bright side, this same logger/queue makes it really easy to inspect and troubleshoot (and even re-send) IPN messages...
Assuming you mean no IPN URL defined at PayPal, yes, provided you have IPN enabled.
You can supply the notify_url yourself in the per-button form data.